public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* [RFC] Support ARMv7M FPU registers in GDB
@ 2012-04-19  4:25 Terry Guo
  2012-04-19 14:17 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: Terry Guo @ 2012-04-19  4:25 UTC (permalink / raw)
  To: palves, jifl; +Cc: Joey Ye, Matthew Gretton-Dann, gdb

Hi,

The ARM Cortex-M4 processor is based on ARMv7M architecture and enhanced by
its DSP extension and Floating Point Unit. As more and more M4 based boards
are emerging in the market, I would like to propose following solution for
GDB to support the access of FPU registers.

1). I studied how the GDB support other Cortex-M core like Cortex-M3 and
noticed that the GDB has to use "g_packet_guess" mechanism to maintain
compatibility. I don't know why some gdb stubs return faked FPA registers
and some don't. But as M4 board are all recently released board, so maybe it
is time for M4 gdb stub to return a correct g packet: 16 core registers +
xpsr register + 16 double precision FPU registers + fpscr register. Does
this expectation make sense? Is it possible for gdb stub to do so?

2). The GDB is going to need a new target description file to describe M4
register layout. I propose arm-with-m-fpu.xml for its filename. For file
content, it just includes another two existing xml files arm-m-profile.xml
and arm-vfpv2.xml.

3). In function arm_gdbarch_init, I propose to add more checks where we
check whether the target is cortex-m. At this point, once the gdb figures
out the target is cortex-m4 from the ELF attributes, we then set the tdesc
to tdesc_arm_with_m_fpu.

4). No need to describe the single precision FPU registers in XML file
because the GDB will handle them as aliases of double precision format.

5). According to M4 Debug architecture, there is a pretty straight way for
stub to access FPU registers in single precision format. But there is no
direct way to access FPU registers in double precision format. So one more
thing for GDB stub is that the stub needs to do more work to construct
double precision register from two single precision registers.

Is this proposal good enough? Please feel free to comment. And any of them
are welcomed.

BR,
Terry


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-19 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19  4:25 [RFC] Support ARMv7M FPU registers in GDB Terry Guo
2012-04-19 14:17 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).