[PATCH] Fix inherit.exp tests

Andrew Stubbs ams@codesourcery.com
Fri Oct 2 08:58:00 GMT 2015


Some of the tests in inherit.exp make invalid assumptions about vtable 
pointers in printed values.

I find that these tests pass on most targets, but fail on a few targets, 
including mips-sde.

The reason is that the "_vptr" entries in C++ types do not point to the 
head of the vtable, but point to the address following the last entry in 
the table, which mean that when GDB prints the symbol associated with 
the address, it actually prints the name of the value that follows the 
table in memory.

Historically, it appears to have been fairly predictable what symbol 
would follow the vtable, and remains so on most targets, but this is no 
longer true in general (or perhaps never was). In mips-sde, in 
particular, the "VTT for *" symbols are placed in a completely different 
section, so cannot follow the vtable. The alignment and padding appears 
to have varied slightly, and the order of vtable and typeinfo sections 
appears to have varied also (or maybe the test was never right?)

The attached patch adds new expect patterns that don't require any 
specific symbol at all, since they're basically meaningless.

OK to commit?

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdb-inherit.patch
Type: text/x-patch
Size: 2230 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20151002/18340170/attachment.bin>


More information about the Gdb-patches mailing list