Michael Snyder | 1 Nov 02:15 2009

[RFA] Fix hw watchpoints in process record.

Here is a patch to make hardware watchpoints work in precord.

Biggest change is in breakpoint.c, but it's mainly mechanical.
I abstracted most of the function "watchpoint_check" into a
separate function so it could be called from two places.

Then in record_wait, if not replay mode we call
target_stopped_by_watchpoint to see if a watchpoint
was triggered.  In replay mode we call the new function
hw_watchpoint_check.

2009-10-31  Michael Snyder  <msnyder <at> vmware.com>
	Make hardware watchpoints work for process record.
	* breakpoint.c (watchpoint_check_1): Abstracted from watchpoint_check.
	(watchpoint_check_2): Check_error entry point for above.
	(watchpoint_check): Call watchpoint_check_1.
	(hw_watchpoint_check): New function.  Return true if 
	a hardware watchpoint expression has changed.
	* breakpoint.h (hw_watchpoint_check): Export.

	* record.c (record_beneath_to_stopped_by_watchpoint): New pointer.
	(record_open): Initialize above pointer.
	(record_stopped_by_watchpoint): New target method.
	(record_wait): Check to see if hitting hardware watchpoint.

Index: gdb/breakpoint.c
===================================================================
--- gdb.orig/breakpoint.c	2009-10-31 17:31:15.000000000 -0700
(Continue reading)

Hui Zhu | 1 Nov 10:54 2009
Picon

Re: [RFA, 3 of 3] save/restore process record, part 3 (save/restore)

Cool.  Sorry I forgot this thread.  Thanks a lot.

Hui

