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] [2/7] infrun cleanup: miscellaneous cleanups


On Sunday 07 December 2008 00:17:36, Ulrich Weigand wrote:
>   This patch changes wait_for_inferior to *always* invalidate
>   registers (and overlay cache state) before every call to target_wait,
>   and removes this from prepare_to_wait and handle_inferior_event.

I welcome this bit in particular very much.  I know I was confused
by this when I first learnt about expedite registers.

> * fetch_inferior_event uses the contents of ecs->ptid and
>   ecs->event_thread after handle_inferior_event returns.  As later
>   patches will remove those fields, I've replaced them with accessing
>   the current inferior -- just like normal_stop, which is called
>   by fetch_inferior_event anyway, does as well.

Yes, but not through current_inferior.

On Sunday 07 December 2008 00:17:36, Ulrich Weigand wrote:
> ? ?if (!ecs->wait_some_more)
> ? ? ?{
> - ? ? ?struct inferior *inf = find_inferior_pid (ptid_get_pid (ecs->ptid));
> + ? ? ?struct inferior *inf = current_inferior ();
> ?

Please change this bit to:

-      struct inferior *inf = find_inferior_pid (ptid_get_pid (ecs->ptid));
+      struct inferior *inf = find_inferior_pid (ptid_get_pid (inferior_ptid));

Although inferior_ptid is pointing ecs->ptid at this point,
current_inferior asserts if the inferior is not listed, which does happen today.
See this just below:

     /* We may not find an inferior if this was a process exit.  */
      if (inf == NULL || inf->stop_soon == NO_STOP_QUIETLY)
	normal_stop ();

I've got  patches that fix the targets to not do that, so I can
revisit this bit by then.

-- 
Pedro Alves


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