[PATCH v4 06/10] python: Add clear() to gdb.Record.

Willgerodt, Felix felix.willgerodt@intel.com
Tue May 10 13:42:49 GMT 2022


> -----Original Message-----
> From: Eli Zaretskii <eliz@gnu.org>
> Sent: Freitag, 6. Mai 2022 13:51
> To: Willgerodt, Felix <felix.willgerodt@intel.com>
> Cc: Metzger, Markus T <markus.t.metzger@intel.com>; gdb-
> patches@sourceware.org
> Subject: Re: [PATCH v4 06/10] python: Add clear() to gdb.Record.
> 
> > Date: Fri,  6 May 2022 13:40:06 +0200
> > From: Felix Willgerodt via Gdb-patches <gdb-patches@sourceware.org>
> >
> > This function allows to clear the trace data from python, forcing to
> > re-decode the trace for successive commands.
> > ---
> >  gdb/doc/python.texi                           |  5 +++++
> >  gdb/python/py-record-btrace.c                 | 13 +++++++++++++
> >  gdb/python/py-record-btrace.h                 |  3 +++
> >  gdb/python/py-record.c                        | 16 ++++++++++++++++
> >  gdb/testsuite/gdb.python/py-record-btrace.exp |  6 +++++-
> >  5 files changed, 42 insertions(+), 1 deletion(-)
> >
> > diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
> > index 142dbc719a4..707aa5c3ee3 100644
> > --- a/gdb/doc/python.texi
> > +++ b/gdb/doc/python.texi
> > @@ -3779,6 +3779,11 @@ A @code{gdb.Record} object has the following
> methods:
> >  Move the replay position to the given @var{instruction}.
> >  @end defun
> >
> > +@defun Record.clear ()
> > +Clear the trace data of the current recording.  This forces re-decoding of
> the
> > +trace for successive commands.
> > +@end defun
> 
> What does "force re-decoding" mean here? 

The recorded instructions and pt packets will be discarded. "Re-decoding"
means that the pt buffer will be re-read and re-decoded by GDB/libipt
into a new instruction history.

> If this is described in
> another place in the manual, could you add a cross-reference to that
> place?
> 

I don't think it has been described yet, as clear() hasn't directly been exposed
before, only indirectly e.g. via "record stop". The "trace" is however
mentioned e.g. here for "record btrace pt":
https://sourceware.org/gdb/onlinedocs/gdb/Process-Record-and-Replay.html

Should I link that?

Thanks,
Felix






Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


More information about the Gdb-patches mailing list