This is the mail archive of the
mailing list for the GDB project.
Re: [rfc] Fix PR 2250 - multithreaded single-step problems in all-stop mode
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: pedro at codesourcery dot com (Pedro Alves)
- Cc: gdb-patches at sourceware dot org, drow at false dot org
- Date: Mon, 17 Nov 2008 21:30:05 +0100 (CET)
- Subject: Re: [rfc] Fix PR 2250 - multithreaded single-step problems in all-stop mode
Pedro Alves wrote:
> I don't think there's any reason to keep random_signal
> untouched across handle_inferior_event invocations in the while (1)
> loop in wait_for_inferior ? --- handle_inferior_event seems
> to set or clear it itself before relying on its value, but I wouldn't
> be that surprised there's a weird twisted code path where that isn't
> happening, and we could be reading a random_signal from a previous stop.
> Maybe moving the memset to inside the while (1) loop in
> wait_for_inferior would make things a bit clearer (if my reasoning
> about random_signal not being needed across events is correct).
I agree that random_signal need not survive beyond a handling of a
single event. In fact, I think random_signal should probably simply
be a local variable of handle_inferior_event; it's not accessed
In fact other members of the ecs struct should probably be
local variables, maybe some of them passed explicitly to
subroutines. I think this would help simplify understanding
the data-flow along handle_inferior_event and its subroutines ...
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE