gdb / mi жалуется на неопределенную команду, когда я использую -display-insert
соответствующую страницу в руководстве по gdb
Команда -display-insert
Сводка
-display-insert expression
Отображать выражение каждый раз, когда программа останавливается.
Команда GDB
Соответствующей командой GDB является `display '.
Моя операция:
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.3\n"
~"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/>."
~"\n\n"
~"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 main\n"
~"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
&"r\n"
~"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:10\n"
~"10\t 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
будет работать так же, как display
в gdb, как и требовалось в руководстве.