简体   繁体   English

GDB找不到源文件

[英]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.我将 GDB 与“Open On-Chip Debugger”项目一起使用来调试远程 MIP 目标的交叉编译项目,但由于某种原因,GDB 无法找到源文件。

Here I invoke GDB on the target elf file.在这里,我在目标 elf 文件上调用了 GDB。

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 .阅读有关GDB 中源路径的部分。 You need to use the dir command inside (gdb) command.您需要在(gdb)命令中使用dir命令。 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.事实证明,在发出“目标远程本地主机:3333”后调试远程目标时,我需要发出“加载”以将图像加载到目标,因为我没有在目标上运行 gdbserver。 After the load, it worked fine.加载后,它工作正常。 – Bruce Lavoie just now – 布鲁斯·拉沃伊(Bruce Lavoie)刚才

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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