ESP8266
gdbstub-cfg.h
1 #ifndef GDBSTUB_CFG_H
2 #define GDBSTUB_CFG_H
3 
4 /*
5 Enable this define if you're using the RTOS SDK. It will use a custom exception handler instead of the HAL
6 and do some other magic to make everything work and compile under FreeRTOS.
7 */
8 #ifndef GDBSTUB_FREERTOS
9 #define GDBSTUB_FREERTOS 0
10 #endif
11 
12 /*
13 Enable this to make the exception and debugging handlers switch to a private stack. This will use
14 up 1K of RAM, but may be useful if you're debugging stack or stack pointer corruption problems. It's
15 normally disabled because not many situations need it. If for some reason the GDB communication
16 stops when you run into an error in your code, try enabling this.
17 */
18 #ifndef GDBSTUB_USE_OWN_STACK
19 #define GDBSTUB_USE_OWN_STACK 0
20 #endif
21 
22 /*
23 If this is defined, gdbstub will break the program when you press Ctrl-C in gdb. it does this by
24 hooking the UART interrupt. Unfortunately, this means receiving stuff over the serial port won't
25 work for your program anymore. This will fail if your program sets an UART interrupt handler after
26 the gdbstub_init call.
27 */
28 #ifndef GDBSTUB_CTRLC_BREAK
29 #define GDBSTUB_CTRLC_BREAK 0
30 #endif
31 
32 /*
33 Enabling this will redirect console output to GDB. This basically means that printf/os_printf output
34 will show up in your gdb session, which is useful if you use gdb to do stuff. It also means that if
35 you use a normal terminal, you can't read the printfs anymore.
36 */
37 #ifndef GDBSTUB_REDIRECT_CONSOLE_OUTPUT
38 #define GDBSTUB_REDIRECT_CONSOLE_OUTPUT 0
39 #endif
40 
41 /*
42 Enable this if you want the GDB stub to wait for you to attach GDB before running. It does this by
43 breaking in the init routine; use the gdb 'c' command (continue) to start the program.
44 */
45 #ifndef GDBSTUB_BREAK_ON_INIT
46 #define GDBSTUB_BREAK_ON_INIT 0
47 #endif
48 
49 /*
50 Function attributes for function types.
51 Gdbstub functions are placed in flash or IRAM using attributes, as defined here. The gdbinit function
52 (and related) can always be in flash, because it's called in the normal code flow. The rest of the
53 gdbstub functions can be in flash too, but only if there's no chance of them being called when the
54 flash somehow is disabled (eg during SPI operations or flash write/erase operations). If the routines
55 are called when the flash is disabled (eg due to a Ctrl-C at the wrong time), the ESP8266 will most
56 likely crash.
57 */
58 #define ATTR_GDBINIT ICACHE_FLASH_ATTR
59 #define ATTR_GDBFN
60 
61 #endif