[PATCHv2,0/2] displaced stepping debug improvements

Message ID cover.1679519312.git.aburgess@redhat.com
Headers
Series displaced stepping debug improvements |

Message

Andrew Burgess March 22, 2023, 9:17 p.m. UTC
  This mini series is just an expansion of the first patch from the
parent series: improvements to the displaced stepping debug output.

In V2:

  - As Simon suggested, the debug has now moved to
    displaced_step_prepare_throw, so the (not yet upstreamed)
    displaced stepping for the AMD GPU target should still see the
    debug output,

  - The debug code now handles a failure to disassemble better:
    there's nothing worse than enabling debug to try and solve a
    problem, and having GDB crash in a different way.  If an
    instruction fails to disassemble GDB will now print a basic debug
    message and skip the rest of the debug output,

  - As suggested, I've moved the displaced_step_dump_bytes helper
    function into gdbsupport/ and given it a better name,

  - I have NOT tried to implement the improvement Simon suggested
    where the architecture backend tells GDB core how many bytes the
    replacement instruction(s) occupied.  This still means that in
    some cases we will disassemble the entire displaced step buffer
    unnecessarily, but I don't see that as a huge problem.  Fixing
    this just to reduce some debug output a little seems excessive.
    Let me know if you feel this is a blocker for this work being
    merged and I can take another look at it.

Thanks,
Andrew

---

Andrew Burgess (2):
  gdb: more debug output for displaced stepping
  gdb: move displaced_step_dump_bytes into gdbsupport (and rename)

 gdb/amd64-tdep.c           |   2 +-
 gdb/displaced-stepping.c   |   3 +-
 gdb/i386-tdep.c            |   2 +-
 gdb/infrun.c               | 101 ++++++++++++++++++++++++-------------
 gdb/infrun.h               |   3 --
 gdb/rs6000-tdep.c          |   2 +-
 gdb/s390-tdep.c            |   2 +-
 gdbsupport/array-view.h    |   1 +
 gdbsupport/common-utils.cc |  18 +++++++
 gdbsupport/common-utils.h  |  15 ++++++
 10 files changed, 105 insertions(+), 44 deletions(-)


base-commit: bf3f6c02d73f9823b8cb4f59524f29fbbfb6126d