This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFAv2] Fix internal error and improve 'set debug infrun 1'/target wait kind trace
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Date: Mon, 1 Apr 2019 09:32:48 -0700
- Subject: Re: [RFAv2] Fix internal error and improve 'set debug infrun 1'/target wait kind trace
- References: <20190330095831.5616-1-philippe.waroquiers@skynet.be>
On Sat, 30 Mar 2019 10:58:31 +0100
Philippe Waroquiers <philippe.waroquiers@skynet.be> wrote:
> The test gdb.threads/watchthreads-reorder.exp verifies that the
> 'set debug infrun 1' debug output does not crash GDB.
>
> Under high load, the test can still cause a GDB internal error (see details
> below).
>
> This patch fixes this crash, and improves/factorises some wait kind traces.
>
> Tested on debian/amd64 + run one test with 'set debug infrun 1'.
>
> Changes compared to the first version:
> * Handles the suggestions of Kevin to trace the relevant elements
> of the wait status (this is done by calling target_waitstatus_to_string).
> * Some other changes to factorise wait status tracing.
>
> Note that using target_waitstatus_to_string instead of the 'locally printed'
> status kind strings means that debug trace that was using strings such as:
> "EXITED" or "TARGET_WAITKIND_EXITED"
> will now use what is printed by target_waitstatus_to_string e.g.
> "exited".
>
> gdb/ChangeLog
> 2019-03-30 Philippe Waroquiers <philippe.waroquiers@skynet.be>
>
> * infrun.c (stop_all_threads): If debug_infrun, always
> trace the wait status after wait_one, using
> target_waitstatus_to_string and target_pid_to_str.
> (handle_inferior_event): Replace various trace of
> wait status kind by a single trace.
> * gdb/gnu-nat.c (gnu_nat_target::wait): Replace local
> wait status kind image by target_waitstatus_to_string.
> * target/waitstatus.c (target_waitstatus_to_string): Fix
> obsolete comment.
Okay.
Kevin