gdb7.7不加载共享库
也许我误解了什么,但我不能让Gdb阅读调试库。 我从命令行执行的操作是:gdb7.7不加载共享库,gdb,Gdb,也许我误解了什么,但我不能让Gdb阅读调试库。 我从命令行执行的操作是: gdb file problem_exec b main r 广东银行的站位为: (gdb) r Starting program: /Users/.../problem_exec Breakpoint 1, main (argc=<error reading variable: Could not find the frame base for "main(int, char**)".>, argv=&l
gdb
file problem_exec
b main
r
广东银行的站位为:
(gdb) r
Starting program: /Users/.../problem_exec
Breakpoint 1, main (argc=<error reading variable: Could not find the frame base for "main(int, char**)".>, argv=<error reading variable: Could not find the frame base for "main(int, char**)".>)
最后一个命令给出:“此时未加载共享库。”
我的.gdbinit看起来像:
# file .gdbinit
set stop-on-solib-events 1
# stop gdb from stepping over functions and output diagnostics
set step-mode on
set breakpoint pending on
set env DYLD_LIBRARY_PATH path1:path2:path3
#automatically load shared libraries (on/off):
set auto-solib-add on
我确信一个可执行文件是针对共享库的调试版本链接的(总共有大约30个库,但我感兴趣的库肯定是在调试模式下编译的)。我和otool-L problem\u exec检查过了
如果我运行这个程序,它会一直运行到我想要调试的库中出现运行时错误,但我无法介入。我错过什么了吗 p、 我在os-x上运行自编译版本的Gdb 更新:可能与此有关
在solib事件1上设置停止
使用该设置,GDB应该在加载任何共享库之前停止
执行此操作时:
file problem_exec
b main
r
... where is GDB stopped?
info shared
如果GDB在main
停止,则应加载共享库。但是,如果它在动态加载程序中停止(正如我所期望的那样),那么它们还不应该被加载。我更新了问题,似乎它在main中停止,但无论如何都不会加载共享lib
file problem_exec
b main
r
... where is GDB stopped?
info shared