This is the mail archive of the gdb-prs@sourceware.org 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]

[Bug exp/11863] Print return object inside function operates onwrong memory


http://sourceware.org/bugzilla/show_bug.cgi?id=11863

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2012-02-06
                 CC|                            |tromey at redhat dot com
     Ever Confirmed|0                           |1

--- Comment #1 from Tom Tromey <tromey at redhat dot com> 2012-02-06 16:20:17 UTC ---
This works for me:

Breakpoint 2, testObj () at pr.cc:20
20            std::cout << &obj << std::endl;
(gdb) n
0x7fffffffe450
21            std::cout << &obj2 << std::endl;
(gdb) n
0x7fffffffe440
22            return obj;
(gdb) p &obj
$3 = (testClass *) 0x7fffffffe450
(gdb) p &obj2
$4 = (testClass *) 0x7fffffffe440


I think this was actually a GCC bug, already reported both in gdb
and gcc bugzilla, but I couldn't quickly find the gcc PR.

If you can try a newer GCC (I'm using the Fedora 15 GCC, which is
based on 4.6), please do.
Otherwise, let me know and I will close this.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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