Re: [PATCH v5] Fix crash in AIX when current working directory is NULL

Tom Tromey <[email protected]> Fri, 24 Jul 2026 07:25:17 -0600
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
>>>>> Aditya Vidyadhar Kamath <[email protected]> writes:

Sorry about this, but I didn't closely read the test in the earlier
reviews.

> +  /* Exec GDB.  */
> +  char **gdb_args = malloc ((argc - 1) * sizeof (char *));
> +  gdb_args[0] = (char *) gdb_path;
> +  for (int i = 3; i < argc; i++)
> +    gdb_args[i - 2] = argv[i];
> +  gdb_args[argc - 2] = NULL;

execing gdb seems problematic, for instance with a cross build gdb won't
be the same host architecture as this test program.

Is it not possible to start gdb, change its directory, and then remove
the working directory from the .exp file?

Tom