Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > gdb doesn't find symbols

Reply
Thread Tools

gdb doesn't find symbols

 
 
briseight@gmail.com
Guest
Posts: n/a
 
      08-01-2007
I'm trying to debug with gdb but I can read only some symbol.

This is my main:

/* Called from the main */
int main(int argc, char **argv)
{
int flags;

/* register all codecs, demux and protocols */
av_register_all();

parse_options(argc, argv, options);

if (!input_filename)
show_help();

if (display_disable) {
video_disable = 1;
}
.......



I set a breakpoint to parse_option. When I try to print flags I get:

(gdb) print flags
No symbol "flags" in current context.

I compiled with -g option and I didn't strip symbols:

gcc -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-
switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-
pointer-sign -O3
-I"/home/nicola/devel/FFplay/trunk" -I"/home/nicola/devel/FFplay/
trunk" -I"/home/nicola/devel/FFplay/trunk"/libavutil -I"/home/nicola/
devel/FFplay/trunk"/
libavcodec -I"/home/nicola/devel/FFplay/trunk"/libavformat -I"/home/
nicola/devel/FFplay/trunk"/libswscale -D_FILE_OFFSET_BITS=64 -
D_LARGEFILE_SOURCE -D_ISO
C9X_SOURCE -DHAVE_AV_CONFIG_H -I/usr/include/SDL -D_GNU_SOURCE=1 -
D_REENTRANT -c -o ffplay.o ffplay.c


file ffplay:
ffplay: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped

 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      08-01-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I'm trying to debug with gdb but I can read only some symbol.
>

Try a gcc/gdb forum, you'll have more luck there.

--
Ian Collins.
 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?Erik_Wikstr=F6m?=
Guest
Posts: n/a
 
      08-01-2007
On 2007-08-01 10:32, (E-Mail Removed) wrote:
> I'm trying to debug with gdb but I can read only some symbol.
>
> This is my main:
>
> /* Called from the main */
> int main(int argc, char **argv)
> {
> int flags;
>
> /* register all codecs, demux and protocols */
> av_register_all();
>
> parse_options(argc, argv, options);
>
> if (!input_filename)
> show_help();
>
> if (display_disable) {
> video_disable = 1;
> }
> ......
>
>
>
> I set a breakpoint to parse_option. When I try to print flags I get:
>
> (gdb) print flags
> No symbol "flags" in current context.
>
> I compiled with -g option and I didn't strip symbols:
>
> gcc -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-
> switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-
> pointer-sign -O3


These kinds of questions are off-topic here, use gnu.gcc.help in the
future. By the way, debugging and optimisations don't play nicely
together in my experience (flags could be completely optimised away) so
skip the -O3 when building for debugging purposes.

--
Erik Wikström
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debugging with gdb: pystack macro for gdb to show python stack trace Timothy Madden Python 1 09-17-2009 11:47 AM
GDB - no debugging symbols found (GDB Vs GCC?) seba C++ 1 03-22-2007 02:02 PM
Capturing gdb output in pyhton script using gdb -batch -x arguments Surendra Python 0 03-23-2006 02:47 PM
GDB .... no debugging symbols found Hug C++ 6 03-17-2005 03:38 PM
find all unreferenced symbols, not by linker Tzu-Chien Chiu C++ 1 09-15-2003 05:30 PM



Advertisments