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: [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
anywhere else.

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 ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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