The esp8266 portion of the project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.9 KiB

  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 1
  18. #endif
  19. /*
  20. Enable this to cause the program to pause and wait for gdb to be connected when an exception is
  21. encountered.
  22. */
  23. #ifndef GDBSTUB_BREAK_ON_EXCEPTION
  24. #define GDBSTUB_BREAK_ON_EXCEPTION 1
  25. #endif
  26. /*
  27. If this is defined, gdbstub will break the program when you press Ctrl-C in gdb. it does this by
  28. hooking the UART interrupt. Unfortunately, this means receiving stuff over the serial port won't
  29. work for your program anymore. This will fail if your program sets an UART interrupt handler after
  30. the gdbstub_init call.
  31. */
  32. #ifndef GDBSTUB_CTRLC_BREAK
  33. #define GDBSTUB_CTRLC_BREAK 1
  34. #endif
  35. /*
  36. Enabling this will redirect console output to GDB. This basically means that printf/os_printf output
  37. will show up in your gdb session, which is useful if you use gdb to do stuff. It also means that if
  38. you use a normal terminal, you can't read the printfs anymore.
  39. */
  40. #ifndef GDBSTUB_REDIRECT_CONSOLE_OUTPUT
  41. #define GDBSTUB_REDIRECT_CONSOLE_OUTPUT 1
  42. #endif
  43. /*
  44. Enable this if you want the GDB stub to wait for you to attach GDB before running. It does this by
  45. breaking in the init routine; use the gdb 'c' command (continue) to start the program.
  46. */
  47. #ifndef GDBSTUB_BREAK_ON_INIT
  48. #define GDBSTUB_BREAK_ON_INIT 0
  49. #endif
  50. /*
  51. Function attributes for function types.
  52. Gdbstub functions are placed in flash or IRAM using attributes, as defined here. The gdbinit function
  53. (and related) can always be in flash, because it's called in the normal code flow. The rest of the
  54. gdbstub functions can be in flash too, but only if there's no chance of them being called when the
  55. flash somehow is disabled (eg during SPI operations or flash write/erase operations). If the routines
  56. are called when the flash is disabled (eg due to a Ctrl-C at the wrong time), the ESP8266 will most
  57. likely crash.
  58. */
  59. #ifndef ATTR_GDBINIT
  60. #define ATTR_GDBINIT ICACHE_FLASH_ATTR
  61. #endif
  62. #ifndef ATTR_GDBFN
  63. #define ATTR_GDBFN ICACHE_RAM_ATTR
  64. #endif
  65. #ifndef ATTR_GDBEXTERNFN
  66. #define ATTR_GDBEXTERNFN ICACHE_FLASH_ATTR
  67. #endif
  68. #ifndef ASATTR_GDBINIT
  69. #define ASATTR_GDBINIT .section .irom0.text
  70. #endif
  71. #ifndef ASATTR_GDBFN
  72. #define ASATTR_GDBFN .section .iram.text
  73. #endif
  74. #ifndef ASATTR_GDBEXTERNFN
  75. #define ASATTR_GDBEXTERNFN .section .irom0.text
  76. #endif
  77. #endif