Add support of coprocessor cp15, cp14 registers in the embedded gdb server

Bug #792508 reported by XVilka
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GDB
Invalid
Wishlist
Unassigned
Linaro QEMU
Confirmed
Wishlist
Unassigned

Bug Description

Please add support of exposion of ARM coprocesor registers/logic at the embedded gdb server,
  for example of cp15, cp14, etc registers.

Related project http://jtagarmgdbsrvr.sourceforge.net/index.html

Revision history for this message
XVilka (xvilka) wrote :
Revision history for this message
Peter Maydell (pmaydell) wrote :

If support for querying and setting cp15 registers is added to gdb and the gdb protocol, I'm happy to add support in QEMU. However this can't happen until the gdb side is implemented and accepted upstream. So this bug is blocked on 792512.

Changed in qemu-linaro:
status: New → Incomplete
status: Incomplete → New
importance: Undecided → Wishlist
Loïc Minier (lool)
Changed in qemu-linaro:
status: New → Confirmed
Michael Hope (michaelh1)
Changed in gdb-linaro:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Ulrich Weigand (uweigand) wrote :

If I understand the request correctly, this is about the whole-system debugging case, where you want to make available system-level registers for display and/or modification in GDB.

In this case, I don't think we want to add those to the default set(s) of supported registers in core GDB or the standard gdbserver -- those are all about debugging userspace-level applications, where those registers are not available.

Instead, GDB these days provides a generic feature where remote targets that support different use cases (in particular, system-level debugging) may provide a list of registers they support to GDB. GDB will then automatically make use of those without the need for any actual code changes.

That mechanism is called "Target Descriptions", and documented in the GDB manual here:
http://sourceware.org/gdb/current/onlinedocs/gdb/Target-Descriptions.html

So if QEMU wants to, it could provide a target description (which is an XML file describing, amongst other information, the full set of supported registers) that includes those system-level coprocessor registers. This would not require any changes to GDB (or gdbserver, for that matter).

Revision history for this message
Peter Maydell (pmaydell) wrote :

Neat. How seriously should we take the warning in the docs that "target descriptions are still under active development, and the contents and format may change between gdb releases." ? (ie is it really in flux or is that just a covering statement in case something comes up that requires a change?)

Revision history for this message
Ulrich Weigand (uweigand) wrote :

Huh, that warning seems to be long obsolete; it's been in the docs since the original release of the feature 4.5 years ago ... At this point, I'd consider the target description format stable (of course support for additional XML elements to describe new features may be added over time).

I'll clarify the status of that warning with the GDB community.

Revision history for this message
Ulrich Weigand (uweigand) wrote :

> I'll clarify the status of that warning with the GDB community.

The consensus was that the format is supposed to be stable, and that this warning should be removed from the documentation. I've just checked in a patch to do so. (This should show up on the web site by tomorrow or so.)

Revision history for this message
Ulrich Weigand (uweigand) wrote :

Given the prior discussion here, it is my understanding that this feature can now be implemented solely on the QEMU side with no requirements on GDB changes. Therefore I'll set the "Linaro GDB" flavor of this bug to Invalid.

Changed in gdb-linaro:
status: Confirmed → Invalid
Revision history for this message
Peter Maydell (pmaydell) wrote :

...and in fact qemu's gdb stub implementation already has support for using the XML register descriptions (it's how we implement Neon/VFP registers). As part of the rework of cp15 register handling (https://blueprints.launchpad.net/qemu-linaro/+spec/cp15-rework) it should be possible to auto-create XML that will expose all the implement cp15 registers to gdb, I think.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.