4.基础命令(rb)

4.1 rb<模糊函数名>

(gdb) rb testFun
Breakpoint 1 at 0x1aa8: file FUN2.cpp, line 8.
int FUN2::testFun2();
Breakpoint 2 at 0x17ac: file main.cpp, line 12.
void FUNC::testFun1();
Breakpoint 3 at 0x13f1: file main.cpp, line 26.
int testFun(int);
Breakpoint 4 at 0x1379: file main.cpp, line 17.
void testFun(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >);
(gdb) i b
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x0000000000001aa8 in FUN2::testFun2() at FUN2.cpp:8
2       breakpoint     keep y   0x00000000000017ac in FUNC::testFun1() at main.cpp:12
3       breakpoint     keep y   0x00000000000013f1 in testFun(int) at main.cpp:26
4       breakpoint     keep y   0x0000000000001379 in testFun(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at main.cpp:17

也可以在命令后添加* ,效果相同

(gdb) d
Delete all breakpoints, watchpoints, tracepoints, and catchpoints? (y or n) y
(gdb) rb testFun*
Breakpoint 5 at 0x1aa8: file FUN2.cpp, line 8.
int FUN2::testFun2();
Breakpoint 6 at 0x17ac: file main.cpp, line 12.
void FUNC::testFun1();
Breakpoint 7 at 0x13f1: file main.cpp, line 26.
int testFun(int);
Breakpoint 8 at 0x1379: file main.cpp, line 17.
void testFun(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >);
(gdb) i b
Num     Type           Disp Enb Address            What
5       breakpoint     keep y   0x0000000000001aa8 in FUN2::testFun2() at FUN2.cpp:8
6       breakpoint     keep y   0x00000000000017ac in FUNC::testFun1() at main.cpp:12
7       breakpoint     keep y   0x00000000000013f1 in testFun(int) at main.cpp:26
8       breakpoint     keep y   0x0000000000001379 in testFun(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at main.cpp:17
posted @ 2026-05-19 22:47  BlackSnow  阅读(9)  评论(0)    收藏  举报