arm: Remote GDB: register xfer for AArch32
Review Request #3203 - Created Nov. 10, 2015 and discarded
| Information | |
|---|---|
| Boris Shingarov | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 11209:83e890c83564 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- arm: Remote GDB: register xfer for AArch32 This patch stops remote gdb from panicking when connecting to a 32-bit target. We send the response to the g-packet from the buffer and the size in GdbRegCache.size. Both the buffer is allocated, and the size is set, at RemoteGDB object instantiation time, which is before we know if we will be running an AArch32 or AArch64 workload; therefore the longest possible size is assumed. The problem is that at actual packet processing time, if we are in AArch32 mode with its smaller register set, we still answer the whole buffer and gdb panics from seeing the oversized packet. To avoid this, I set the 'size' member to the correct value when processing each g-packet, according to whether we are in 32- or 64-bit mode. Another problem is the order in which register values are transferred. Ideally, we should serve gdb with a feature descriptor XML document. For now, I simply put in the default offsets assumed by gdb 7.10 in the absence of feature descriptors. Also in the absence of feature descriptors, gdb expects that the CPU has extended-precision FP registers (96 bits wide). This situation is beyond the simple design of the reg cache as a union of uint8/... arrays. In my opinion, it is worth improving the general union-based design (and possibly implementing feature descriptors) before fixing FPs in this case; therefore this patch simply transfers zeros to gdb, and ignores FP values coming from gdb.
Tested with gdb-7.10 configured with "--target=arm-linux-gnueabihf" connecting to gem5 running an arm-linux-gnueabihf binary in SE mode. Tested also with gdb-7.10 configured with "--target=aarch64-linux-gnu" connecting to gem5 running an aarch64-linux-gnu binary in SE mode to ensure against AArch64 regressions. Note that even with this patch, remote debugging of 32-bit ARM is still not useful because of problems with inserting breakpoints which I address in a separate patch.
Hi Boris! Thanks for taking time to improve gem5's ARM backend.
I have had a look at the patch and it seems like the the offset changes are correct. The issues I have highlighted above (with the exception of the change to FP register transfer) are mostly style related to make everyone's lives easier. I would apprecaite it if you could fix those issues.
Also, before the change can be committed, the changeset needs to comply with gem5's commit log style. See http://www.m5sim.org/Submitting_Contributions. In particular, I'd like a more detailed description of what you change and why.
-
src/arch/arm/remote_gdb.hh (Diff revision 1) -
These new offsets seem correct, but I don't like the fact that you renamed them and replaced the enum.
Could you keep the old names and enum structure? That makes the code symmetrical with respect to the aarch64 and it would reduce the size of the changeset (and that makes reviewing much easier).
-
src/arch/arm/remote_gdb.hh (Diff revision 1) -
Use a GDB32_NUMREGS constant similar to how aarch64 does it.
-
src/arch/arm/remote_gdb.cc (Diff revision 1) -
Why did you move this one into the aarch64 block?
-
src/arch/arm/remote_gdb.cc (Diff revision 1) -
Keep this in the common code path.
-
src/arch/arm/remote_gdb.cc (Diff revision 1) -
Are FP register transfers currently broken?
Hi Boris. I think you might have uploaded the wrong diff (or potentially a diff that needs to be applied after your old diff). Also, the diff viewer in ReviewBoard can't show it, which suggests that it wasn't uploaded correctly.
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+1 -1) |
Diff: |
Revision 4 (+1 -1) |
|---|
Change Summary:
Ok, I uploaded the patch file manually and now it seems to show correctly on rb. I guess I can't trust the "hg postreview" extension.
Diff: |
Revision 5 (+30 -25) |
|---|
