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: Fwd: Re: [patch] Add support for ARMv7M devices.


On 09/03/12 16:28, Pedro Alves wrote:
> On 03/09/2012 04:13 PM, Jonathan Larmour wrote:
>>
>> But you have made me think of one improvement: we should probably not call
>> register_remote_g_packet_guess() if tdesc_has_registers (tdesc) - because
>> if someone has directly supplied a target description, we should solely
>> use that, and avoid any guessing. 
> 
> 
> I think that's always true, irrespective of a g packet guess being
> installed.  See target_find_description: it's always "file > target xml > g-guesses",

Can you just clarify to me how, for example, a program using VFP registers
(such as for Cortex-M4) would use the correct 'g' packet size? The
registers correspond to the tdesc, and not to either of the guessed sizes.
I guess if I could understand that example, I'll be happy. You can do this
off list if you like, to save others from boredom.

Nevertheless, on the entirely plausible assumption I'm wrong and the patch
was roughly correct before, I'm attaching an updated version against
current CVS - I merged in my comments and use of {INT,FP}_REGISTER_SIZE to
make the code a bit more self-documenting.

2012-03-09  Jonathan Larmour  <jifl@eCosCentric.com>
            Pedro Alves  <pedro@codesourcery.com>

	* arm-tdep.c: Include "remote.h" and
	"features/arm-with-m-fpa-layout.c".
	(arm_register_g_packet_guesses): New function.
	(arm_gdbarch_init): Don't force a target description with
	registers when the executable is detected as M-profile.  Instead
	set gdbarch->tdep->is_m.  Register `g' packet guesses.
	(_initialize_arm_tdep): Initialize the new target description.
	* features/arm-with-m-fpa-layout.xml: New description.
	* features/arm-with-m-fpa-layout.c: New, generated.

arm-tdep.c                         |   42 +++++++++++++++++++++++++++++++++-
features/arm-with-m-fpa-layout.c   |   44 ++++++++++++++++++++++++++++++++++++
features/arm-with-m-fpa-layout.xml |   45
+++++++++++++++++++++++++++++++++++++
3 files changed, 130 insertions(+), 1 deletion(-)

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
      **  Visit us at the ESC Expo at Design West in San Jose  **
      **  27-29 March, McEnery Convention Center - Stand #846  **
------["Si fractum non sit, noli id reficere"]------       Opinions==mine

Attachment: mprofile-backcompat.v2.patch
Description: Text document


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