This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] [2/7] infrun cleanup: miscellaneous cleanups
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- Date: Sun, 7 Dec 2008 01:23:40 +0000
- Subject: Re: [rfc] [2/7] infrun cleanup: miscellaneous cleanups
- References: <200812070017.mB70HagV018378@d12av02.megacenter.de.ibm.com>
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