gdb doesn't find symbols

Discussion in 'C++' started by briseight@gmail.com, Aug 1, 2007.

  1. Guest

    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
    , Aug 1, 2007
    #1
    1. Advertising

  2. Ian Collins Guest

    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.
    Ian Collins, Aug 1, 2007
    #2
    1. Advertising

  3. 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
    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=, Aug 1, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hug
    Replies:
    6
    Views:
    13,910
  2. Surendra
    Replies:
    0
    Views:
    499
    Surendra
    Mar 23, 2006
  3. seba
    Replies:
    1
    Views:
    1,430
    mlimber
    Mar 22, 2007
  4. Timothy Madden
    Replies:
    1
    Views:
    1,603
    Timothy Madden
    Sep 17, 2009
  5. Emanuel Berg
    Replies:
    2
    Views:
    608
    Emanuel Berg
    Aug 30, 2013
Loading...

Share This Page