Browse Source

gdbstub: make immediate GDB stub entry optional

Add a Kconfig option to be able to postpone entering the GDB stub
until an external trigger.

Signed-off-by: Noah Klayman <noah.klayman@intel.com>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
pull/89914/merge
Noah Klayman 3 weeks ago committed by Dan Kalowsky
parent
commit
5882f01b51
  1. 7
      subsys/debug/gdbstub/Kconfig
  2. 2
      subsys/debug/gdbstub/gdbstub.c

7
subsys/debug/gdbstub/Kconfig

@ -42,4 +42,11 @@ config GDBSTUB_TRACE @@ -42,4 +42,11 @@ config GDBSTUB_TRACE
Enable extra debug logging for the GDB backend, including
breakpoint interrupts and remote commands it receives.
config GDBSTUB_ENTER_IMMEDIATELY
bool "Stop execution and enter the GDB stub at boot"
default y
help
Functions like QEMU's -S. If enabled, boot will halt before user code
starts execution and GDB stub will wait for connection.
endif # GDBSTUB

2
subsys/debug/gdbstub/gdbstub.c

@ -891,6 +891,7 @@ int gdb_init(void) @@ -891,6 +891,7 @@ int gdb_init(void)
return 0;
}
#ifdef CONFIG_GDBSTUB_ENTER_IMMEDIATELY
#ifdef CONFIG_XTENSA
/*
* Interrupt stacks are being setup during init and are not
@ -904,3 +905,4 @@ SYS_INIT(gdb_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); @@ -904,3 +905,4 @@ SYS_INIT(gdb_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#else
SYS_INIT(gdb_init, PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif
#endif

Loading…
Cancel
Save