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: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 16 Sep 2013 09:18:02 +0000
- 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>
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Jan Kratochvil
> > +/* The to_store_registers method of target record-btrace. */
> > +
> > +static void
> > +record_btrace_store_registers (struct target_ops *ops,
> > + struct regcache *regcache, int regno) {
> > + struct target_ops *t;
> > +
> > + if (record_btrace_is_replaying ())
> > + return;
>
> Currently I get:
> (gdb) p $rax
> $1 = <unavailable>
> (gdb) p $rax=1
> $2 = <unavailable>
>
> I would find more appropriate an error() here so that we get:
> (gdb) p $rax
> $1 = <unavailable>
> (gdb) p $rax=1
> Some error message.
>
> With gdbserver trace one gets:
> (gdb) print globalc
> $1 = <unavailable>
> (gdb) print globalc=1
> Cannot access memory at address 0x602120 which is not so
> convenient as it comes from gdbserver E01 response:
> gdb_write_memory -> if (current_traceframe >= 0) return EIO; as I checked.
OK. I added an error message for the to_store_registers method.
> > +
> > + 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.
Regards,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052