On 2007-08-01 10:32,
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