Compare commits

...

3 Commits

Author SHA1 Message Date
Lephenixnoir 76c23b88ac Merge pull request 'A few fixes for the new bridge that make using the builtin GDB invocation a bit nicer' (#13) from redoste/fxsdk:gdb-bridge-fixes into dev
Reviewed-on: #13
2024-03-31 18:32:46 +02:00
redoste 4d664f9e05
gdb: ignore SIGINT from the bridge when gdb is in foreground
^C can be used within gdb to break a running target, handeling it from
the bridge would kill the connection
2024-03-31 18:31:27 +02:00
redoste d5697e6add
gdb: set architecture to sh4a-nofpu when starting gdb 2024-03-31 18:31:27 +02:00
1 changed files with 5 additions and 3 deletions

View File

@ -121,12 +121,14 @@ static pid_t fork_gdb(char **user_argv, char const *socket_path)
char target_command[256];
sprintf(target_command, "target remote %s", socket_path);
char **argv = malloc((n + 5) * sizeof *argv);
char **argv = malloc((n + 7) * sizeof *argv);
argv[0] = "sh-elf-gdb";
argv[1] = "-q";
argv[2] = "-ex";
argv[3] = target_command;
memcpy(argv+4, user_argv, (n+1) * sizeof *argv);
argv[4] = "-ex";
argv[5] = "set architecture sh4a-nofpu";
memcpy(argv+6, user_argv, (n+1) * sizeof *argv);
struct sigaction action = {
.sa_handler = SIGINT_SIGCHLD_handler,
@ -226,7 +228,7 @@ int main(int argc, char **argv)
goto end;
struct sigaction action = {
.sa_handler = SIGINT_SIGCHLD_handler,
.sa_handler = opts.bridge_only ? SIGINT_SIGCHLD_handler : SIG_IGN,
};
sigaction(SIGINT, &action, NULL);