- Add `printk` support to aid multi-core debugging.
- Add lock trace to aid lock debugging.
- Fixes to gcc-7.1 warnings.
- Fixes from ticket #2879.
- Add verbose command controls.
- Change using the RTEMS sys/lock.h API to manage exception threads.
- ARM hardware breakpoint fixes. Support for SMP stepping
is not implemented, this requires use of the context id
register.
Closes #2879.
---
cpukit/libdebugger/rtems-debugger-arm.c| 245 -
cpukit/libdebugger/rtems-debugger-block.c | 3 +-
cpukit/libdebugger/rtems-debugger-block.h | 3 +-
cpukit/libdebugger/rtems-debugger-cmd.c| 21 ++-
cpukit/libdebugger/rtems-debugger-i386.c | 3 +-
cpukit/libdebugger/rtems-debugger-remote-tcp.c | 3 +-
cpukit/libdebugger/rtems-debugger-remote-tcp.h | 3 +-
cpukit/libdebugger/rtems-debugger-remote.c | 3 +-
cpukit/libdebugger/rtems-debugger-remote.h | 3 +-
cpukit/libdebugger/rtems-debugger-server.c | 232 +++
cpukit/libdebugger/rtems-debugger-server.h | 35 ++--
cpukit/libdebugger/rtems-debugger-target.c | 126 -
cpukit/libdebugger/rtems-debugger-target.h | 22 ++-
cpukit/libdebugger/rtems-debugger-threads.c| 61 +++---
cpukit/libdebugger/rtems-debugger-threads.h| 16 +-
15 files changed, 466 insertions(+), 313 deletions(-)
diff --git a/cpukit/libdebugger/rtems-debugger-arm.c
b/cpukit/libdebugger/rtems-debugger-arm.c
index 200d758a6b..6e5c9dc5ae 100644
--- a/cpukit/libdebugger/rtems-debugger-arm.c
+++ b/cpukit/libdebugger/rtems-debugger-arm.c
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2016 Chris Johns . All rights reserved.
+ * Copyright (c) 2016-2017 Chris Johns .
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -221,13 +222,19 @@ static arm_debug_hwbreak hw_breaks[ARM_HW_BREAKPOINT_MAX];
//static arm_debug_hwbreak hw_watches[ARM_HW_WATCHPOINT_MAX];
#if TARGET_DEBUG
+void rtems_debugger_printk_lock(rtems_interrupt_lock_context* lock_context);
+void rtems_debugger_printk_unlock(rtems_interrupt_lock_context* lock_context);
+
static void target_printk(const char* format, ...) RTEMS_PRINTFLIKE(1, 2);
static void
target_printk(const char* format, ...)
{
+ rtems_interrupt_lock_context lock_context;
va_list ap;
va_start(ap, format);
+ rtems_debugger_printk_lock(&lock_context);
vprintk(format, ap);
+ rtems_debugger_printk_unlock(&lock_context);
va_end(ap);
}
static const char*
@@ -261,45 +268,66 @@ mode_label(int mode)
#endif
/*
- * Read and write a CP14 register.
- *
- * The software debug event registers are not easy to program because there are
- * up to 32 registers and the instructions have to assembler for each of the 32
- * registers, you cannot program it. This means there is a switch table to do
- * this.
+ * CP register access.
*/
-#define ARM_CP14_INSTR(_opc, _val, _CRn, _CRm, _opc2) \
- #_opc " p14, 0, %[" #_val "], c" #_CRn ", c" #_CRm ", " #_opc2 "\n"
+#define ARM_CP_INSTR(_opc, _cp, _op1, _val, _CRn, _CRm, _op2) \
+ #_opc " p" #_cp ", " #_op1 ", %[" #_val "], c" #_CRn ", c" #_CRm ", " #_op2
"\n"
-#define ARM_CP14_WRITE(_val, _CRn, _CRm, _opc2)\
+#define ARM_CP_WRITE(_cp, _op1, _val, _CRn, _CRm, _op2)\
do { \
ARM_SWITCH_REG;\
asm volatile( \
ASM_ARM_MODE \
- ARM_CP14_INSTR(mcr, val, _CRn, _CRm, _opc2) \
+ ARM_CP_INSTR(mcr, _cp, _op1, val, _CRn, _CRm, _op2) \
ASM_THUMB_MODE \
: ARM_SWITCH_REG_ASM \
: [val] "r" (_val)); \
} while (0)
-#define ARM_CP14_READ(_val, _CRn, _CRm, _opc2) \
+#define ARM_CP_READ(_cp, _op1, _val, _CRn, _CRm, _op2) \
do { \
ARM_SWITCH_REG;\
asm volatile( \
ASM_ARM_MODE \
- ARM_CP14_INSTR(mrc, val, _CRn, _CRm, _opc2) \
+ ARM_CP_INSTR(mrc, _cp, _op1, val, _CRn, _CRm, _op2) \
ASM_THUMB_MODE \
: ARM_SWITCH_REG_ASM,\
[val] "=&r" (_val)); \
} while (0)
+/*
+ * Read and write a CP14 register.
+ *
+ * The software debug event registers are not easy to program because there are
+ * up to 32 registers and the instructions have to assembler for each of the 32
+ * registers, you cannot program it. This means there is a switch table to do
+ * this.
+ */
+#define ARM_CP14_WRITE(_val, _C