浏览代码

hal: fix planted break instruction for Xtensa targets

On Xtensa, "break 0, 0" encodes a software breakpoint which is placed
into the program by the debug monitor. Planted breakpoints (added in
the code to trap into debugger) should be encoded as "break 1, 15".
See table "Breakpoint Instruction Operand Conventions" in the ISA
Reference manual.
Ivan Grokhotkov 5 年之前
父节点
当前提交
e449728b7d

+ 1 - 1
components/hal/esp32/include/hal/cpu_ll.h

@@ -170,7 +170,7 @@ static inline bool cpu_ll_is_debugger_attached(void)
 
 static inline void cpu_ll_break(void)
 {
-    __asm__ ("break 0,0");
+    __asm__ ("break 1,15");
 }
 
 static inline void cpu_ll_set_vecbase(const void* vecbase)

+ 1 - 1
components/hal/esp32s2/include/hal/cpu_ll.h

@@ -165,7 +165,7 @@ static inline bool cpu_ll_is_debugger_attached(void)
 
 static inline void cpu_ll_break(void)
 {
-    __asm__ ("break 0,0");
+    __asm__ ("break 1,15");
 }
 
 static inline void cpu_ll_set_vecbase(const void* vecbase)

+ 1 - 1
components/hal/esp32s3/include/hal/cpu_ll.h

@@ -169,7 +169,7 @@ static inline bool cpu_ll_is_debugger_attached(void)
 
 static inline void cpu_ll_break(void)
 {
-    __asm__ ("break 0,0");
+    __asm__ ("break 1,15");
 }
 
 static inline void cpu_ll_set_vecbase(const void *vecbase)