diff options
author | Andrew Burgess <aburgess@redhat.com> | 2023-03-22 17:22:51 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2023-03-29 08:57:10 +0100 |
commit | a6e5abae4e9e845e6e69e07f755c0805558dcd63 (patch) | |
tree | bbae67ddbbf65a8717b94be9f97f9bdcf4bc5074 /gdb/i386-tdep.c | |
parent | 6d84a385ed96ba457bdec3dd983643dd7afa3665 (diff) | |
download | gdb-a6e5abae4e9e845e6e69e07f755c0805558dcd63.zip gdb-a6e5abae4e9e845e6e69e07f755c0805558dcd63.tar.gz gdb-a6e5abae4e9e845e6e69e07f755c0805558dcd63.tar.bz2 |
gdb: move displaced_step_dump_bytes into gdbsupport (and rename)
It was pointed out during review of another patch that the function
displaced_step_dump_bytes really isn't specific to displaced stepping,
and should really get a more generic name and move into gdbsupport/.
This commit does just that. The function is renamed to
bytes_to_string and is moved into gdbsupport/common-utils.{cc,h}. The
function implementation doesn't really change. Much...
... I have updated the function to take an array view, which makes it
slightly easier to call in a couple of places where we already have a
gdb::bytes_vector. I've then added an inline wrapper to convert a raw
pointer and length into an array view, which is used in places where
we don't easily have a gdb::bytes_vector (or similar).
Updated all users of displaced_step_dump_bytes.
There should be no user visible changes after this commit.
Finally, I ended up having to add an include of gdb_assert.h into
array-view.h. When I include array-view.h into common-utils.h I ran
into build problems because array-view.h calls gdb_assert.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 96c04c1..e93479c 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -830,7 +830,7 @@ i386_displaced_step_copy_insn (struct gdbarch *gdbarch, displaced_debug_printf ("%s->%s: %s", paddress (gdbarch, from), paddress (gdbarch, to), - displaced_step_dump_bytes (buf, len).c_str ()); + bytes_to_string (buf, len).c_str ()); /* This is a work around for a problem with g++ 4.8. */ return displaced_step_copy_insn_closure_up (closure.release ()); |