diff options
author | Tom Tromey <tom@tromey.com> | 2023-06-19 11:53:10 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-06-20 11:00:19 -0600 |
commit | 90db289d0d0f36d993788c9218bd1616f792eb08 (patch) | |
tree | 81b1e9e6b4e31226c40928e2fbc3d9913779b538 /gdb | |
parent | c7face14225296a2f5d3ebeb8ace88c166d80c3e (diff) | |
download | gdb-90db289d0d0f36d993788c9218bd1616f792eb08.zip gdb-90db289d0d0f36d993788c9218bd1616f792eb08.tar.gz gdb-90db289d0d0f36d993788c9218bd1616f792eb08.tar.bz2 |
Remove mem2hex
tracepoint.c has a 'mem2hex' function that is functionally equivalent
to bin2hex. This patch removes the redundancy.
Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/tracepoint.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index f297cea..0af7404 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -69,7 +69,7 @@ the worst case of maximum length for each of the pieces of a continuation packet. - NOTE: expressions get mem2hex'ed otherwise this would be twice as + NOTE: expressions get bin2hex'ed otherwise this would be twice as large. (400 - 31)/2 == 184 */ #define MAX_AGENT_EXPR_LEN 184 @@ -156,7 +156,6 @@ static std::string trace_stop_notes; /* support routines */ struct collection_list; -static char *mem2hex (gdb_byte *, char *, int); static counted_command_line all_tracepoint_actions (struct breakpoint *); @@ -1226,7 +1225,7 @@ collection_list::stringify () end += 10; /* 'X' + 8 hex digits + ',' */ count += 10; - end = mem2hex (m_aexprs[i]->buf, end, m_aexprs[i]->len); + end += 2 * bin2hex (m_aexprs[i]->buf, end, m_aexprs[i]->len); count += 2 * m_aexprs[i]->len; } @@ -2888,31 +2887,6 @@ set_trace_stop_notes (const char *args, int from_tty, warning (_("Target does not support trace notes, stop note ignored")); } -/* Convert the memory pointed to by mem into hex, placing result in buf. - * Return a pointer to the last char put in buf (null) - * "stolen" from sparc-stub.c - */ - -static const char hexchars[] = "0123456789abcdef"; - -static char * -mem2hex (gdb_byte *mem, char *buf, int count) -{ - gdb_byte ch; - - while (count-- > 0) - { - ch = *mem++; - - *buf++ = hexchars[ch >> 4]; - *buf++ = hexchars[ch & 0xf]; - } - - *buf = 0; - - return buf; -} - int get_traceframe_number (void) { |