当你在使用GDB(GNU调试器)时遇到“function not defined”的错误,这通常意味着GDB无法识别或访问你试图调试的程序中的某个函数。以下是一些解决此问题的步骤: 检查GDB安装与配置: 确保GDB已经正确安装在你的系统上。你可以通过运行gdb --version来检查GDB是否已安装以及其版本信息。 如果GDB未安装或版本过旧,你可...
Function "main" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (main) pending. (gdb) b liba_func Breakpoint 2 at 0x401030 (gdb) run Starting program: /home/zy/debuginfo/test [Thread debugging using libthread_db enabled] Using host lib...
如果目标调试命令不支持后台执行的形式,当我们尝试使用“命令名+&”的方式执行该命令时,GDB 调试器会提示类似“Function "&" not defined.”的错误信息。 后台执行命令异步调试程序的方法,多用于 non-stop 模式中。虽然 all-stop 模式中也可以使用,但在前一个异步命令未执行完毕前,仍旧不能执行其它命令。 GDB in...
(gdb) info functions All defined functions: File a.c: int main(void); void *thread_func(void *); Non-debugging symbols: 0x0805079c _PROCEDURE_LINKAGE_TABLE_ 0x080507ac _cleanup@plt 0x080507bc atexit 0x080507bc atexit@plt 0x080507cc __fpstart 0x080507cc __fpstart@plt 0x080507dc ex...
(gdb) b foo Function "foo" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (foo) pending. (gdb) r Starting program: /home/cambricon/code/sharedlib/a.out Breakpoint 1, 0x00007ffff7fc30b0 in foo()@plt () from libfoo.so (gdb) 结...
(gdb)break sum.main() Function "sum.main()" not defined. Make breakpoint pending on future shared library load? (y or [n]) n 目前我不知道是否是GDB的bug,不过Workaround的解决方案如下: 1)先List类的构造函数,这样可以找到源文件。 2)使用源文件的行号进行break。
Function "oneflow::one::Tensor::is_eager" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (oneflow::one::Tensor::is_eager) pending. 再然后,输入run运行Python编辑器。在Python prompt中,输入oneflow。
Function "set " not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (set) pending. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21.
(gdb) b main /* 这是在程序的 main 处设置断点 */ Breakpoint 1 at 0x804853c: file pk.cpp, line 7. (gdb) b set /* 这是在程序的 set 处设置断点 */ Function "set" not defined. Make breakpoint pending on future shared library load? (y or [n]) y /* 这里必须选择 y 调试程序才...
break function-name 使程序恰好在进入指定的函数之前停止。 break line-or-function if condition 如果condition(条件)是真,程序到达指定行或函数时停止。 break routine-name 在指定例程的入口处设置断点 如果该程序是由很多原文件构成的,你可以在各个原文件中设置断点,而不是在当前的原文件中设置断点,其方法如下:...