]> granicus.if.org Git - esp-idf/commitdiff
freertos: Move the "set debug watchpoint as stack overflow check" out of debugging...
authorAngus Gratton <angus@espressif.com>
Mon, 27 Feb 2017 00:49:46 +0000 (11:49 +1100)
committerAngus Gratton <angus@espressif.com>
Mon, 27 Feb 2017 00:49:46 +0000 (11:49 +1100)
Place it near the other stack overflow kconfig items, instead.

components/freertos/Kconfig

index c28287644d2806087a9f4959a597c777b3b082c8..04821cd5fcc37a1f1dd81e21867fcc67c003e04f 100644 (file)
@@ -76,6 +76,24 @@ config FREERTOS_CHECK_STACKOVERFLOW_CANARY
         (configCHECK_FOR_STACK_OVERFLOW=2)
 endchoice
 
+config FREERTOS_WATCHPOINT_END_OF_STACK
+    bool "Set a debug watchpoint as a stack overflow check"
+    default n
+    help
+        FreeRTOS can check if a stack has overflown its bounds by checking either the value of
+        the stack pointer or by checking the integrity of canary bytes. (See FREERTOS_CHECK_STACKOVERFLOW
+        for more information.) These checks only happen on a context switch, and the situation that caused
+        the stack overflow may already be long gone by then. This option will use the debug memory
+        watchpoint 1 (the second one) to allow breaking into the debugger (or panic'ing) as soon as any
+        of the last 32 bytes on the stack of a task are overwritten. The side effect is that using gdb, you
+        effectively only have one watchpoint; the 2nd one is overwritten as soon as a task switch happens.
+
+        This check only triggers if the stack overflow writes within 4 bytes of the end of the stack, rather than
+        overshooting further, so it is worth combining this approach with one of the other stack overflow check methods.
+
+        When this watchpoint is hit, gdb will stop with a SIGTRAP message. When no OCD is attached, esp-idf
+        will panic on an unhandled debug exception.
+
 config FREERTOS_THREAD_LOCAL_STORAGE_POINTERS
     int "Amount of thread local storage pointers"
     range 0 256 if !WIFI_ENABLED
@@ -203,22 +221,6 @@ config FREERTOS_PORTMUX_DEBUG_RECURSIVE
         portMUX usage.
 endif #FREERTOS_UNICORE
 
-
-config FREERTOS_WATCHPOINT_END_OF_STACK
-    bool "Set a debug watchpoint at the end of each stack"
-    default n
-    help
-        FreeRTOS can check if a stack has overflown its bounds by checking either the value of
-        the stack pointer or by checking the integrity of canary bytes. (See FREERTOS_CHECK_STACKOVERFLOW
-        for more information.) These checks only happen on a context switch, and the situation that caused
-        the stack overflow may already be long gone by then. This option will use the debug memory 
-        watchpoint 1 (the second one) to allow breaking into the debugger (or panic'ing) as soon as any 
-        of the last 32 bytes on the stack of a task are overwritten. The side effect is that using gdb, you
-        effectively only have one watchpoint; the 2nd one is overwritten as soon as a task switch happens.
-        
-        When this watchpoint is hit, gdb will stop with a SIGTRAP message. When no OCD is attached, esp-idf
-        will panic on an unhandled debug exception.
-
 endif # FREERTOS_DEBUG_INTERNALS
 
 endmenu