Go to the source code of this file.
Macros | |
#define | ENABLE_EXCEPTION_DUMP 1 |
#define | ENABLE_CRASH_DUMP 1 |
#define | GDBSTUB_ENABLE_DEBUG 0 |
#define | GDBSTUB_GDB_PATCHED 1 |
#define | GDBSTUB_USE_OWN_STACK 0 |
#define | GDBSTUB_STACK_SIZE 256 |
#define | GDBSTUB_BREAK_ON_EXCEPTION 1 |
#define | GDBSTUB_BREAK_ON_RESTART 1 |
#define | GDBSTUB_CTRLC_BREAK 2 |
#define | GDBSTUB_ENABLE_UART2 1 |
#define | GDBSTUB_ENABLE_SYSCALL 0 |
#define | GDBSTUB_ENABLE_HOSTIO 1 |
#define | GDBSTUB_BREAK_ON_INIT 1 |
#define | GDBSTUB_CMDENABLE_P 1 |
#define | GDBSTUB_CMDENABLE_X 1 |
#define | GDBSTUB_UART_READ_TIMEOUT 0 |
#define | GDBSTUB_FORCE_IRAM 0 |
Macro Definition Documentation
◆ ENABLE_CRASH_DUMP
#define ENABLE_CRASH_DUMP 1 |
When enabled, an unexpected reset (i.e. system crash) dumps a stack trace to debug output Default is ON for debug builds, OFF for release builds
Note: Not dependent upon ENABLE_GDB
◆ ENABLE_EXCEPTION_DUMP
#define ENABLE_EXCEPTION_DUMP 1 |
When enabled, an exception or crash dumps a stack trace to debug output Default is ON for debug builds, OFF for release builds
Note: Not dependent upon ENABLE_GDB
◆ GDBSTUB_BREAK_ON_EXCEPTION
#define GDBSTUB_BREAK_ON_EXCEPTION 1 |
Enable this to cause the program to pause and wait for gdb to be connected when an exception is encountered.
◆ GDBSTUB_BREAK_ON_INIT
#define GDBSTUB_BREAK_ON_INIT 1 |
Enable this if you want the GDB stub to wait for you to attach GDB before running. It does this by breaking in the init routine; use the gdb 'c' command (continue) to start the program.
◆ GDBSTUB_BREAK_ON_RESTART
#define GDBSTUB_BREAK_ON_RESTART 1 |
Enable this to cause the program to pause and wait for gdb to be connected when an unexpected system restart occurs.
◆ GDBSTUB_CMDENABLE_P
#define GDBSTUB_CMDENABLE_P 1 |
Some commands are not required by GDB, so if neccessary can be disabled to save memory.
◆ GDBSTUB_CMDENABLE_X
#define GDBSTUB_CMDENABLE_X 1 |
◆ GDBSTUB_CTRLC_BREAK
#define GDBSTUB_CTRLC_BREAK 2 |
If this is defined, gdbstub will break the program when you press Ctrl-C in gdb. It does this by monitoring for the 'x03' character in the serial receive routine. Any preceding characters are passed through to the application via UART2. If your application uses the serial port for terminal (text) communications you should be OK, but binary transfers are likely to cause problems and this option should probably be disabled. Instead, use GDBSTUB_BREAK_ON_INIT, or call gdb_do_break() in your application.
Specify: 0 to disable Ctrl+C break checking completely 1 to allow Ctrl+C break only when debugger is attached 2 to allow Ctrl+C break at any time. Ensure you have set remote interrupt-on-connect on in GDB command file, so it will send a Ctrl+C sequence when attempting to connect
◆ GDBSTUB_ENABLE_DEBUG
#define GDBSTUB_ENABLE_DEBUG 0 |
When defined, GDB communications are echoed to UART1 for testing GDB stub operation.
0: No debug output 1: Show decoded commands and responses 2: Show packet content 3: Show debug output for internal routines
◆ GDBSTUB_ENABLE_HOSTIO
#define GDBSTUB_ENABLE_HOSTIO 1 |
Enable Host I/O capability, where files may be accessed via GDB command prompt using remote get
, remote put
and remote delete
commands.
◆ GDBSTUB_ENABLE_SYSCALL
#define GDBSTUB_ENABLE_SYSCALL 0 |
Enable gdb_syscall_* functions for use by application. If undefined, calls will do nothing and return -1.
◆ GDBSTUB_ENABLE_UART2
#define GDBSTUB_ENABLE_UART2 1 |
The GDB stub has exclusive access to UART0, so applications cannot use it directly and attempts to open it will fail.
If this option is enabled, the default serial port will be changed to UART2 to allow debug output (from m_printf, debug_*, os_printf, etc.) to show up in your GDB session.
Outside of GDB terminal applications should work as normal, with the following caveats:
If GDBSTUB_BREAK_ON_INIT is defined, then at startup your application will display `$T05#b9` and stop. A similar thing will happen if GDBSTUB_CTRLC_BREAK=2 and you type Ctrl+C. Continue by typing `$D#44` (without the quotes), or exit the terminal and start GDB.
See GDB remote serial protocol for further details.
Disabling this option releases some IRAM. You may be instead able to use UART1 for debug output, adding Serial.setPort(UART_ID_1);
in your application's init()
function.
◆ GDBSTUB_FORCE_IRAM
#define GDBSTUB_FORCE_IRAM 0 |
Wherever possible gdbstub code is placed in flash memory. This is fine for most cases, but if debugging whilst flash is disabled or busy (eg during SPI operations or flash write/erase) then you will need to enable this option to move stub code into IRAM.
◆ GDBSTUB_GDB_PATCHED
#define GDBSTUB_GDB_PATCHED 1 |
Espressif provide a patched version of GDB which emits only those registered present in the lx106. Set to 0 if an unpatched version of GDB is used.
◆ GDBSTUB_STACK_SIZE
#define GDBSTUB_STACK_SIZE 256 |
◆ GDBSTUB_UART_READ_TIMEOUT
#define GDBSTUB_UART_READ_TIMEOUT 0 |
Specify a timeout (in milliseconds) when stub is reading from serial port. Set to 0 to wait indefinitely.
◆ GDBSTUB_USE_OWN_STACK
#define GDBSTUB_USE_OWN_STACK 0 |
Enable this to make the exception and debugging handlers switch to a private stack. This will use up 1K of RAM, but may be useful if you're debugging stack or stack pointer corruption problems. It's normally disabled because not many situations need it. If for some reason the GDB communication stops when you run into an error in your code, try enabling this.