這裏是我的示例程序:GDB不能踏入的printf
#include<stdio.h>
int main()
{
printf("hello good morning \n");
return 0;
}
gcc -Wall -g temp.c
/opt/langtools/bin/gdb a.out
HP gdb 3.3 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 3.3 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
(gdb) b 6
Breakpoint 1 at 0x2b14: file temp.c, line 6.
(gdb) run
Starting program: /oo_dgfqausr/test/dfqwrk4/temp/a.out
Breakpoint 1, main() at temp.c:6
6 printf("hello good morning \n");
(gdb) step
hello good morning
7 return 0;
(gdb)
只要我嘗試步入退出並返回到主中的printf function.its。 這是否意味着在其中定義了printf函數的shred庫沒有提供調試符號?或者我做錯了什麼?
出於好奇,存在源而不是調試符號意味着你可以步入功能? – 2011-04-01 11:54:01
@Ricko M:不,您需要調試符號才能進入,並且在步進時使源代碼具有gdb顯示源代碼行。 – Erik 2011-04-01 11:58:06
謝謝.. omg獨角獸! – 2011-04-01 11:59:38