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

Re: c++/1210: Printing fails/aborts for some attributes (Cannot accessmemory at address)


The following reply was made to PR c++/1210; it has been noted by GNATS.

From: Milan Schulte <Milan.Schulte@OFFIS.de>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-gnats@sources.redhat.com
Subject: Re: c++/1210: Printing fails/aborts for some attributes (Cannot access
 memory at address)
Date: Tue, 20 May 2003 18:35:30 +0200

 Dear Daniel,
 
 Daniel Jacobowitz wrote:
 > On Mon, May 19, 2003 at 06:36:33PM +0200, Milan Schulte wrote:
 > 
 >>>>>Number:         1210
 >>>>>Category:       c++
 >>>>>Synopsis:       Printing fails/aborts for some attributes (Cannot access 
 >>>>>memory at address)
 >>>>>Confidential:   no
 >>>>>Severity:       serious
 >>>>>Priority:       medium
 >>>>>Responsible:    unassigned
 >>>>>State:          open
 >>>>>Class:          sw-bug
 >>>>>Submitter-Id:   net
 >>>>>Arrival-Date:   Wed May 14 14:18:00 UTC 2003
 >>>>>Closed-Date:
 >>>>>Last-Modified:
 >>>>>Originator:     milan.schulte@offis.de
 >>>>>Release:        unknown-1.0
 >>>>>Organization:
 >>>>>Environment:
 >>>>
 >>>
 >>> - Provide a small test case for the problem
 >>
 >>Here is a tiny test case:
 >>(Took me 2 hours to reduce my code to get this, but we really depend on a 
 >>solution
 >>to allow shifting to GCC 3.x.)
 >>
 >>----------------------------- tst.cc -----
 >>class A
 >>{
 >>};
 >>
 >>class B : virtual public A
 >>{
 >>};
 >>
 >>class C : public A
 >>{
 >>    protected:
 >>        B myB;
 >>};
 >>
 >>int main()
 >>{
 >>    C *obj = new C();
 >>    return 0;
 >>}
 >>------------------------------------------
 >>
 >>Compiled with:
 >> g++ -g tst.cc
 >>
 >>Call to GDB:
 >> gdb a.out
 >>
 >>GDB commands:
 >>(gdb)  break tst.cc:18
 >>(gdb)  run
 >>(gdb)  print *obj
 >>$8 = {
 >>  <A> = {<No data fields>},
 >>  members of C:
 >>  myB = {Cannot access memory at address 0xfffffff4
 >>(gdb)
 >>
 >>
 >>Thanks in advance,
 > 
 > 
 > Thank you very much for the testcase - it's the best we could ever have
 > asked for.
 > 
 > Your testcase showed two problems in GDB's value infrastructure
 > relating to the way we handle nested objects.  Fixing them revealed
 > two other related inconsistencies.
 > 
 > I think that with these three fixes, your problem will go away.  Could
 > you try this patch?  It's against current GDB CVS.  It should apply to
 > earlier versions also, but earlier versions also have other problems in
 > this area.
 > 
 
 The patch works. The problem is solved for both snapshot 20030516 and
 release version 5.3.  Printing (and displaying in DDD) now works for
 the tiny test case (shown above) as for our software (from which we
 extracted the example).
 
 Thank you very much!
 
 Milan
 


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