简体   繁体   中英

GDB can not locate source files

I'm using GDB with the "Open On-Chip Debugger" project to debug a cross compiled project for remote MIPs target and for some reason GDB can't locate the source files.

Here I invoke GDB on the target elf file.

development@ubuntu:~/vitessesdk/CEServices/build$ mipsel-vtss-elf-gdb obj/CEServices.elf
GNU gdb (crosstool-NG 1.20.0 - vtss-eCos-toolchain-v2) 7.8
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-build_unknown-linux-gnu --target=mipsel-vtss-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
****Reading symbols from obj/CEServices.elf...done.****
(gdb)

At this point I type in the target remote command to connect

(gdb) target remote localhost:3333
Remote debugging using localhost:3333
0xa0000000 in ?? ()
(gdb) step

Cannot find bounds of current function

(gdb) list
78  /home/development/vitesseSDK/CEServices/build/../third_party/eCos/packages/language/c/libc/startup/current/src/main.cxx: No such file or directory.
(gdb) 

I'll a listing of the directory and the file is there.

development@ubuntu:~/vitessesdk/CEServices/build$ ls ../third_party/eCos/packages/language/c/libc/startup/current/src/main.cxx
../third_party/eCos/packages/language/c/libc/startup/current/src/main.cxx
development@ubuntu:~/vitessesdk/CEServices/build$

Any ideas as to why this is happening?

Read section about source path in GDB . You need to use the dir command inside (gdb) command. prompt.

As it turns out, when debugger the remote target after issuing a "target remote localhost:3333" I needed to issue a "load" to load the image to the target because I'm not running gdbserver on the target. After the load, it worked fine. – Bruce Lavoie just now

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM