public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/45088]  New: pointer type information lost in debuginfo
@ 2010-07-26 19:25 tromey at gcc dot gnu dot org
  2010-07-27  8:29 ` [Bug debug/45088] " jakub at gcc dot gnu dot org
  0 siblings, 1 reply; 11+ messages in thread
From: tromey at gcc dot gnu dot org @ 2010-07-26 19:25 UTC (permalink / raw)
  To: gcc-bugs

I'm using r162345 on x86 Fedora 13.

This test case comes from the gdb test suite.

struct A
{
  virtual ~A ();
  int a1;
};

A::~A()
{
  a1 = 800;
}

struct B : public A
{
  virtual ~B ();
  int b1;
  int b2;
};

B::~B()
{
  a1 = 900;
  b1 = 901;
  b2 = 902;
}

struct C : public B
{
  A *c1;
  A *c2;
};

// Stop the compiler from optimizing away data.
void refer (A *)
{
  ;
}

struct empty {};

// Stop the compiler from optimizing away data.
void refer (empty *)
{
  ;
}

int main (void)
{
  A alpha, *aap, *abp, *acp;
  B beta, *bbp;
  C gamma;
  empty e;

  alpha.a1 = 100;
  beta.a1 = 200; beta.b1 = 201; beta.b2 = 202;
  gamma.c1 = 0; gamma.c2 = (A *) ~0UL;

  aap = α refer (aap);
  abp = β  refer (abp);
  bbp = β  refer (bbp);
  acp = γ refer (acp);
  refer (&e);

  return 0;  // marker return 0
} // marker close brace


When I compile this I see that the type of the "c1" field is bad:

 <2><48>: Abbrev Number: 5 (DW_TAG_member)
    <49>   DW_AT_name        : c1       
    <4c>   DW_AT_decl_file   : 1        
    <4d>   DW_AT_decl_line   : 46       
    <4e>   DW_AT_type        : <0x116>  
    <52>   DW_AT_data_member_location: 2 byte block: 23 10     
(DW_OP_plus_uconst: 16)
[...]
 <1><116>: Abbrev Number: 11 (DW_TAG_pointer_type)
    <117>   DW_AT_byte_size   : 4       

That is, gcc claims that this field is a "void *", which is not the case.


-- 
           Summary: pointer type information lost in debuginfo
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tromey at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45088


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

end of thread, other threads:[~2012-04-19 19:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45088-4@http.gcc.gnu.org/bugzilla/>
2010-09-27 18:21 ` [Bug debug/45088] pointer type information lost in debuginfo uweigand at gcc dot gnu.org
2010-09-27 18:34 ` uweigand at gcc dot gnu.org
2010-09-27 18:34 ` redi at gcc dot gnu.org
2010-11-11 15:37 ` dodji at gcc dot gnu.org
2010-11-11 15:43 ` dodji at gcc dot gnu.org
2010-11-12 12:19 ` dodji at gcc dot gnu.org
2010-12-17 10:39 ` dodji at gcc dot gnu.org
2011-03-15 10:21 ` dodji at gcc dot gnu.org
2012-04-19  8:11 ` pluto at agmk dot net
2012-04-19 19:09 ` jason at gcc dot gnu.org
2010-07-26 19:25 [Bug debug/45088] New: " tromey at gcc dot gnu dot org
2010-07-27  8:29 ` [Bug debug/45088] " jakub at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).