This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 3/3] btrace: pretend we're not replaying when generating a core file
- From: Pedro Alves <palves at redhat dot com>
- To: Markus Metzger <markus dot t dot metzger at intel dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 24 Jun 2014 14:19:49 +0100
- Subject: Re: [PATCH v2 3/3] btrace: pretend we're not replaying when generating a core file
- Authentication-results: sourceware.org; auth=none
- References: <1403599872-25299-1-git-send-email-markus dot t dot metzger at intel dot com> <1403599872-25299-3-git-send-email-markus dot t dot metzger at intel dot com>
Hi Markus,
On 06/24/2014 09:51 AM, Markus Metzger wrote:
> When generating a core file using the "generate-core-file" command while
> replaying with the btrace record target, we won't be able to access all
> registers and all memory. This leads to an assertion.
Please paste the gdb output showing the assertion in question here in
the commit log for future reference.
> Pretend that we are not replaying while generating a core file. This will
> forward fetch and store registers as well as xfer memory calls to the target
> beneath.
>
> +/* The to_prepare_to_generate_core target method. */
> +
> +static void
> +record_btrace_prepare_to_generate_core (struct target_ops *self)
> +{
> + record_btrace_generating_corefile = 1;
> +}
> +
> +/* The to_done_generating_core target method. */
> +
> +static void
> +record_btrace_done_generating_core (struct target_ops *self)
> +{
> + record_btrace_generating_corefile = 0;
This flag should also be cleared in record_btrace_open,
in case the target was previously abruptly closed between
the record_btrace_prepare_to_generate_core
and record_btrace_done_generating_core calls.
OK with that change.
Thank you.
--
Pedro Alves