Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
gdb-在二进制文件中的特定文件中设置断点_Gdb - Fatal编程技术网

gdb-在二进制文件中的特定文件中设置断点

gdb-在二进制文件中的特定文件中设置断点,gdb,Gdb,如何在该二进制文件的某个特定文件中的某个行no处为特定函数设置断点 如果我给出直接行号或func名称和文件号,它将无法识别。请帮助 (gdb) b processMessage No symbol table is loaded. Use the "file" command. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) file aqm_wfmgr Reading symbols

如何在该二进制文件的某个特定文件中的某个行no处为特定函数设置断点

如果我给出直接行号或func名称和文件号,它将无法识别。请帮助

(gdb) b processMessage

No symbol table is loaded.  Use the "file" command.

Make breakpoint pending on future shared library load? (y or [n]) n

(gdb) file aqm_wfmgr

Reading symbols from /home/dir/bin/mgr...done.

(gdb) b processMessage
Function "processMessage" not defined.

很可能您的二进制文件缺少调试信息。确保您至少使用
-g
(假设您使用的是gcc)编译它。

中断文件名:filenumber实际上可以工作,但它会给出一个错误,即
(gdb)中断文件1.C:500文件“FILE1.C”中没有第500行。
。但实际代码中有一行500。您是否尝试过设置硬件断点?请参阅“hbreak”命令。由于断点位于内存地址上,因此不需要源文件;由于内存地址存储在调试寄存器中,因此无需使用陷阱指令修补二进制文件。Iam仅使用debug-g选项编译,仍然存在此问题。
(gdb) b 599

Cannot access memory at address 0x498f14

(gdb) b 598

Cannot access memory at address 0x498f14

(gdb) b processMessage 598

Function "processMessage" not defined.