On Sat, Oct 31, 2009 at 22:57, Pedro Alves <pedro <at> codesourcery.com> wrote:
> On Friday 23 October 2009 15:54:11, Pedro Alves wrote:
>> On Friday 23 October 2009 15:42:00, Hui Zhu wrote:
>> >    if (record_debug)
>> >      printf_filtered ("\
>>
>> All debug output should go to fprintf_unfiltered (gdb_stdlog, ...
>> not printf_filtered.
>>
>
> Applied.
>
> --
> Pedro Alves
>
> 2009-10-31  Pedro Alves  <pedro <at> codesourcery.com>
>
>        * record.c (record_restore, cmd_record_save): Debug output goes to
>        gdb_stdlog.
>
> ---
>  gdb/record.c |   87 +++++++++++++++++++++++++++++------------------------------
>  1 file changed, 44 insertions(+), 43 deletions(-)
>
> Index: src/gdb/record.c
> ===================================================================
(Continue reading)

Michael Snyder | 1 Nov 19:19 2009

Re: [RFA] comment looks wrong...

Daniel Jacobowitz wrote:
> On Wed, Oct 28, 2009 at 12:23:11PM -0700, Michael Snyder wrote:
>> The comment in findvar about extract_*_integer looked wrong to me,
>> with respect to target vs. host.  If I'm right, this is an improvement,
>> but if I'm confused, then so are these comments.   ;-/
> 
> It's some subject/object fuzziness, I think.
> 
>> -/* Basic byte-swapping routines.  GDB has needed these for a long time...
>> -   All extract a target-format integer at ADDR which is LEN bytes long.  */
>> +/* Basic byte-swapping routines.  GDB has needed these for a long
>> +   time...  All 'extract' functions extract a host-format integer at
>> +   ADDR which is LEN bytes long.  */
> 
> Which do you extract - the value being read or the value being
> returned?  It means the value being read, which is in target format.
> 

Does that mean you don't favor changing it?

Daniel Jacobowitz | 1 Nov 20:33 2009

Re: [RFA] comment looks wrong...

On Sun, Nov 01, 2009 at 10:19:56AM -0800, Michael Snyder wrote:
> Does that mean you don't favor changing it?

Your new formulation uses the opposite meaning of extract to the one
presently there.  If the old one was unclear, the new one is unclear
also...

--

-- 
Daniel Jacobowitz
CodeSourcery

Vladimir Prus | 1 Nov 20:55 2009

Re: [RFC, doc] Fix -stack-list-arguments parameter description

On Friday 30 October 2009 Eli Zaretskii wrote:

> > From: Vladimir Prus <vladimir <at> codesourcery.com>
> > Date: Fri, 30 Oct 2009 20:38:28 +0300
> > 
> > Current docs for -stack-list-arguments fails to document the '2'
> > value of the 'show-values' parameter. This patch fixes that, while
> > making the naming of parameter consistent with -stack-list-locals
> > and -stack-list-variables. OK?
> 
> Yes, thanks.  One small request, though:
> 
> > +If  <at> var{print-values} is 0 or  <at> code{--no-values}, print only the names of
> > +the variables; if it is 1 or  <at> code{--all-values}, print also their
> > +values; and if it is 2 or  <at> code{--simple-values}, print the name,
> > +type and value for simple data types and the name and type for arrays,
> > +structures and unions.              ^
> 
> Please add a comma where shown.

Thanks. I've checked in the below. Because this text is the same for 
-stack-list-arguments, -stack-list-locals and -stack-list-variables,
I have added comas there as well.

- Volodya

> 
Attachment (final.diff): text/x-patch, 3090 bytes
Eli Zaretskii | 1 Nov 21:01 2009
Picon

Re: [RFC, doc] Fix -stack-list-arguments parameter description

> From: Vladimir Prus <vladimir <at> codesourcery.com>
> Date: Sun, 1 Nov 2009 22:55:40 +0300
> Cc: gdb-patches <at> sources.redhat.com
> 
> Thanks. I've checked in the below. Because this text is the same for 
> -stack-list-arguments, -stack-list-locals and -stack-list-variables,
> I have added comas there as well.

Thank you.

Michael Snyder | 1 Nov 21:38 2009

Re: [RFA] comment looks wrong...

Daniel Jacobowitz wrote:
> On Sun, Nov 01, 2009 at 10:19:56AM -0800, Michael Snyder wrote:
>> Does that mean you don't favor changing it?
> 
> Your new formulation uses the opposite meaning of extract to the one
> presently there.  If the old one was unclear, the new one is unclear
> also...
> 

Fair enough -- how's this?

2009-10-28  Michael Snyder  <msnyder <at> vmware.com>

        * findvar.c (top level): Fix and add comments.

Index: gdb/findvar.c
===================================================================
--- gdb.orig/findvar.c	2009-10-28 12:33:28.000000000 -0700
+++ gdb/findvar.c	2009-11-01 12:37:26.000000000 -0800
 <at>  <at>  -36,8 +36,9  <at>  <at> 
 #include "block.h"
 #include "objfiles.h"

-/* Basic byte-swapping routines.  GDB has needed these for a long time...
-   All extract a target-format integer at ADDR which is LEN bytes long.  */
+/* Basic byte-swapping routines.  GDB has needed these for a long
+   time...  All 'extract' functions return a host-format integer
+   from a target-format integer ADDR which is LEN bytes long.  */
(Continue reading)

Michael Snyder | 1 Nov 21:55 2009

[RFA] NEWS: mention record save/restore

gmane.comp.gdb.patches
2009-11-01  Michael Snyder  <msnyder <at> vmware.com>

	* NEWS (New Commands): Mention record save/restore.

Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.336
diff -u -p -r1.336 NEWS
--- NEWS	28 Oct 2009 15:01:27 -0000	1.336
+++ NEWS	1 Nov 2009 20:54:26 -0000
 <at>  <at>  -24,6 +24,14  <at>  <at>  Xilinx MicroBlaze		microblaze

 * New commands (for set/show, see "New options" below)

+record save [<FILENAME>]
+  Save a file (in core file format) containing the process record 
+  execution log for replay debugging at a later time.
+
+record restore <FILENAME>
+  Restore the process record execution log that was saved at an
+  earlier time, for replay debugging.
+
 add-inferior [-copies <N>] [-exec <FILENAME>]
   Add a new inferior.

Michael Snyder | 1 Nov 22:13 2009

[RFA] replay bookmarks

Here's a first cut at the "bookmark" functionality discussed earlier.

This should be target-agnostic -- I've added two target methods,
to_get_bookmark and to_goto_bookmark.  For remote targets, we use
q/Q query syntax.

Seems to work well in process record.

Summary:
   bookmark (no argument)
     Save a reference to the current position in the replay log.
     Doesn't care whether replay log is precord or arbitrary remote
     target.
   delete bookmark <N>
     Delete the bookmark numbered N (just like breakpoint numbers)
   goto-bookmark <N>
     Return the replay log to the state of the bookmark numbered N.
   info bookmarks
     List bookmarks.

Bookmarks are saved internally in the form of a string, which is
provided by and returned to the target.

There is a back-door -- if the user understands the format of
the string that is used by the target to represent bookmarks,
he can supply a quoted string (single or double quotes) eg.:

   (gdb) bookmark '12345'

which will be passed along to the target, even if no corresponding
(Continue reading)

Eli Zaretskii | 1 Nov 22:18 2009
Picon

Re: [RFA] NEWS: mention record save/restore

> Date: Sun, 01 Nov 2009 12:55:34 -0800
> From: Michael Snyder <msnyder <at> vmware.com>
> 
> 2009-11-01  Michael Snyder  <msnyder <at> vmware.com>
> 
> 	* NEWS (New Commands): Mention record save/restore.
> 
> Index: NEWS
> ===================================================================
> RCS file: /cvs/src/src/gdb/NEWS,v
> retrieving revision 1.336
> diff -u -p -r1.336 NEWS
> --- NEWS	28 Oct 2009 15:01:27 -0000	1.336
> +++ NEWS	1 Nov 2009 20:54:26 -0000
>  <at>  <at>  -24,6 +24,14  <at>  <at>  Xilinx MicroBlaze		microblaze
>  
>  * New commands (for set/show, see "New options" below)
>  
> +record save [<FILENAME>]
> +  Save a file (in core file format) containing the process record 
> +  execution log for replay debugging at a later time.
> +
> +record restore <FILENAME>
> +  Restore the process record execution log that was saved at an
> +  earlier time, for replay debugging.
> +
>  add-inferior [-copies <N>] [-exec <FILENAME>]
>    Add a new inferior.

This is fine, thanks.
(Continue reading)


Gmane