我正在玩gdb来调试和分析简单的C程序,例如
#include <stdio.h>
#include <stdlib.h>
int main() {
int i = 8;
printf("Your lucky number is %d\n", i);
}
当我在dbg中调试并在printf
调用时停止时,gdb只看到第一个参数,而不是第二个参数:
(gdb) break "printf"
Breakpoint 1 at 0x4004c0
(gdb) run
Starting program: /tmp/sq/a.out
Breakpoint 1, __printf (format=0x4006f4 "Your lucky number is %d\n") at printf.c:28
28 printf.c: No such file or directory.
为什么?怎么看其余的?它是否特定于printf?
(glibc 2.23,gcc 5.4,gdb 7.11.1,如果相关的话)