GDB debugging support
Collaboration diagram for GDB debugging support:

Modules

 GDB system call API
 

Macros

#define gdb_do_break()
 Break into GDB, if present. More...
 

Enumerations

enum  GdbState { eGDB_NotPresent , eGDB_Detached , eGDB_Attached }
 

Functions

void gdb_init (void)
 Initialise GDB stub, if present. More...
 
void gdb_enable (bool state)
 Dynamically enable/disable GDB stub. More...
 
GdbState gdb_present (void)
 Check if GDB stub is present. More...
 
void gdb_on_attach (bool attached)
 Called from task queue when GDB attachment status changes. More...
 
void gdb_detach ()
 Detach from GDB, if attached. More...
 
void debug_crash_callback (const struct rst_info *rst_info, uint32_t stack, uint32_t stack_end)
 
void debug_print_stack (uint32_t start, uint32_t end)
 Send a stack dump to debug output. More...
 

Detailed Description

Macro Definition Documentation

◆ gdb_do_break

#define gdb_do_break ( )
Value:
do { \
} while(0)

Break into GDB, if present.

Enumeration Type Documentation

◆ GdbState

enum GdbState
Enumerator
eGDB_NotPresent 
eGDB_Detached 
eGDB_Attached 

Function Documentation

◆ debug_crash_callback()

void debug_crash_callback ( const struct rst_info *  rst_info,
uint32_t  stack,
uint32_t  stack_end 
)

◆ debug_print_stack()

void debug_print_stack ( uint32_t  start,
uint32_t  end 
)

Send a stack dump to debug output.

Parameters
startStart address to output
endOutput up to - but not including - this address

◆ gdb_detach()

void gdb_detach ( )

Detach from GDB, if attached.

Note
We send GDB an 'exit process' message

◆ gdb_enable()

void gdb_enable ( bool  state)

Dynamically enable/disable GDB stub.

Parameters
statetrue to enable, false to disable
Note
has no effect if gdbstub is not present

Calling with enable = false overrides configured behaviour as follows:

  • Debug exceptions will be silently ignored
  • System exceptions will cause a watchdog reset, as for GDBSTUB_BREAK_ON_EXCEPTION = 0
  • All incoming serial data is passed through to UART2 without inspection, as for GDBSTUB_CTRLC_BREAK = 0

◆ gdb_init()

void gdb_init ( void  )

Initialise GDB stub, if present.

Note
Called by framework at startup, but does nothing if gdbstub is not linked.

◆ gdb_on_attach()

void gdb_on_attach ( bool  attached)

Called from task queue when GDB attachment status changes.

Note
User can implement this function to respond to attachment changes

◆ gdb_present()

GdbState gdb_present ( void  )

Check if GDB stub is present.