[PATCH v2 3/3] btrace: pretend we're not replaying when generating a core file

Pedro Alves palves@redhat.com
Tue Jun 24 13:19:00 GMT 2014


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



More information about the Gdb-patches mailing list