This is the mail archive of the gdb@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]

[RFC] Support ARMv7M FPU registers in 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



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