This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [4/5] implement "info vtable"
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Thu, 19 Jul 2012 11:33:57 +0200
- Subject: Re: [4/5] implement "info vtable"
- References: <87mx82prmd.fsf@fleche.redhat.com> <4F4F8D39.60507@redhat.com> <874ntpdg5s.fsf@fleche.redhat.com>
Tom Tromey <tromey@redhat.com> writes:
> +# A helper proc that creates a regular expression matching a
> +# particular vtable. NAME is the type name. Each element of ARGS is
> +# the name of a function in the vtable.
> +
> +proc make_one_vtable_result {name args} {
> + global hex
> +
> + set nls "\[\r\n\]+"
> +
> + set result "vtable for '${name}' @ $hex .subobject @ $hex.:$nls"
> + set count 0
> + foreach func $args {
> + append result ".${count}.: $hex <$func..>${nls}"
> + incr count
> + }
> +
> + return $result
> +}
info vtbl a
vtable for 'A' @ 0x10013c28 (subobject @ 0x10014510):
[0]: @0x10014278: 0x10001b0c <A::f()>
vtable for 'V' @ 0x10013c50 (subobject @ 0x10014520):
[0]: @0x100143c8: 0x10001e14 <VB::vvb()>
[1]: @0x10014338: 0x10001c94 <V::vv()>
(gdb) FAIL: gdb.cp/virtfunc.exp: info vtbl a
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."