This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Scope of typedefs



The code in dwarf2read and the other readers assigns all typedef symbols
to the static symbol list (file scope).  This is not, strictly speaking, 
correct, is it?  For example, in the (admittedly unusual) program

    static int Foo;

    int f (int y) {
      typedef int Foo;
      Foo x;
      x = 3;
      return x;
    }

    main () {
      f (Foo);   /* <<< */
    }

an attempt to print Foo in GDB when stopped at the commented line gives us
an

    Attempt to use a type name as an expression

message.  I understand that GCC would have to be modified to put typedefs
in proper scope, but is there any particular objection to having GDB be ready 
if it happens?  For that matter, does anyone know why things are as they are?

P. Hilfinger


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]