From: Yao Qi <qiyaoltc@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [testsuite patch] [ppc64] +kfail: gdb_target_symbol does not support function descriptors
Date: Wed, 06 Jul 2016 07:51:00 -0000 [thread overview]
Message-ID: <CAH=s-PMKOAYhx+62K_YmBPqcqOm0ex6ijftrWhsf1nJNM7wY6w@mail.gmail.com> (raw)
In-Reply-To: <20160705145454.GA26978@host1.jankratochvil.net>
On Tue, Jul 5, 2016 at 3:54 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> Hi,
>
> Marin Cermak has found various testcases (or one of them) of GDB FAIL on
> ppc64.
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=20328
> # powerpc64-unknown-linux-gnu:
> # FAIL: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype f
> # FAIL: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype g
> # FAIL: gdb.dwarf2/dw2-lexical-block-bare.exp: p testvar
> # FAIL: gdb.dwarf2/atomic-type.exp: ptype f
> #
> # but:
> # powerpc64le-unknown-linux-gnu does PASS them (ppc64le does not use function
> # descriptors anymore)
>
> I do not see how to really fix it, DWARF needs to contain PC addresses, not
> function descriptor addresses. But .o contains only the function descriptor
> address.
In ppc64 ELFv1 abi, symbol "f" is the address of function descriptor,
symbol ".f"
is the address of function entry. If we hack
gdb.dwarf2/dw2-bad-mips-linkage-name.exp like this, "f" -> ".f", and
"g" -> ".g",
DW_TAG_subprogram {
{name f}
{low_pc [gdb_target_symbol .f] addr}
{high_pc f_end_lbl addr}
{type :$b_l}
{DW_AT_MIPS_linkage_name _Z1fv}
}
DW_TAG_subprogram {
{name g}
{low_pc [gdb_target_symbol .g] addr}
{high_pc g_end_lbl addr}
{type :$b_l}
{DW_AT_MIPS_linkage_name 42 DW_FORM_data1}
}
the tests pass. The right fix would be teaching proc gdb_target_symbol to add
prefix "." to symbol if target is powerpc64 and abi is ELFv1, in which function
descriptor is used.
--
Yao (齐尧)
next prev parent reply other threads:[~2016-07-06 7:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-05 14:55 Jan Kratochvil
2016-07-06 7:51 ` Yao Qi [this message]
2016-07-06 8:11 ` Jan Kratochvil
2016-07-06 19:35 ` [testsuite patchv2] [ppc64] gdb_target_symbol fix for function descriptors [Re: [testsuite patch] [ppc64] +kfail: gdb_target_symbol does not support function descriptors] Jan Kratochvil
2016-07-12 12:56 ` Yao Qi
2016-07-12 13:22 ` [testsuite patchv2] [ppc64] gdb_target_symbol fix for function descriptors [Re: [testsuite patch] [ppc64] +kfail: gdb_target Ulrich Weigand
2016-07-13 8:54 ` [testsuite patchv3] " Jan Kratochvil
2016-07-13 11:52 ` Ulrich Weigand
2016-07-13 12:02 ` [commit] " Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH=s-PMKOAYhx+62K_YmBPqcqOm0ex6ijftrWhsf1nJNM7wY6w@mail.gmail.com' \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox