This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] use .gnu.attributes to detect e500 machine type


Hello Aleksandar,

I wish someone more familiar with the PPC architecture had some time
to review your patch.  In the meantime, I'll trust your knowledge of
the PPC; but it's nice to see that the current code seems to confirm
what you said :)

> 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.

I think it would make sense to separate this part, especially since
I don't understand what you're trying to do, yet. Perhaps we'll need
to start doing something like what we do for "set/show lang ...",
but we can discuss this relatively minor part separately.

> * 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.

If you look at today's version of rs6000_gdbarch_init, you'll find
that we're already checking the Tag_GNU_Power_ABI_Vector, and setting
the tdep->vector_abi accordingly. It's actually conditionalized on
HAVE_ELF, so we need at least to make sure that your testing of
the .gnu.attributes sections gets conditionalized on HAVE_ELF as well.

However, I am wondering if it wouldn't be better to simply take
advantage of the code that's already there. For that, you'll need
to move the code up a bit, so that vector_abi gets set earlier.
You can then use the resulting information to determine whether or
not to fallback on the current approach of using .PPC.EMB.apuinfo.

What do you think?

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]