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]

[RFC][PATCH 00/15] Fast tracepoint support for ARMv7


From: Henrik Wallin <henrik.wallin@windriver.com>

Hi,

This implements fast tracepoint support for ARMv7. It handles both arm
and thumb mode.
The first 8 patches are bug-fixes and not directly related to the
ARM support and should probably be separated out from this patch set,
but I keep them in here for now. The following 7 patches contains the
ARM support for fast tracepoint.

I post this as an RFC at this point, as I'm not actively working
with this. I will response and post updates to this series, but any major
improvements / changes will be hard to achieve for me at this point.

There are some left-over issues:
- The breakpoint based tracepoints does not work. There is another
  thread [1] providing needed gdbserver changes to achieve that. Those
  patches together with these should provide full tracepoint support for
  ARMv7. (Not verified)

- Patch "gdbserver: Add help functions to get arm/thumb mode" needs a
  better solution.

- How to correctly identify that the running ARM cpu is supporting
  ARMv7-a.

- No updates done to the testsuite.

Known limitations
- Current implementation will refuse all instruction that do
  any relative operation with the PC counter, as relocating such an
  instruction is non-trivial. This can be improved as some of those
  instructions can be re-written with alternative instruction(s).

- There is no included jit tracepoint expression optimization
  included. This should be possible to add.

- Can only set a tracepoint at a 4 bytes instructions, as a 2 bytes
  slot is too small for the needed jump instruction. This feels like a
  natural limitation for this functionality, but means that for thumb
  the user will hit this limitation quite often.

- The inserted 4 byte jump instruction has a limitation on how far it
  can branch. The length is validated, but if too far it will not be
  possible to insert the tracepoint. With very large programs this
  might be an issue, but again feels like a natural limitation.
  
Testing
- The internal testsystem has not been run, but I will look into
  that. I've run other tests on it though and I have no known
  problems.

Patch description:

Patches are based on master, e753e154bf8a1f507b43e03dec04b341dde3f429

patch 1-8:
Bugfixes in generic code. Not specific to ARM. Should probably be
split out from this patch set.

patch 9-13: Adds new code (but not activated) for ARM tracepoints.

patch 14-15: Activates and makes tracepoints available.

[1]: https://sourceware.org/ml/gdb-patches/2015-09/msg00221.html

Henrik Wallin (9):
  Fix mmap usage of MAP_FIXED for multiple pages.
  gdbserver: Move pointer dereference to after assert checks.
  gdb: Add relocate instruction helpers
  gdb: Add arm_fast_tracepoint_valid_at
  gdbserver: Add helper functions to create arm instructions
  gdbserver: Add help functions to get arm/thumb mode
  gdbserver: Add arm_install_fast_tracepoint_jump_pad
  gdbserver: Add linux-arm-ipa.c
  gdb/gdbserver: Enable tracepoint for ARM

Par Olsson (6):
  Fix endian problem for tracepoint enabled flag
  Fix internal error when saving fast tracepoint definitions
  Fix crash in enable/disable after detach
  Fix crash in tstatus after detach
  Fix crash when tstart after detach.
  Add possibility to restart trace after tfind.

 gdb/arm-tdep.c                | 658 ++++++++++++++++++++++++++++++++++++++++++
 gdb/breakpoint.c              |   2 +-
 gdb/common/agent.c            |   7 +
 gdb/gdbserver/Makefile.in     |   6 +
 gdb/gdbserver/configure.srv   |   1 +
 gdb/gdbserver/linux-arm-ipa.c |  97 +++++++
 gdb/gdbserver/linux-arm-low.c | 410 +++++++++++++++++++++++++-
 gdb/gdbserver/tracepoint.c    |  33 ++-
 gdb/tracepoint.c              |  14 +-
 9 files changed, 1218 insertions(+), 10 deletions(-)
 create mode 100644 gdb/gdbserver/linux-arm-ipa.c

-- 
2.1.4


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