On 07/25/2018 09:17 PM, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries writes: > > Tom> The patch fixes the segfault by returning an error in info_program_command > Tom> if get_last_target_status returns minus_one_ptid. > > Tom> The test-case is non-standard, because the standard approach runs into > Tom> PR23020, a problem with gdb going to the background. > > Is it possible to fix this part first? I've investigated a bit, but I think I need serious time to be able to fix this, I'm not familiar with the tty interface. > Otherwise it seems to me that the test case has some issues. > > Also, is the bug dependent on -batch? No, that's the way to run the test-case without running into PR23368 (gdb going to the background). > This wasn't clear to me, but I > guess if it is then the approach to the test case makes more sense. > > Tom> PR breakpoints/23366 > Tom> * infcmd.c (info_program_command): Handle ptid == minus_one_ptid. > > This part looks ok to me. > > Tom> +if { ![file exists /bin/bash] } { > ... > Tom> +if { ![file exists /bin/ls] } { > ... > Tom> + catch {exec /bin/bash -c "$GDB $FLAGS"} catchlog > I'm now using "remote_file target exists". > I think this sort of thing can't be done when doing remote host testing, > so some sort of check is needed for that. I don't remember any more > exactly how this is done but there should be other examples in the tree. > > Tom> +if { ![file exists /bin/bash] } { > Tom> + unsupported "no bash" > Tom> +} > > Also there has to be a "return" after the "unsupported"; unsupported > just logs a message and without the return, the rest of the test will > still be run. > Updated accordingly and committed as attached. Thanks, - Tom