gdb doesn't find symbols

B

briseight

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
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top