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]

gdb/347: class element access



>Number:         347
>Category:       gdb
>Synopsis:       class element access
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 10 15:58:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     grabner@icg.tu-graz.ac.at
>Release:        GDB-5.1
>Organization:
>Environment:
SuSE Linux 7.3 (Kernel 2.4.10)
>Description:
Under certain conditions GDB can't access elements of a class (e.g. "this->value"). Instead the error message "Cannot access memory at address ..." is generated, which makes GDB almost completely useless for such programs. This bug has been introduced with GDB-5.0, GDB-4.18 doesn't show this errorneous behaviour.
>How-To-Repeat:
1.) save the attached program as "test.cpp" and compile it with "g++ -g test.cpp -o test"
2.) start gdb as "gdb test" and step into the constructor cls3::cls3()
3.) type "print x" to demonstrate the bug
4.) step out of the constructor and type "print obj3" to see that the code has been compiled correctly

(see also comments in attached file)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="bug1.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug1.cpp"

I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCi8qCiAgMS4pIHNhdmUgdGhp
cyBwcm9ncmFtIGFzICJ0ZXN0LmNwcCIgYW5kIGNvbXBpbGUgaXQgd2l0aCAiZysrIC1nIHRlc3Qu
Y3BwIC1vIHRlc3QiCiAgMi4pIHN0YXJ0IGdkYiBhcyAiZ2RiIHRlc3QiIGFuZCBzdGVwIGludG8g
dGhlIGNvbnN0cnVjdG9yIGNsczM6OmNsczMoKQogIDMuKSB0eXBlICJwcmludCB4IiB0byBkZW1v
bnN0cmF0ZSB0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