bp(用于在指定的代码地址设置断点)
当程序执行到该断点时,会暂停程序的执行并返回到调试器中
命令:bp
示例:
命令:bp gendb!main
输出:
echo: ‘bp gendb!main’
bp gendb!main
bl(用于列出当前已设置的所有断点)
示例
命令:bl
输出:
echo: ‘bl’
bl
0 e 00000055`865407d4 0001 (0001) 0:|gendb!main
列出了当前所有的断点及其详细信息。
dd(以双字(4个字节)为单位显示内存数据)
命令:dd
基本用法: dd <地址> [长度]:
基本用法: dd <地址> [长度]:
参数:
<地址>:要显示的内存地址。
[长度]:可选参数,指定要显示的双字数,默认为1。
示例:dd 0x00400000 L3:显示0x400000地址开始的3个双字的数据。
输出:
echo: ‘dd’
dd
0000005575ad1a58 a9467bfd 9101c3ff d65f03c0 d503201f
00000055
75ad1a68 a9bf7bfd 910003fd a8c17bfd d65f03c0
0000005575ad1a78 00020001 00000000 6c6c6548 0000216f
00000055
75ad1a88 6e686f4a 00000000 65746e69 3a726567
0000005575ad1a98 00000000 00000000 616f6c66 00003a74
00000055
75ad1aa8 72616863 0000003a 69727473 003a676e
0000005575ad1ab8 73726550 6e206e6f 3a656d61 00000000
00000055
75ad1ac8 6567412c 00000000 6965482c 00746867
dl(用于加载或卸载符号文件)
示例
命令:dl
输出:
echo: ‘dl’
0809134903E#4542:readv in 4545, @0xa9097bfdd102c3ff L8, got 0
dl
00000055620e1394 a9097bfd
d102c3ff f90053f3910243fd
00000055
620e13a4 f947e000d00000e0 f90047e1
f9400001
dq(以四字(8个字节)为单位显示内存数据。)
命令:dq
基本用法: dq<地址> [长度]:
参数:
<地址>:要显示的内存地址。
[长度]:可选参数,指定要显示的双字数,默认为1。
示例:dq 0x00400000 L2:显示0x400000地址开始的2个四字的数据
输出:
echo: ‘dq’
dq
0000005575ad19d8 f94017e0
97fffde6 f9400fe0aa0003e1
00000055
75ad19e8 1400000497fffe22 f9002be0
f9400fe0
0000005575ad19f8 9100c3e0
d503201f 97ffffbbf9400fe1
00000055
75ad1a08 97fffdf1f9400fe0 f9400be1
f94007e2
0000005575ad1a18 f9001bff
97fffdf2 aa0003e1f94017e0
00000055
75ad1a28 97fffdbdf9400fe0 97ffffb8
9100c3e0
0000005575ad1a38 f947e000
d00000e0 f9400001f9402fe2
00000055
75ad1a48 d2800001eb010042 97fffda7
54000040
dt(显示自定义类型的成员变量及其值)
命令:dt
基本用法: dt<地址> [长度]:
参数:
<地址>:要显示的内存地址。
[长度]:可选参数,指定要显示的双字数,默认为1。
示例:dt MyStruct:显示MyStruct类型的成员变量及其值。
输出:
echo: ‘dt person’
dt person
Symbol person not found.
/ndb/0:000> dt Perso
echo: ‘dt Perso’
dt Perso
Symbol Perso not found.
/ndb/0:000> dt Person
echo: ‘dt Person’
dt Person
+0x000 name : basic_string<char, std::char_traits
+0x020 age : Int4B
+0x024 height : Float
du(以Unicode字符串的形式显示内存数据)
命令:du
基本用法: du<地址> [长度]:
参数:
<地址>:要显示的内存地址。
[长度]:可选参数,指定要显示的字节数,默认为不限制长度。
示例:du 0x00400000 L20:以Unicode格式显示0x400000地址开始的20个字节的字符串。
输出:
echo: ‘du’
du
0000005575ad13d8 "
00000055
75ad1458 “
0000005575ad14d8 "
00000055
75ad1558 “
0000005575ad15d8 "
00000055
75ad1658 “
0000005575ad16d8 "
00000055
75ad1758 “
0000005575ad17d8 "
00000055
75ad1858 “
0000005575ad18d8 "
00000055
75ad1958 “
dv(显示或修改变量的值)
命令:dv
基本用法: dv [/t <类型>] [/r] <变量名称>`:
参数:
/t <类型>:可选参数,指定要显示的变量的类型。
/r :可选参数,以引用方式显示变量的值。
<变量名称>:要显示或修改的变量名称。
示例:dv myVariable:显示myVariable变量的值。
命令:dv ptr
输出:
echo: ‘dv ptr’
0807163249E#8969:readv in 8972, @0x83c823ab10 L8, got 0
0807163249E#8969:readv in 8972, @0x82c823ab18 L8, got 0
dv ptr
ptr = 00000000`00000000
说明:显示的是该指针所存储的内存地址
命令:dv *ptr
输出:
echo: ‘dv *ptr’
dv *ptr
ptr = 00000000`00000000
说明:显示的是该地址所存储的数据
dw(以字(2个字节)为单位显示内存数据)
示例
命令:dw
基本用法: dw <地址> [长度]:
参数:
<地址>:要显示的内存地址。
[长度]:可选参数,指定要显示的字数,默认为1。
示例:dw 0x00400000 L5:显示0x400000地址开始的5个字的数据
输出:
echo: ‘dw’
dw
0000005575ad1ad8 6f50 6e69 6574 2072 6176 756c 3a65 0000
00000055
75ad1ae8 0001 0000 0002 0000 0003 0000 0004 0000
0000005575ad1af8 0005 0000 0000 0000 6162 6973 5f63 7473
00000055
75ad1b08 6972 676e 203a 6f63 736e 7274 6375 6974
0000005575ad1b18 6e6f 6620 6f72 206d 756e 6c6c 6920 2073
00000055
75ad1b28 6f6e 2074 6176 696c 0064 0101 0001 0000
0000005575ad1b38 1b01 3b03 0094 0000 0011 0000 f748 ffff
00000055
75ad1b48 00ac 0000 f798 ffff 00c0 0000 f7c8 ffff
g(运行程序)
示例
命令:g
输出:
echo: ‘g’
g
0809153502E#5592:[ibp]fail to eat step out signal for thread 5595 1th time
0809153502E#5592:[ibp]failed to read name @0x7fb7c0c930 or null name. ret 0, read 256
0809153502E#5592:[ibp]fail to eat step out signal for thread 5595 1th time
0809153502E#5592:[ufzt]bad condition on thread 5595, suspend_cnt=0, state 0x4
ModLoad: 0000007fb7930000 0000007f
b7ba7000 /lib/aarch64-linux-gnu/libstdc++.so.6
ModLoad: 0000007fb78f0000 0000007f
b7921000 /lib/aarch64-linux-gnu/libgcc_s.so.1
ModLoad: 0000007fb7730000 0000007f
b78ee000 /lib/aarch64-linux-gnu/libc.so.6
ModLoad: 0000007fb7680000 0000007f
b7721000 /lib/aarch64-linux-gnu/libm.so.6
ambush 0 hit
k(用于显示当前线程的函数调用堆栈)
命令:k
示例
输出:
echo: ‘k’
0807135510E#8303:readv in 8306, @0x0 L8, got 0
0807135510E#8303:readv in 8306, @0x8 L8, got 0
0807135510E#8303:readv in 8306, @0x0 L8, got 0
0807135510E#8303:readv in 8306, @0x8 L8, got 0
k
Child-SP RetAddr Call Site
0000000000000000 0000000000000000 ld!_start [../sysdeps/aarch64/dl-start.S @ 22]
说明:它会列出堆栈中的每个函数以及它们的参数和返回值
kb(用于显示堆栈回溯)
命令:kb
示例:
输出:
echo: ‘kb’
0808170042E#5532:readv in 5535, @0x83c265c6d0 L8, got 0
0808170042E#5532:readv in 5535, @0x82c265c6d8 L8, got 0
kb
RetAddr : Args to Child : Call Site
00000082c265c6d8 : 00000000
00000000 0000007fc265c6f0 00000083
c265c6d0 00000000`00000010 : gegdb!main+0x58 [/home/geduer/gegdb/gex.c @ 14]
kc(用于显示堆栈回溯)
命令:kc
示例:
输出:
echo: ‘kc’
0808170047E#5532:readv in 5535, @0x83c265c6d0 L8, got 0
0808170047E#5532:readv in 5535, @0x82c265c6d8 L8, got 0
kc
Child-SP RetAddr Call Site
00000083c265c6d0 00000082
c265c6d8 gegdb!main+0x58 [/home/geduer/gegdb/gex.c @ 14]
kd(用于显示内核模式下的函数调用堆栈)
命令:kd
示例:
输出:
echo: ‘kd’
0808170053E#5532:readv in 5535, @0x83c265c6d0 L8, got 0
0808170053E#5532:readv in 5535, @0x82c265c6d8 L8, got 0
0808170053E#5532:readv in 5535, @0x83c265c6d0 L80, got 0
kd
gegdb!main+0x58
00000083c265c6d0 ????????
00000083
c265c6d4 ????????
00000083c265c6d8 ????????
00000083
c265c6dc ????????
00000083c265c6e0 ????????
00000083
c265c6e4 ????????
00000083c265c6e8 ????????
00000083
c265c6ec ????????
00000083c265c6f0 ????????
00000083
c265c6f4 ????????
00000083c265c6f8 ????????
00000083
c265c6fc ????????
00000083c265c700 ????????
00000083
c265c704 ????????
00000083c265c708 ????????
00000083
c265c70c ????????
00000083c265c710 ????????
00000083
c265c714 ????????
00000083c265c718 ????????
00000083
c265c71c ????????
kp(用于显示当前线程的函数调用堆栈,并以逆序列出函数)
命令:kp
示例:
输出:
echo: ‘kp’
0808170058E#5532:readv in 5535, @0x83c265c6d0 L8, got 0
0808170058E#5532:readv in 5535, @0x82c265c6d8 L8, got 0
kp
Child-SP RetAddr Call Site
00000083c265c6d0 00000082
c265c6d8 gegdb!main( void )+0x58 [/home/geduer/gegdb/gex.c @ 14]
kP(用于显示函数的源代码和符号信息)
命令:kP
示例:
输出:
echo: ‘kP’
0808170102E#5532:readv in 5535, @0x83c265c6d0 L8, got 0
0808170102E#5532:readv in 5535, @0x82c265c6d8 L8, got 0
kP
Child-SP RetAddr Call Site
00000083c265c6d0 00000082
c265c6d8 gegdb!main( void )+0x58 [/home/geduer/gegdb/gex.c @ 14]
kv(用于显示当前线程的函数调用堆栈,包含源代码信息和堆栈帧指针)
命令:kv
示例:
输出:
echo: ‘kv’
0808170108E#5532:readv in 5535, @0x83c265c6d0 L8, got 0
0808170108E#5532:readv in 5535, @0x82c265c6d8 L8, got 0
kv
Child-SP RetAddr : Args to Child : Call Site
00000083c265c6d0 00000082
c265c6d8 : 0000000000000000 0000007f
c265c6f0 00000083c265c6d0 00000000
00000010 : gegdb!main+0x58 [/home/geduer/gegdb/gex.c @ 14]
ld(用于列举已加载的模块(DLL、驱动程序等)的信息)
它可以提供有关模块名称、版本、加载地址和调试状态等的详细信息
基本用法:lm [Options]
参数:
常用的”lm”命令选项包括:
-n:按模块名称排序列出模块。按默认顺序列出模块时,它们按照它们被加载的顺序来显示。
-v:包括每个模块的版本信息。
-m:仅显示模块名称。:
示例:
lm:列举所有已加载模块的基本信息
输出:
lm(用于列举已加载的模块(DLL、驱动程序等)的信息)
它可以提供有关模块名称、版本、加载地址和调试状态等的详细信息
基本用法:lm [Options]
参数:
常用的”lm”命令选项包括:
-n:按模块名称排序列出模块。按默认顺序列出模块时,它们按照它们被加载的顺序来显示。
-v:包括每个模块的版本信息。
-m:仅显示模块名称。:
示例:
lm:列举所有已加载模块的基本信息
输出:
echo: ‘lm’
0808172338E#5532:readv in 5535, @0x0 L160, got 0
lm
start end name
0000005575ad0000 00000055
75af1000 gegdb T (pdb/dwarf symbols) /home/geduer/gegdb/gegdb
0000007fb2000000 0000007f
b20a1000 libm (deferred)
0000007fb20b0000 0000007f
b226e000 libc (deferred)
0000007fb2270000 0000007f
b22a1000 libgcc_s (deferred)
0000007fb22b0000 0000007f
b2527000 libstdc__ (deferred)
0000007fb254d000 0000007f
b258f000 ld T (pdb/dwarf symbols) /usr/lib/debug/.build-id/07/8400e5aca1792b8d78564a71d2c451ef5dbf23.debug
Unloaded modules:
lm -n:按模块名称排序列举所有已加载模块的信息
输出:
echo: ‘lm -n’
0808172552E#5532:readv in 5535, @0x0 L160, got 0
lm -n
start end name
0000005575ad0000 00000055
75af1000 gegdb T (pdb/dwarf symbols) /home/geduer/gegdb/gegdb
0000007fb2000000 0000007f
b20a1000 libm (deferred)
0000007fb20b0000 0000007f
b226e000 libc (deferred)
0000007fb2270000 0000007f
b22a1000 libgcc_s (deferred)
0000007fb22b0000 0000007f
b2527000 libstdc__ (deferred)
0000007fb254d000 0000007f
b258f000 ld T (pdb/dwarf symbols) /usr/lib/debug/.build-id/07/8400e5aca1792b8d78564a71d2c451ef5dbf23.debug
Unloaded modules:
lm -v:列举所有已加载模块的信息,并包括版本信息
输出:
echo: ‘lm -v’
0808172558E#5532:readv in 5535, @0x0 L160, got 0
lm -v
start end name
0000005575ad0000 00000055
75af1000 gegdb T (pdb/dwarf symbols) /home/geduer/gegdb/gegdb
Image path: /home/geduer/gegdb/gegdb
Checksum: 00000000 Timestamp: unavailable (00000000)
BuildID(Type-1): 5339a080-8a8c89c3-2da6de6e-39d54c07-0.133048
0000007fb2000000 0000007f
b20a1000 libm (deferred)
Image path: /lib/aarch64-linux-gnu/libm.so.6
Checksum: 00000000 Timestamp: Wed May 1 02:02:13 2024 (66313225)
BuildID(Type-1): b343d364-044e92cd-0842654e-dc74d5df-0.591800
0000007fb20b0000 0000007f
b226e000 libc (deferred)
Image path: /lib/aarch64-linux-gnu/libc.so.6
Checksum: 00000000 Timestamp: Wed May 1 02:02:13 2024 (66313225)
BuildID(Type-1): bcd71931-e2348af6-08cd4217-de725209-0.1722920
0000007fb2270000 0000007f
b22a1000 libgcc_s (deferred)
Image path: /lib/aarch64-linux-gnu/libgcc_s.so.1
Checksum: 00000000 Timestamp: Fri Apr 12 20:30:14 2024 (66192956)
BuildID(Type-1): dc717c76-63542706-a8a861ff-971d4dcb-0.133616
0000007fb22b0000 0000007f
b2527000 libstdc__ (deferred)
Image path: /lib/aarch64-linux-gnu/libstdc++.so.6
Checksum: 00000000 Timestamp: Fri Apr 12 20:30:14 2024 (66192956)
BuildID(Type-1): 67a0558a-82d12f6d-b28e50a6-bef14a9b-0.2567600
0000007fb254d000 0000007f
b258f000 ld T (pdb/dwarf symbols) /usr/lib/debug/.build-id/07/8400e5aca1792b8d78564a71d2c451ef5dbf23.debug
Image path: /usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1
Checksum: 00000000 Timestamp: Wed May 1 02:02:13 2024 (66313225)
BuildID(Type-1): e5008407-2b79a1ac-4a56788d-51c4d271-0.203968
Unloaded modules:
lm -m
输出:
echo: ‘lm -m’
0808172606E#5532:readv in 5535, @0x0 L160, got 0
lm -m
start end name
0000005575ad0000 00000055
75af1000 gegdb T (pdb/dwarf symbols) /home/geduer/gegdb/gegdb
0000007fb2000000 0000007f
b20a1000 libm (deferred)
0000007fb20b0000 0000007f
b226e000 libc (deferred)
0000007fb2270000 0000007f
b22a1000 libgcc_s (deferred)
0000007fb22b0000 0000007f
b2527000 libstdc__ (deferred)
0000007fb254d000 0000007f
b258f000 ld T (pdb/dwarf symbols) /usr/lib/debug/.build-id/07/8400e5aca1792b8d78564a71d2c451ef5dbf23.debug
Unloaded modules:
说明:“lm”命令用于查看已加载的模块,它提供有关模块名称、起始地址、结束地址以及可选的版本信息。这对于调试和分析代码很有用,因为它使你能够了解系统中加载了哪些模块以及它们的基本信息。
ls(用于列举当前执行的源代码)
示例
命令:ls
输出:
echo: ‘ls’
ls
9: int main()
10: {
11: int var=10;
12: float floatvar=3.14f;
13: char charvar=’A’;
14: string stringvar=”Hello!”;
15: int intArray[5]={1,2,3,4,5};
16: Person person={“John”,30,1.85f};
17: int *ptrvar=new int(42);
18: cout<<”integer:”<<var<<endl;
说明:
“ls”命令用于在调试过程中查看当前执行的源代码,这对于理解代码执行非常有用。
lsc(用于列举当前源文件的上下文(周围的代码行))
示例
命令:lsc
输出:
echo: ‘lsc’
lsc
Loaded ‘/home/geduer/gegdb/gex.c’ ‘/home/geduer/gegdb/gex.c’ 25 lines
Current: /home/geduer/gegdb/gex.c(13)
说明:
“lsc”命令用于在调试过程中查看当前源文件的上下文,这对于理解代码执行的上下文非常有用。
p()
示例
命令:p
输出:
echo: ‘p’
p
0809140925E#4606:[ibp]failed to read name @0x7f94139930 or null name. ret 0, read 256
0809140925E#4606:[ibp]fail to eat step out signal for thread 4609 1th time
0809140925E#4606:[ufzt]bad condition on thread 4609, suspend_cnt=0, state 0x4
ModLoad: 0000007f93e60000 0000007f
940d7000 /lib/aarch64-linux-gnu/libstdc++.so.6
ModLoad: 0000007f93e20000 0000007f
93e51000 /lib/aarch64-linux-gnu/libgcc_s.so.1
ModLoad: 0000007f93c60000 0000007f
93e1e000 /lib/aarch64-linux-gnu/libc.so.6
ModLoad: 0000007f93bb0000 0000007f
93c51000 /lib/aarch64-linux-gnu/libm.so.6
r(查看和修改寄存器的值)
命令:r
示例
输出:
echo: ‘r’
r
x0=0x0000000000000000 x1=0x0000000000000000 x2=0x0000000000000000 x3=0x0000000000000000
x4=0x0000000000000000 x5=0x0000000000000000 x6=0x0000000000000000 x7=0x0000000000000000
x8=0x0000000000000000 x9=0x0000000000000000 x10=0x0000000000000000 x11=0x0000000000000000
x12=0x0000000000000000 x13=0x0000000000000000 x14=0x0000000000000000 x15=0x0000000000000000
x16=0x0000000000000000 x17=0x0000000000000000 x18=0x0000000000000000 x19=0x0000000000000000
x20=0x0000000000000000 x21=0x0000000000000000 x22=0x0000000000000000 x23=0x0000000000000000
x24=0x0000000000000000 x25=0x0000000000000000 x26=0x0000000000000000 x27=0x0000000000000000
x28=0x0000000000000000 fp=0x0000000000000000 lr=0x0000000000000000 sp=0x0000007fcaec7420
pc=0x0000007f91182a40 pstate=0x0000000000001000 - - - - - - - - S - - - - EL0
ld!_start:
7f91182a40 d503201f nop
t(显示当前调试会话中的所有线程以及其状态)
命令:t
示例:
输出:
echo: ‘t’
t
(230c.230c): Access violation - code c0000005 (first chance)
This is the first round of exception dispatching. The exception might be expected.
说明:列出所有线程的信息,包括线程ID和当前执行的函数。这有助于分析多线程程序中的崩溃问题
ta(显示和修改线程亲和性,即线程将在哪个CPU上执行)
命令:ta
示例:
输出:
echo: ‘ta’
ta
ld!dl_main+168c:
7f8c8a74ec a94253f3 ldp x19, x20, [sp, #0x20]
ld!dl_main+1690:
7f8c8a74f0 a9435bf5 ldp x21, x22, [sp, #0x30]
ld!dl_main+1694:
7f8c8a74f4 a94463f7 ldp x23, x24, [sp, #0x40]
ld!dl_main+1698:
7f8c8a74f8 a9456bf9 ldp x25, x26, [sp, #0x50]
ld!dl_main+169c:
7f8c8a74fc a94673fb ldp x27, x28, [sp, #0x60]
ld!dl_main+16a0:
7f8c8a7500 910c03ff add sp, sp, #0x300
ld!dl_main+16a4:
7f8c8a7504 d65f03c0 ret
ld!dlsysdep_start+1d0:
7f8c8a4730 a94153f3 ldp x19, x20, [sp, #0x10]
ld!dlsysdep_start+1d4:
7f8c8a4734 a9425bf5 ldp x21, x22, [sp, #0x20]
tb(显示线程所处的阻塞状态和原因)
命令:tb
示例:
输出:
echo: ‘tb’
tb
ambush 0 hit
tc(显示线程的寄存器上下文信息)
命令:tc
示例:
输出:
echo: ‘tc’
tc
version(显示调试器版本和正在调试的目标操作系统版本)
示例
命令:version
输出:
echo: ‘version’
the CurrentTimeDate is: 2024-08-09 14:04:33
column 22 = 1759640
version
WNT Version 8600 SMP (2 procs) free ARMv8 64-bit
Product: WNT
Linux version 6.1.43-rockchip-rk3588-taiyi (root@luban) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the Arm Architecture 11.2-2022.02 (arm-11.14)) 11.2.1 20220111, GNU ld (GNU Toolchain for the Arm Architecture 11.2-2022.02 (arm-11.14)) 2.37.20220122) #1.0.8 SMP Mon J
Debug session time: Mon Oct 19 08:26:02 1953
System uptime: not available
Process Uptime: 0 days 0:00:00( 1759640 ns)
Live user mode:
Command line: ‘ndb’ engine pid 0x11FE
elk: ndi: ndw: Default extensions are not loaded yet
Extension chain:
Searching /usr/share/nanocode/ndb in /o/pt/gedu/nanocode/winext;/opt/gedu/nanocode;/usr/local/sbin;/usr/local/bin;/usr/sbin;/usr/bin;/sbin;/bin;/usr/games;/usr/local/games;/snap/bin
LoadLibrary(/usr/share/nanocode/ndb) failed: (null)
/usr/share/nanocode/ndb: (Not loaded)
vertarget(显示调试器版本和正在调试的目标操作系统版本)
示例
命令:vertarget
输出:
echo: ‘vertarget’
the CurrentTimeDate is: 2024-08-09 14:06:51
column 22 = 1759640
vertarget
WNT Version 8600 SMP (2 procs) free ARMv8 64-bit
Product: WNT
Linux version 6.1.43-rockchip-rk3588-taiyi (root@luban) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the Arm Architecture 11.2-2022.02 (arm-11.14)) 11.2.1 20220111, GNU ld (GNU Toolchain for the Arm Architecture 11.2-2022.02 (arm-11.14)) 2.37.20220122) #1.0.8 SMP Mon J
Debug session time: Mon Jul 5 22:59:59 1954
System uptime: not available
Process Uptime: 0 days 0:00:00( 1759640 ns)
wt(用于设置调试目标的特定调试标志)
示例:
命令:wt b(启用断点调试)
输出:
echo: ‘wt b’
0809153839E#5592:readv in 5595, @0x83ff3b2e10 L8, got 0
0809153839E#5592:readv in 5595, @0x82ff3b2e18 L8, got 0
wt b
integer:10
float:3.14
char:A
string:Hello!
Person name:John,Age30,Height1.85
Pointer value:42
25 0 [ 0] gegdb!main
9 0 [ 1] gegdb!std::cxx11::basic_string<char,std::char_traits
failed to parse jump target from inst x17
WARNING: Step/trace thread exited
4 0 [ 2] gegdb!_ZNSt7
38 instructions were executed in 37 events (0 from other threads)
Function Name Invocations MinInst MaxInst AvgInst
gegdb!ZNSt7__cxx1112basicstringIcSt11char_tra 1 4 4 4
gegdb!main 1 25 25 25
gegdb!std::_cxx11::basicstring<char,std::char 1 9 9 9
0 system calls were executed
示例:
命令:wt r(显示寄存器的值)
输出:(节选)
echo: ‘wt r’
wt r
0812115243E#4147:[ibp]failed to read name @0x7fb7b12930 or null name. ret 0, read 256
0812115243E#4147:[ibp]fail to eat step out signal for thread 4150 1th time
0812115243E#4147:[ufzt]bad condition on thread 4150, suspend_cnt=0, state 0x4
5 0 [ 0] ld!start
isbcc: cbz x0, #0x7fb7ae768c r = 0 val e target b7ae768c
is_bcc: cbnz x0, #0x7fb7ae7668 r = 0 val 19 target b7ae7668
is_bcc: cbnz x0, #0x7fb7ae7668 r = 0 val 1b target b7ae7668
is_bcc: cbnz x0, #0x7fb7ae7668 r = 0 val 6ffffef5 target b7ae7668
命令:wt p(显示堆栈帧中的参数列表)
输出:(节选)
echo: ‘wt p’
wt p
i= 0
i= 1
i= 2
i= 3
i= 4
i= 5
i= 6
i= 7
i= 8
i= 9
i= 10
i= 11
命令:wt s(显示源代码)
输出:(节选)
echo: ‘wt s’
wt s
0812115302E#4147:PTRACE_GETREGS for thread 4150 failed for 3
0812115302E#4147:get_reg_ctx for thread 4150 failed for 3
0812115302E#4147:writev failed to peekdata 0x7fb79ad568 errno 3
0812115302E#4147:writev failed to peekdata 0x556e840754 errno 3
命令:wt s(显示在函数调用之前和之后的位置信息)
输出:(节选)
echo: ‘wt v’
wt v
integer:10
float:3.14
char:A
string:Hello!
Person name:John,Age30,Height1.85
Pointer value:42
28 0 [ 0] gegdb!main
9 0 [ 1] gegdb!std::cxx11::basic_string<char,std::char_traits
failed to parse jump target from inst x17
WARNING: Step/trace thread exited
4 0 [ 2] gegdb!_ZNSt7
z(用于在内存中搜索特定模式并显示匹配结果的地址)
它可以帮助你定位内存中的特定数据或代码的位置。
基本用法:z [options] address pattern
参数::
通过“address”参数指定要开始搜索的内存地址,通过“pattern”参数指定要搜索的模式。
b:按字节为单位进行搜索。
w:按字(2个字节)为单位进行搜索。
d:按双字(4个字节)为单位进行搜索。
q:按四字(8个字节)为单位进行搜索。
s:按字符串进行搜索。
示例:
z 0x00400000 0x11223344
以上命令将搜索从地址0x00400000开始的内存,查找是否存在模式为0x11223344的数据,并显示匹配结果的地址。
z /s 0x00400000 “Hello, World!”
以上命令将搜索从地址0x00400000开始的内存,查找以字符串“Hello, World!”开头的字符串,并显示匹配结果的地址。
输入:z /s 0x00400000 “Hello”
输出:
echo: ‘z /s 0x00400000 “Hello”‘
/s 0x00400000 “Hello”
Numeric expression missing from ‘/s 0x00400000 “Hello”‘
命令:!uname
输出:
!uname(用于获取Linux内核的版本信息)
示例
命令:!uname
输出:
uname -a
Linux ulan 6.1.43-rockchip-rk3588-taiyi #1.0.8 SMP Mon Jul 22 10:58:30 CST 2024 aarch64 aarch64 aarch64 GNU/Linux
最后编辑:涂滨晶 更新时间:2024-08-12 13:37