This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][gdb/breakpoints] Fix sigsegv in info prog at exec catchpoint


>>>>> "Tom" == Tom de Vries <tdevries@suse.de> 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?
Otherwise it seems to me that the test case has some issues.

Also, is the bug dependent on -batch?  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 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.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]