This is the mail archive of the gdb-patches@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]

Re: [4/5] implement "info vtable"


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."


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