hello.c
#include <stdio.h>
int f(int i) {
return i * 2;
};
int main() {
printf("Hello world : %d\n", f(10));
return 0;
}
编译
g++ -g hello.c -o hello
调试
gdb ./hello
(gdb)b main
(gdb) r
神器体验
输入 : p f(30)
#include <stdio.h>
int f(int i) {
return i * 2;
};
int main() {
printf("Hello world : %d\n", f(10));
return 0;
}
编译
g++ -g hello.c -o hello
调试
gdb ./hello
(gdb)b main
(gdb) r
神器体验
输入 : p f(30)
本文标题:[神器点滴之gdb]"p"的小秘密
本文链接:https://www.haomeiwen.com/subject/sckkqttx.html
网友评论