当前位置: 技术问答>linux和unix
gdb时,老是提示:No symbol "**" in current context
来源: 互联网 发布时间:2016-10-09
本文导语: 我在用gdb调试程序,结果老是发现这个问题,害我什么都打印不出来。 lciahp2% /opt/langtools/bin/gdb tmwsdlflt HP gdb 5.2 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x. Copyright 1986 - 2001 Free Software Foundation, Inc. Hewlett-...
我在用gdb调试程序,结果老是发现这个问题,害我什么都打印不出来。
lciahp2% /opt/langtools/bin/gdb tmwsdlflt
HP gdb 5.2 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.2 (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) break main
Breakpoint 1 at 0x400000000000f660:0: file wsdlflt.cpp, line 44 from /nfs/tux/huchchen/localbuild/SALT3064rp/LC/bld/bin/tmwsdlflt.
(gdb) run obauthapp.tw1 "obauthapp.tws"
Starting program: /nfs/tux/huchchen/localbuild/SALT3064rp/LC/bld/bin/tmwsdlflt obauthapp.tw1 "obauthapp.tws"
Breakpoint 1, main () at wsdlflt.cpp:44
44 if (argC != 3)
(gdb) next
50 gInFile = argV[1];
(gdb) print argc
No symbol "argc" in current context.
(gdb) print gInFile
No symbol "gInFile" in current context.
(gdb) n
51 gOutFile = argV[2];
(gdb) print gInFile
No symbol "gInFile" in current context.
(gdb) list
46 usage();
47 return 1;
48 }
49 // See if non validating dom parser configuration is requested.
50 gInFile = argV[1];
51 gOutFile = argV[2];
52 if ( !gInFile || !*gInFile || !gOutFile || !*gOutFile )
53 {
54 usage();
55 return 2;
(gdb) q
死活打印不出任何值,大家知道什么吗?
lciahp2% /opt/langtools/bin/gdb tmwsdlflt
HP gdb 5.2 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.2 (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) break main
Breakpoint 1 at 0x400000000000f660:0: file wsdlflt.cpp, line 44 from /nfs/tux/huchchen/localbuild/SALT3064rp/LC/bld/bin/tmwsdlflt.
(gdb) run obauthapp.tw1 "obauthapp.tws"
Starting program: /nfs/tux/huchchen/localbuild/SALT3064rp/LC/bld/bin/tmwsdlflt obauthapp.tw1 "obauthapp.tws"
Breakpoint 1, main () at wsdlflt.cpp:44
44 if (argC != 3)
(gdb) next
50 gInFile = argV[1];
(gdb) print argc
No symbol "argc" in current context.
(gdb) print gInFile
No symbol "gInFile" in current context.
(gdb) n
51 gOutFile = argV[2];
(gdb) print gInFile
No symbol "gInFile" in current context.
(gdb) list
46 usage();
47 return 1;
48 }
49 // See if non validating dom parser configuration is requested.
50 gInFile = argV[1];
51 gOutFile = argV[2];
52 if ( !gInFile || !*gInFile || !gOutFile || !*gOutFile )
53 {
54 usage();
55 return 2;
(gdb) q
死活打印不出任何值,大家知道什么吗?
|
没有加-g ?
|
肯定加了,问题是你加了-g同时还加了优化-O