This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix inherit.exp tests
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Andrew Stubbs <ams at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 06 Oct 2015 15:43:12 +0100
- Subject: Re: [PATCH] Fix inherit.exp tests
- Authentication-results: sourceware.org; auth=none
- References: <560E4718 dot 80707 at codesourcery dot com>
Andrew Stubbs <ams@codesourcery.com> writes:
Hi Andrew,
> 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.
I think there are some fails in gdb.cp/virtbase.exp of this kind. Did
you see them on mips? They fail on aarch64 (and nios2 IIRC).
>
> 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
I think you are right. IIUC, negative index is used to identify the
vptr, but I am not very sure, still need some time to understand c++ stuff.
> 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.
I probably need several days to investigate VTT, vptr table and etc.
Ping us if you don't get response from me in one week.
--
Yao (éå)