Skip to content

Conversation

lyakh
Copy link
Contributor

@lyakh lyakh commented Aug 15, 2025

If the GDB stub is enabled the exception handler will jump to the GDB stub to allow remote GDB debugging.

@zephyrbot zephyrbot added the area: Xtensa Xtensa Architecture label Aug 15, 2025
Copy link
Member

@dcpleung dcpleung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be guarded behind a kconfig as this changes existing behavior.

@lyakh
Copy link
Contributor Author

lyakh commented Aug 18, 2025

I think this should be guarded behind a kconfig as this changes existing behavior.

@dcpleung it is already behind a Kconfig, so you think that CONFIG_GDBSTUB isn't enough - just enabling the GDB stub shouldn't yet mean, that we want to start it if an exception occurs and we need a finer grained control over this, i.e. an additional Kconfig? Can be done, sure

@dcpleung
Copy link
Member

I think it is a good idea that this behavior has to be turned on explicitly and does not only rely on GDB stub being enabled. An app can override the default exception handling and can recover from it (like in some tests). If this code jumps directly to GDB stub, it will look like it's spinning forever to the developer and the exception not being handled. That's why I think it is a good idea to guard it with kconfig, so that the current behavior is preserved.

If the GDB stub is enabled the exception handler will jump to the GDB
stub to allow remote GDB debugging.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
@lyakh
Copy link
Contributor Author

lyakh commented Aug 19, 2025

I think it is a good idea that this behavior has to be turned on explicitly and does not only rely on GDB stub being enabled. An app can override the default exception handling and can recover from it (like in some tests). If this code jumps directly to GDB stub, it will look like it's spinning forever to the developer and the exception not being handled. That's why I think it is a good idea to guard it with kconfig, so that the current behavior is preserved.

@dcpleung ok, you mean a dedicated Kconfig. No problem, added

Copy link

@kartben kartben merged commit 414ede3 into zephyrproject-rtos:main Aug 21, 2025
30 checks passed
@lyakh lyakh deleted the gdb branch August 21, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Xtensa Xtensa Architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants