This is the mail archive of the 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]
Other format: [Raw text]

about PR gdb/10002 (extern optimized out symbols print: Address of symbol is unknown)

Here is the testcase that Jan provided:

    extern int missing;
    main (void)
      return 0 && missing;

This file is to be built using the following command:

    % gcc -o kfail kfail.c -Wall -g

The debugger currently says that variable "missing" is unknown:

    % gdb kfail
    GNU gdb (GDB)
    (gdb) p missing
    Address of symbol "missing" is unknown.

The debugging information inside kfail.c says:

 <1><55>: Abbrev Number: 4 (DW_TAG_variable)
    <56>   DW_AT_name        : (indirect string, offset: 0x66): missing 
    <5c>   DW_AT_type        : <0x4e>   
    <60>   DW_AT_external    : 1        
    <61>   DW_AT_declaration : 1        

This seems correct to me.  However, the testcase itself is a little
borderline in my opinion. The variable was not "optimized out", but
was never linked in. It's as if it really does not exist.

So I don't know if GDB is really all that incorrect, here. Thoughts?
Maybe there is a testcase a little more involved that shows the same
sort of issue?


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