This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch v4 11/24] record-btrace: supply register target methods
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sun, 22 Sep 2013 15:55:27 +0200
- Subject: Re: [patch v4 11/24] record-btrace: supply register target methods
- Authentication-results: sourceware.org; auth=none
- References: <1372842874-28951-1-git-send-email-markus dot t dot metzger at intel dot com> <1372842874-28951-12-git-send-email-markus dot t dot metzger at intel dot com> <20130818190727 dot GI24153 at host2 dot jankratochvil dot net> <A78C989F6D9628469189715575E55B230A9CE9AC at IRSMSX104 dot ger dot corp dot intel dot com>
On Mon, 16 Sep 2013 11:18:02 +0200, Metzger, Markus T wrote:
> OK. I added an error message for the to_store_registers method.
OK:
(gdb) p $rax=1
This record target does not allow writing registers.
> > > +
> > > + if (may_write_registers == 0)
> > > + error (_("Writing to registers is not allowed (regno %d)"),
> > > + regno);
> >
> > Here should be rather:
> > gdb_assert (may_write_registers == 0);
> >
> > as target_store_registers() would not pass the call here otherwise.
>
> I took this from target_store_registers in target.c.
But that is a different case. The case 'may_write_registers == 0' is always
already caught by target_store_registers(). record_btrace_store_registers()
gets called only by target_store_registers() which already verified the
variable is not zero.
Thanks,
Jan