Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* about PR gdb/10002 (extern optimized out symbols print: Address of  symbol is unknown)
@ 2009-03-25 22:26 Joel Brobecker
  2009-03-25 23:00 ` Paul Pluzhnikov
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2009-03-25 22:26 UTC (permalink / raw)
  To: gdb

Here is the testcase that Jan provided:

    extern int missing;
    
    int
    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) 6.8.50.20090324-cvs
    (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?

-- 
Joel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-26 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-25 22:26 about PR gdb/10002 (extern optimized out symbols print: Address of symbol is unknown) Joel Brobecker
2009-03-25 23:00 ` Paul Pluzhnikov
2009-03-26 14:15   ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox