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

Tom Tromey
2012-07-19T17:01:22Z

Andreas> [0]: @0x10014278: 0x10001b0c <A::f()>

Please try the appended.

Tom

b/gdb/testsuite/ChangeLog:
2012-07-19 Tom Tromey <tromey@redhat.com>

* gdb.cp/virtfunc.exp (make_one_vtable_result): Handle function
descriptor.
(test_info_vtbl): Remove unused globals.

diff --git a/gdb/testsuite/gdb.cp/virtfunc.exp b/gdb/testsuite/gdb.cp/virtfunc.exp
index 4621a74..bef71c8 100644
--- a/gdb/testsuite/gdb.cp/virtfunc.exp
+++ b/gdb/testsuite/gdb.cp/virtfunc.exp
@@ -235,7 +235,9 @@ proc make_one_vtable_result {name args} {
set result "vtable for '${name}' @ $hex .subobject @ $hex.:$nls"
set count 0
foreach func $args {
- append result ".${count}.: $hex <$func..>${nls}"
+ # The (@$hex: ) part is because we might see a descriptor
+ # instead.
+ append result ".${count}.: (@$hex: )?$hex <$func..>${nls}"
incr count
}

@@ -245,10 +247,6 @@ proc make_one_vtable_result {name args} {
# Test "info vtbl".

proc test_info_vtbl {} {
- global hex
-
- set nls "\[\r\n\]+"
-
set vt_A [make_one_vtable_result A A::f]
set vt_B [make_one_vtable_result B B::f]
set vt_V [make_one_vtable_result V VB::vvb V::vv]