This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/commit 3/3] fix internal_error during fork event handling.
- From: Pedro Alves <palves at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Thu, 26 Jul 2012 17:08:54 +0100
- Subject: Re: [RFA/commit 3/3] fix internal_error during fork event handling.
- References: <1339698545-13126-1-git-send-email-brobecker@adacore.com> <1339698545-13126-4-git-send-email-brobecker@adacore.com> <4FE33BEE.7090306@redhat.com> <20120621211827.GH2799@adacore.com>
On 06/21/2012 10:18 PM, Joel Brobecker wrote:
> Here is what happens:
> 1. GDB receives a "fork" event;
> 2. handle_inferior_event calls detach_breakpoints for the child process;
> 3. detach_breakpoints calls ia64's gdbarch remove_breakpoint hook,
> which needs to read an entire instruction slot in order to remove
> a breakpoint instruction from memory;
> 4. To read inferior memory, the ia64-hpux code needs to know where
> that memory is located relative to the bsp..bspstore area,
> and thus needs to read the value of those registers;
> 5. To get the value of those registers, ia64_hpux_xfer_memory current
> uses the current regcache.
>
> The problem is taht at the time we are trying to remove the breakpoints
Typo "that".
> from the child, the child process is not part of the list of inferiors
> really known to GDB (it has not been added to inferior_list), and there
> is therefore no regcache for that process. This is what triggers the
> internal error.
The text for the commit log should be updated too (if that's what
this is). I suggest replacing
and there is therefore no regcache for that process
with something like
and so trying to create a regcache for it internal errors when creating an
address space for the regcache (as the address space is ultimately fetched
from the inferior.
Thanks.
--
Pedro Alves