gdbstub-cfg.h 2.3 KB

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