aboutsummaryrefslogtreecommitdiff
path: root/src/helper/log.h
diff options
context:
space:
mode:
authorJan Matyas <matyas@codasip.com>2021-05-21 08:02:29 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2021-06-04 17:43:26 +0100
commit49820b8afd150af8df3c02c717d86b8d2cdf7cad (patch)
tree6cfa248fc02c155239b8c04f5a127ee02bd95f4f /src/helper/log.h
parenta8d3f601136ccfe446041631cb46a62922f46bca (diff)
downloadriscv-openocd-49820b8afd150af8df3c02c717d86b8d2cdf7cad.zip
riscv-openocd-49820b8afd150af8df3c02c717d86b8d2cdf7cad.tar.gz
riscv-openocd-49820b8afd150af8df3c02c717d86b8d2cdf7cad.tar.bz2
gdb_server: Log both incoming and outgoing GDB packets
- Made sure that also outgoing GDB packets are logged, not only the incoming ones. - Improved the treatment of non-printable characters in the packets to make it more robust. Prior to this change: - Outgoing packets were not printed unless OpenOCD was re-compiled with _DEBUG_GDB_IO_. - Non-prinable characters were only treated in incoming 'X' packets. After this change: - Both incoming and outgoing GDB packets are logged on debug_level >= 3, so that both directions of the GDB channel are visible. - Non-printable characters are checked for in every packet so that hey do not interfere with the terminal. Change-Id: I0613e57ae5059b3279b0abcb71276cf5719a8699 Signed-off-by: Jan Matyas <matyas@codasip.com> Reviewed-on: http://openocd.zylin.com/6269 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/helper/log.h')
-rw-r--r--src/helper/log.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/helper/log.h b/src/helper/log.h
index f2ba0da..34ff835 100644
--- a/src/helper/log.h
+++ b/src/helper/log.h
@@ -100,6 +100,8 @@ char *alloc_vprintf(const char *fmt, va_list ap);
char *alloc_printf(const char *fmt, ...)
__attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 1, 2)));
+char *find_nonprint_char(char *buf, unsigned buf_len);
+
extern int debug_level;
/* Avoid fn call and building parameter list if we're not outputting the information.