Skip to content

Commit

Permalink
gdbstub: Expose TARGET_SIGTRAP in a target-agnostic way
Browse files Browse the repository at this point in the history
The upcoming syscall catchpoint support needs to send SIGTRAP stop
packets to GDB. Being able to compile this support only once for all
targets is a good thing, and it requires hiding TARGET_SIGTRAP behind
a function call.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20240202152506.279476-2-iii@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240207163812.3231697-11-alex.bennee@linaro.org>
  • Loading branch information
iii-i authored and stsquad committed Feb 9, 2024
1 parent 2df1eb2 commit 4aad096
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions gdbstub/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ void gdb_append_thread_id(CPUState *cpu, GString *buf);
int gdb_get_cpu_index(CPUState *cpu);
unsigned int gdb_get_max_cpus(void); /* both */
bool gdb_can_reverse(void); /* softmmu, stub for user */
int gdb_target_sigtrap(void); /* user */

void gdb_create_default_process(GDBState *s);

Expand Down
5 changes: 5 additions & 0 deletions gdbstub/user-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,8 @@ void gdb_handle_query_xfer_exec_file(GArray *params, void *user_ctx)
ts->bprm->filename + offset);
gdb_put_strbuf();
}

int gdb_target_sigtrap(void)
{
return TARGET_SIGTRAP;
}

0 comments on commit 4aad096

Please sign in to comment.