c++/2152: set print object on does not work

cbarbe@obj-sys.com cbarbe@obj-sys.com
Fri Aug 4 14:28:00 GMT 2006


>Number:         2152
>Category:       c++
>Synopsis:       set print object on does not work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 04 14:28:01 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     cbarbe@obj-sys.com
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
"set print object on" does not work. See below gdb session running the attached test case. 

$ gcc --version
gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

$ gdb UpCastPb
GNU gdb 6.4-debian
...
This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".

(gdb) b UpCastPb.cpp:21
Breakpoint 1 at 0x80484b7: file ../UpCastPb.cpp, line 21.
(gdb) r
Starting program: /home/christophe/workspace/UpCastPb/Debug/UpCastPb

Breakpoint 1, main () at ../UpCastPb.cpp:21
21         delete obj1;
(gdb) p obj1
$1 = (A *) 0x804a008
(gdb) p *obj1
$2 = {a1 = 11, a2 = 22}
(gdb) set print object on
(gdb) show print object
Printing of object's derived type based on vtable info is on.
(gdb) p obj1
$3 = (A *) 0x804a008
(gdb) p *obj1
$4 = {a1 = 11, a2 = 22}
(gdb) p *(B *)obj1
$5 = {<A> = {a1 = 11, a2 = 22}, b = 33}
>How-To-Repeat:

>Fix:

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

CmNsYXNzIEEgewogICBwdWJsaWM6CiAgICAgIGludCBhMTsKICAgICAgQSgpIDogYTEoMTEpLCBh
MigyMikge307CiAgIHByb3RlY3RlZDoKICAgICAgaW50IGEyOwp9OwoKY2xhc3MgQiA6IHB1Ymxp
YyBBIHsKICAgcHVibGljOgogICAgICBCKCkgOiBBKCksIGIoMzMpIHt9OwogICBwcm90ZWN0ZWQ6
CiAgICAgIGludCBiOwp9OwoKaW50IG1haW4oKQp7CiAgIEEqIG9iajEgPSBuZXcgQigpOwogICBC
KiBvYmoyID0gbmV3IEIoKTsKICAgZGVsZXRlIG9iajE7CiAgIGRlbGV0ZSBvYmoyOwogICByZXR1
cm4gMDsKfQo=



More information about the Gdb-prs mailing list