Skip to content

Conversation

@rasky
Copy link
Collaborator

@rasky rasky commented Oct 14, 2024

When debugging homebrew with gdb, it might be annoying if gdb stops at exceptions that are correctly handled by the running application. This is a bit hard to know so, besides providing some (debatable) default, we need a way to selectively ignore specific exceptions.

This commit generates different GDB signals for different families of exceptions. The mapping between MIPS exceptions and UNIX signals is completely arbitrary; it tries to "sort of" match the meaning of the exception where possible, and otherwise just use a random signal.

The GDB client can configure which signals should be logged, which should cause the application to stop, and which should be ignored, using the "handle" command.

By default, we want to ignore exceptions generated by interrupts (as those are normally handled by the application) and those handled by the operating system (like the COP1 exception which both libultra and libdragon use to speed up context switching). To do so, we assign to them signals that are ignored by default by gdb (SIGWINCH and SIGURG respectively).

When debugging homebrew with gdb, it might be annoying if gdb stops
at exceptions that are correctly handled by the running application.
This is a bit hard to know so, besides providing some (debatable)
default, we need a way to selectively ignore specific exceptions.

This commit generates different GDB signals for different families of
exceptions. The mapping between MIPS exceptions and UNIX signals is
completely arbitrary; it tries to "sort of" match the meaning of the
exception where possible, and otherwise just use a random signal.

The GDB client can configure which signals should be logged, which
should cause the application to stop, and which should be ignored,
using the "handle" command.

By default, we want to ignore exceptions generated by interrupts (as
those are normally handled by the application) and those handled by
the operating system (like the COP1 exception which both libultra
and libdragon use to speed up context switching). To do so, we
assign to them signals that are ignored by default by gdb (SIGWINCH
and SIGURG respectively).
@LukeUsher LukeUsher merged commit d99b0a3 into ares-emulator:master Oct 16, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants