gdb mi undified command: -display-insert



gdb/mi 在使用时抱怨未定义的命令-display-insert

GDB 手册中的相关页面

-

display-insert 命令

概要

-显示插入表达式

每次程序停止时显示表达式。

GDB 命令

相应的 GDB 命令是"显示"。

我的操作:

gdb test -i mi
b main
r
-display-insert $rsp

输出:

[yuan@Blanche test]$ gdb test -i mi
=thread-group-added,id="i1"
~"GNU gdb (GDB) 8.3n"
~"Copyright (C) 2019 Free Software Foundation, Inc.n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>nThis is free software: you are free to change and redistribute it.nThere is NO WARRANTY, to the extent permitted by law."
~"nType "show copying" and "show warranty" for details.n"
~"This GDB was configured as "x86_64-pc-linux-gnu".n"
~"Type "show configuration" for configuration details.n"
~"For bug reporting instructions, please see:n"
~"<http://www.gnu.org/software/gdb/bugs/>.n"
~"Find the GDB manual and other documentation resources online at:n    <http://www.gnu.org/software/gdb/documentation/>."
~"nn"
~"For help, type "help".n"
~"Type "apropos word" to search for commands related to "word"...n"
~"Reading symbols from test...n"
(gdb) 
b main
&"b mainn"
~"Breakpoint 1 at 0x1165: file test.c, line 10.n"
=breakpoint-created,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000001165",func="main",file="test.c",fullname="/home/yuan/test/test.c",line="10",thread-groups=["i1"],times="0",original-location="main"}
^done
(gdb) 
r
&"rn"
~"Starting program: /home/yuan/test/test n"
=thread-group-started,id="i1",pid="14434"
=thread-created,id="1",group-id="i1"
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000555555555165",func="main",file="test.c",fullname="/home/yuan/test/test.c",line="10",thread-groups=["i1"],times="0",original-location="main"}
=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",ranges=[{from="0x00007ffff7fd4100",to="0x00007ffff7ff2c64"}]
^running
*running,thread-id="all"
(gdb) 
=library-loaded,id="/usr/lib/libc.so.6",target-name="/usr/lib/libc.so.6",host-name="/usr/lib/libc.so.6",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00007ffff7dde630",to="0x00007ffff7f2689f"}]
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000555555555165",func="main",file="test.c",fullname="/home/yuan/test/test.c",line="10",thread-groups=["i1"],times="1",original-location="main"}
~"n"
~"Breakpoint 1, main () at test.c:10n"
~"10t  int x = 1;n"
*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0000555555555165",func="main",args=[],file="test.c",fullname="/home/yuan/test/test.c",line="10",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="2"
(gdb) 
-display-insert $rsp
^error,msg="Undefined MI command: display-insert",code="undefined-command"
(gdb) 

注意错误

^error,msg="Undefined MI command: display-insert",code="undefined-command"

我希望-display-insert像 gdb 中的display一样工作,这就是手册所声称的。

这是旧的 GDB 手册,当前的手册可以在这里找到: https://sourceware.org/gdb/current/onlinedocs/gdb/

-display-insert 命令在 2006 年从手册中删除 - 我不相信这个命令曾经真正实现过......或者也许它是在 2006 年之前从 GDB 中删除的。

在使用 MI 时,您需要研究使用 GDB/MI 变量对象而不是显示命令,请参阅手册的这一部分:https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html#GDB_002fMI-Variable-Objects

最新更新