From: Aleksandar Ristovski <aristovski@qnx.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [patch] use .gnu.attributes to detect e500 machine type
Date: Tue, 14 Apr 2009 19:48:00 -0000 [thread overview]
Message-ID: <gs2p8n$g7s$1@ger.gmane.org> (raw)
In-Reply-To: <gridf7$uu0$1@ger.gmane.org>
any thoughts?
Aleksandar Ristovski wrote:
> Hello,
>
>
> The patch introduces determining e500 cpu from .gnu.attributes; if gnu
> attributes section is not present, fall-back to the old way of checking
> the presence of .PPC.EMB.apuinfo section.
>
> It also introduces a function for "show powerpc vector-abi" to print
> both ABI being used and if different, global setting (output can be seen
> below). This could be a separate patch - let me know if you want it
> separately.
>
> Background of the patch:
>
> Currently, gdb relies on presence .PPC.EMB.apuinfo section. This is not
> completely correct since apuinfo section can contain information about
> any APU instructions present, and not only SPE. So we could have a
> binary with .PPC.EMB.apuinfo section and without SPE APU. Further,
> .PPC.EMB.apuinfo may not be present at all even if -me500 is specified.
> This is due to gas emitting this section only if it encounters SPE APU
> instructions in the assembly.
>
> .gnu.attributes section records user setting, whether there were SPE
> instructions generated or not. We use gnu object attributes in rs6000
> already (for determining vector-abi and float-point abi).
>
> The only problem with .gnu.attribute is that if binary is compiled with
> pre-4.3 gcc, .gnu.attributes section does not get generated at all.
> (.gnu_attribute was added in 4.3). This is why we fall-back to
> .PPC.EMB.apuinfo presence.
>
> Results of the patch:
>
> After starting gdb, no executable:
> (gdb) show powerpc vector-abi
> The vector ABI in use is "generic". Default setting is "auto".
> (gdb) file /mnt/win/ppcspetest_g
> Reading symbols from /mnt/win/ppcspetest_g...done.
> (gdb) show powerpc vector-abi
> The vector ABI in use is "spe". Default setting is "auto".
>
> ** If user overrides selected vector-abi, this is the display:
> (gdb) set powerpc vector-abi generic
> (gdb) show powerpc vector-abi
> The vector ABI is "generic"
>
>
> "show powerpc vector-abi" will now display both selected vector-abi and
> user setting ("Default setting is ..."). Only if the two concide, it
> will only say "Target vector ABI is ...").
>
>
> Thanks,
>
> Aleksandar Ristovski
> QNX Software Systems
>
>
> ChangeLog
> * rs6000-tdep.c (rs6000_gdbarch_init): Use .gnu.attributes to see
> if this is a e500 binary (with SPE APU).
> (powerpc_show_vector_abi): New function.
> (_initialize_rs6000_tdep): Use powerpc_show_vector_abi.
>
>
next prev parent reply other threads:[~2009-04-14 19:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-08 14:48 Aleksandar Ristovski
2009-04-14 19:48 ` Aleksandar Ristovski [this message]
2009-04-28 21:31 ` Joel Brobecker
2009-05-22 19:21 ` Aleksandar Ristovski
2009-07-06 16:34 ` Aleksandar Ristovski
2009-07-06 17:48 ` Daniel Jacobowitz
2009-07-06 21:26 ` Aleksandar Ristovski
2009-07-21 15:41 ` Aleksandar Ristovski
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='gs2p8n$g7s$1@ger.gmane.org' \
--to=aristovski@qnx.com \
--cc=gdb-patches@sources.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