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
This commit is contained in:
Lephenixnoir 2024-03-31 18:32:46 +02:00
commit 76c23b88ac
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);