Michael Elizabeth Chastain writes: Blingo. gnuv3_rtti_type isn't quite right in some way. > Yeah, here's a typescript of the whole megillah. > > MichaelC > > === > > Script started on Thu Jun 28 22:44:46 2001 > [chastain@snapon tmp]$ echo $PATH > /horton/chastain/fsf/2001-06-23/snapon/native/install/bin:/bin:/usr/bin > [chastain@snapon tmp]$ cat x1.cc > class A > { > public: > A(); > virtual ~A(); > static int i; >}; > > A::A() > { > ; >} > > A::~A() > { > ; >} > > int A::i = 1; > > class B : public A > { > public: > B(); > virtual ~B(); > static int j; > static int k; >}; > > B::B() > { > ; >} > > B::~B() > { > ; >} > > int B::j = 2; > int B::k = 3; > > int main () > { > B * pB = new B; > delete pB; >} > [chastain@snapon tmp]$ g++ -v > Reading specs from /horton/chastain/fsf/2001-06-23/snapon/native/install/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/specs > Configured with: /horton/chastain/fsf/2001-06-23/source/configure --prefix=/horton/chastain/fsf/2001-06-23/snapon/native/install --disable-shared --enable-languages=c,c++,f77 --with-gnu-as --with-as=/horton/chastain/localdisk/snapon/baseline/binutils-2.11.2/native/install/bin/as --with-gnu-ld --with-ld=/horton/chastain/localdisk/snapon/baseline/binutils-2.11.2/native/install/bin/ld --enable-gdbmi > Thread model: single > gcc version 3.0.1 20010623 (prerelease) > [chastain@snapon tmp]$ g++ -g -o x1.exe x1.cc > [chastain@snapon tmp]$ gdb -v > GNU gdb 2001-06-24-cvs (MI_OUT) > Copyright 2001 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "i686-pc-linux-gnu". > [chastain@snapon tmp]$ gdb gdb > GNU gdb 2001-06-24-cvs (MI_OUT) > Copyright 2001 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "i686-pc-linux-gnu"... > (gdb) set prompt [top] > [top] set args x1.exe > [top] break error > Breakpoint 1 at 0x80d4556: file /horton/chastain/fsf/2001-06-23/source/gdb/utils.c, line 653. > [top] run > Starting program: /horton/chastain/fsf/2001-06-23/snapon/native/install/bin/gdb x1.exe > GNU gdb 2001-06-24-cvs (MI_OUT) > Copyright 2001 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "i686-pc-linux-gnu"... > (gdb) break main > Breakpoint 1 at 0x80488b6: file x1.cc, line 45. > (gdb) run > Starting program: /home/chastain/tmp/x1.exe > > Breakpoint 1, main () at x1.cc:45 > 45 B * pB = new B; > (gdb) next > 46 delete pB; > (gdb) ptype pB > type = class B : public A { > public: > static int j; > static int k; > > B & operator=(B const&); > B(B const&); > B(B const&); > B(); > B(); > ~B(); > virtual ~B(); > virtual ~B(); >} * > (gdb) print pB > $1 = (B *) 0x8050538 > (gdb) print *pB > > Breakpoint 1, error (string=0x819d620 "Value can't be converted to integer.") > at /horton/chastain/fsf/2001-06-23/source/gdb/utils.c:653 > 653 va_start (args, string); > [top] bt > #0 error (string=0x819d620 "Value can't be converted to integer.") > at /horton/chastain/fsf/2001-06-23/source/gdb/utils.c:653 > #1 0x0807445d in unpack_long () > at /horton/chastain/fsf/2001-06-23/source/gdb/values.c:661 > #2 0x0807428e in value_as_pointer (val=0x84e9968) > at /horton/chastain/fsf/2001-06-23/source/gdb/values.c:602 > #3 0x0812dd90 in gnuv3_rtti_type (value=0x84f3e38, full_p=0xbffff0d8, > top_p=0xbffff0dc, using_enc_p=0xbffff0e0) > at /horton/chastain/fsf/2001-06-23/source/gdb/gnu-v3-abi.c:211 > #4 0x080d7a71 in value_rtti_type (v=0x84f3e38, full=0xbffff0d8, > top=0xbffff0dc, using_enc=0xbffff0e0) > at /horton/chastain/fsf/2001-06-23/source/gdb/cp-abi.c:76 > #5 0x0807d649 in value_full_object (argp=0x84f3e38, rtype=0x0, xfull=0, > xtop=0, xusing_enc=0) > at /horton/chastain/fsf/2001-06-23/source/gdb/valops.c:3158 > #6 0x0807a9cd in value_ind (arg1=0x84960f8) > at /horton/chastain/fsf/2001-06-23/source/gdb/valops.c:1016 > #7 0x08078655 in evaluate_subexp_standard (expect_type=0x0, exp=0x84e9910, > pos=0xbffff3c4, noside=EVAL_NORMAL) > at /horton/chastain/fsf/2001-06-23/source/gdb/eval.c:1620 > #8 0x0807532b in evaluate_subexp (expect_type=0x0, exp=0x84e9910, > pos=0xbffff3c4, noside=EVAL_NORMAL) > at /horton/chastain/fsf/2001-06-23/source/gdb/eval.c:69 > ---Type to continue, or q to quit--- > #9 0x080754ee in evaluate_expression (exp=0x84e9910) > at /horton/chastain/fsf/2001-06-23/source/gdb/eval.c:158 > #10 0x08083132 in print_command_1 (exp=0x8220416 "*pB", inspect=0, voidprint=1) > at /horton/chastain/fsf/2001-06-23/source/gdb/printcmd.c:918 > #11 0x08083323 in print_command (exp=0x8220416 "*pB", from_tty=1) > at /horton/chastain/fsf/2001-06-23/source/gdb/printcmd.c:981 > #12 0x080d22d3 in execute_command (p=0x8220418 "B", from_tty=1) > at /horton/chastain/fsf/2001-06-23/source/gdb/top.c:789 > #13 0x0809d97d in command_handler (command=0x8220410 "print *pB") > at /horton/chastain/fsf/2001-06-23/source/gdb/event-top.c:513 > #14 0x0809de43 in command_line_handler (rl=0x84a8c88 "(\013#\bðA\r\büóÿ¿\021") > at /horton/chastain/fsf/2001-06-23/source/gdb/event-top.c:809 > #15 0x08188a26 in rl_callback_read_char () > at /horton/chastain/fsf/2001-06-23/source/readline/callback.c:114 > #16 0x0809d86f in stdin_event_handler (error=0, client_data=0x0) > at /horton/chastain/fsf/2001-06-23/source/gdb/event-top.c:420 > #17 0x080eb8b7 in handle_file_event (event_file_desc=0) > at /horton/chastain/fsf/2001-06-23/source/gdb/event-loop.c:706 > #18 0x080eb34e in process_event () > at /horton/chastain/fsf/2001-06-23/source/gdb/event-loop.c:335 > #19 0x080eb39b in gdb_do_one_event (data=0x0) > at /horton/chastain/fsf/2001-06-23/source/gdb/event-loop.c:372 > #20 0x080d1e8a in catch_errors (func=0x80eb370 , args=0x0, > ---Type to continue, or q to quit--- > errstring=0x81c6800 "", mask=6) > at /horton/chastain/fsf/2001-06-23/source/gdb/top.c:472 > #21 0x080eb3d3 in start_event_loop () > at /horton/chastain/fsf/2001-06-23/source/gdb/event-loop.c:396 > #22 0x08070861 in captured_command_loop (data=0x0) > at /horton/chastain/fsf/2001-06-23/source/gdb/main.c:102 > #23 0x080d1e8a in catch_errors (func=0x8070850 , > args=0x0, errstring=0x819ba82 "", mask=6) > at /horton/chastain/fsf/2001-06-23/source/gdb/top.c:472 > #24 0x08071073 in captured_main (data=0xbffff970) > at /horton/chastain/fsf/2001-06-23/source/gdb/main.c:724 > #25 0x080d1e8a in catch_errors (func=0x80708a0 , > args=0xbffff970, errstring=0x819ba82 "", mask=6) > at /horton/chastain/fsf/2001-06-23/source/gdb/top.c:472 > #26 0x080712d7 in main (argc=2, argv=0xbffff9e4) > at /horton/chastain/fsf/2001-06-23/source/gdb/main.c:735 > #27 0x400a0b65 in __libc_start_main (main=0x80712b0
, argc=2, > ubp_av=0xbffff9e4, init=0x806fc68 <_init>, fini=0x819b950 <_fini>, > rtld_fini=0x4000df24 <_dl_fini>, stack_end=0xbffff9dc) > at ../sysdeps/generic/libc-start.c:111 > [top] cont > Continuing. > Value can't be converted to integer. > (gdb) cont > Continuing. > > Program exited normally. > (gdb) quit > > Program exited normally. > [top] quit > [chastain@snapon tmp]$ exit > exit > > Script done on Thu Jun 28 22:46:27 2001 -- "Factorials were someone's attempt to make math *look* exciting. "-Steven Wright