Menu

#13 [debugging] no source file named xxx.c

v1.0 (example)
open
nobody
None
5
2014-10-13
2014-10-13
No

Hello,
I am using BVRDE version 1.3b to remotely debug c programs on the RaspberryPI. I have created a file which makes use of the library bcm2835-1.36 to access SPI and other pins. I have successfully compiled with the following Makefile:

all: lp

lp: lp.o
gcc lp.o -lbcm2835 -o lp

lp.o : lp.c
gcc -c lp.c

clean:
rm -rf *o lp

When starting the Debugger I had to add "sudo" to the command "gdb" to successfully start it. But suddenly BVRDE reports the error "no source file named xx.c". Please notice that the file was before successfully compiled by BVRDE with "rebuild project", so to some extent the file is seen and recognized.
Please also notice that I have open manually the file xx.c from the project windows as it DOES NOT open automatically as predicted.
Then I adden one single breakpoint at the beginning and hit "Start with Debugger".
This is the Console Output:

Linux raspberrypi 3.12.28+ #709 PREEMPT Mon Sep 8 15:28:00 BST 2014 armv6l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc//copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Oct 13 10:32:15 2014 from 193.43.20.9
cd /home/pi/cprogs/lp/
sudo gdb -i=mi ./lp
=thread-group-added,id="i1"
~"GNU gdb (GDB) 7.4.1-debian\n"
~"Copyright (C) 2012 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html\
~"This GDB was configured as \"arm-linux-gnueabihf\".\nFor bug reporting instruc
~"http://www.gnu.org/software/gdb/bugs/...\n"
~"Reading symbols from /home/pi/cprogs/lp/lp..."
~"done.\n"
(gdb)
232-gdb-set confirm off
&"\n"
^done
(gdb)
232-gdb-set width 0
232^done
(gdb)
232^done
(gdb)
232-gdb-set height 0
232-environment-pwd
232^done
(gdb)
232^done,cwd="/home/pi/cprogs/lp"
(gdb)
232-break-insert lp.c:219
232^error,msg="No source file named lp.c."
(gdb)
232-exec-arguments
232-exec-run
232^done
(gdb)
=thread-group-started,id="i1",pid="3407"
=thread-created,id="1",group-id="i1"
232^running
running,thread-id="all"
(gdb)
=library-loaded,id="/lib/ld-linux-armhf.so.3",target-name="/lib/ld-linux-armhf.s
=library-loaded,id="/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so",target-name="/u
=library-loaded,id="/lib/arm-linux-gnueabihf/libc.so.6",target-name="/lib/arm-li
AD-DA Loopback demo
Menu:
0 : set DAC to -0.5V
1 : set DAC to -0.4V
2 : set DAC to -0.3V
3 : set DAC to -0.2V
4 : set DAC to -0.1V
5 : set DAC to 0.0V
6 : set DAC to +0.1V
7 : set DAC to +0.2V
8 : set DAC to +0.3V
9 : set DAC to +0.4V
a : set DAC to +0.5V
c : readback ADC
x : exit

Please notice that if I don't use BRVDE the program runs successfully remotely by command line.

Any help is appreciated,
regards,
Marco

Discussion

  • Bjarke Viksøe

    Bjarke Viksøe - 2014-10-13

    Hi,

    From your Makefile I would have expected to see an error during debugger attachment saying "No symbols found", as you don't build with the gcc -g option. Does this help?

    Also you could try to execute "dbg info sources" in the BVRDE Command View to see what files GDB can actually see while debugging.

    bjarke

     
    • MarcoSartore

      MarcoSartore - 2014-10-13

      Hi,
      many thanks for your quick support.
      Adding the -g option which I forgot earlier fixed the issue. Many thanks again,
      Marco

       

Log in to post a comment.