This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: c++/1210: Printing fails/aborts for some attributes (Cannot accessmemory at address)
- From: Milan Schulte <Milan dot Schulte at OFFIS dot de>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 19 May 2003 16:38:01 -0000
- Subject: Re: c++/1210: Printing fails/aborts for some attributes (Cannot accessmemory at address)
- Reply-to: Milan Schulte <Milan dot Schulte at OFFIS dot de>
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: Mon, 19 May 2003 18:36:33 +0200
Dear Daniel Jacobowitz,
> On Wed, May 14, 2003 at 02:12:44PM -0000, milan.schulte@offis.de 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:
>>
>>>Description:
>>
>>Using GDB 5.3 from console of DDD 3.3.1 to print the content of an object aborts at some attribute:
>>
>>(gdb) print (*this)
>>$15 = (ControlEndCon [incomplete object]) {
>> <ControlNode> = {
>> <GraphNode> = {
>> <Node> = {
>> <Element> = {
>> <Base> = {
>> _vptr.Base = 0x85c5038
>> }, <No data fields>},
>> members of Node:
>> myLocalSet = {Cannot access memory at address 0xfffffff4
>>(gdb)
>>
>>The attribute myLocalSet is *not* a pointer. Printing the attribute with the following command works:
>>
>>(gdb) print (*this).myLocalSet
>>$17 = (StorageUnitSet) {
>> <Element> = {
>> <Base> = {
>> _vptr.Base = 0x859b9d0
>> }, <No data fields>},
>> <ComparableList<StorageUnit*>> = {
>> <List<StorageUnit*>> = {
>> <BasicType> = {
>> _vptr.BasicType = 0x859b9d0
>> },
>> members of List<StorageUnit*>:
>> mySize = 0,
>> myIteratorCount = 0,
>> myHead = 0x0,
>> myTail = 0x0
>> }, <No data fields>}, <No data fields>}
>>(gdb)
>>
>>I'm using g++ (GCC) 3.3 and binutils 2.13.90.0.18 (i486-suse-linux) using BFD version 2.13.90.0.18
>>
>>The above works with the same source code using GCC 2.95.2, binutils 2.9.5, GDB 5.1.1, DDD 3.3.1.
>>
>>Any hints appreciated!
>
>
> Could you please:
> - Try a CVS snapshot of GDB
Snapshot 20030516 didn't work, same error.
[Remark: GCC was "gcc version 3.3 20030226 (prerelease) (SuSE Linux)".
But we have had the same problem with previous versions of GCC 3.x
(all of them build from GCC source distribution, as opposed to the
GCC 3.3 version currently used from a SuSE distribution).]
> and/or
> - 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,
Milan