gdb: set architecture to sh4a-nofpu when starting gdb

This commit is contained in:
redoste 2024-03-31 18:23:19 +02:00
parent e847ad3f6e
commit d5697e6add
Signed by: redoste
SSH Key Fingerprint: SHA256:Y1z/cbVN8OVoFPXzVgklSqoZnyQQ/PQM8YwhMtxMk90
1 changed files with 4 additions and 2 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,