This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [patch v4 11/24] record-btrace: supply register target methods


> -----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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]