Sar*_*san 9 user-interface frontend gdb
我想编写一个基于GUI的调试器包装在GDB上.因为,我不希望程序在观察点或断点后停止.相反,它应该将文件名,行号,新值和填充等详细信息重定向到文件并继续执行.
我在编写脚本方面非常糟糕.所以,我想要一些起点开始为GDB开发前端.据我搜索,这个链接http://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_node/gdb_211.html对于这项活动的初学者来说是不是很容易理解?
希望我能在C/C++中获得开发方面的帮助.
sco*_*ttt 13
对于编写GDB前端,您确实希望使用GDB/MI协议,但可能会读取此最新副本而不是您链接到的旧版本.
(GDB手册中本节的轻微编辑版本)
使用MI Command Interpreter启动GDB
$ gdb -q --interpreter=mi2
=thread-group-added,id="i1"
(gdb)
Run Code Online (Sandbox Code Playgroud)
文件/ bin/true
-file-exec-and-symbols /bin/true
^done
(gdb)
Run Code Online (Sandbox Code Playgroud)
打破主力
-break-insert main
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004014c0",func="main",file="true.c",fullname="/usr/src/debug/coreutils-8.17/src/true.c",line="59",times="0",original-location="main"}
(gdb)
Run Code Online (Sandbox Code Playgroud)
运行和断点命中
-exec-run
=thread-group-started,id="i1",pid="2275"
=thread-created,id="1",group-id="i1"
^running
*running,thread-id="all"
(gdb)
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/lib64/libc.so.6",target-name="/lib64/libc.so.6",host-name="/lib64/libc.so.6",symbols-loaded="0",thread-group="i1"
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004014c0",func="main",file="true.c",fullname="/usr/src/debug/coreutils-8.17/src/true.c",line="59",times="1",original-location="main"}
*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x00000000004014c0",func="main",args=[{name="argc",value="1"},{name="argv",value="0x7fffffffde98"}],file="true.c",fullname="/usr/src/debug/coreutils-8.17/src/true.c",line="59"},thread-id="1",stopped-threads="all",core="1"
(gdb)
Run Code Online (Sandbox Code Playgroud)
继续
-exec-continue
^running
*running,thread-id="1"
(gdb)
=thread-exited,id="1",group-id="i1"
=thread-group-exited,id="i1",exit-code="0"
*stopped,reason="exited-normally"
Run Code Online (Sandbox Code Playgroud)
退出GDB
(gdb)
-gdb-exit
^exit
Run Code Online (Sandbox Code Playgroud)
在C,C++,Java,Python中有几个GDB/MI客户端实现.我将列出一些我觉得易于阅读的内容:
| 归档时间: |
|
| 查看次数: |
5405 次 |
| 最近记录: |