Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix info tracepoints, etc
@ 2010-04-03  3:01 Stan Shebs
  2010-04-03  7:38 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Stan Shebs @ 2010-04-03  3:01 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1817 bytes --]

Originally just a simple fix to make "info tracepoints" display only 
tracepoints, it's grown a bit. :-) The key change is to pass an optional 
filter function to breakpoint_1, which has a nice bonus of letting "info 
watchpoints" being the only-watchpoints lister that it was always 
supposed to be - which then requires doc and testsuite changes.  I also 
took the opportunity of merging the duplicate tracepoint predicates that 
found their way into the code, plus there's now a warning that 
tracepoints don't do ignore counts.

Stan

2010-04-02  Stan Shebs  <stan@codesourcery.com>
        Nathan Sidwell  <nathan@codesourcery.com>

    * breakpoint.c (breakpoint_1): Add filter argument, return number of
    breakpoints printed.
    (is_hardware_watchpoint): Make argument const.
    (is_watchpoint): Ditto.
    (is_tracepoint): Merge of tracepoint_type and breakpoint_is_tracepoint,
    use it everywhere.
    (breakpoints_info): Pass NULL to breakpoint_1.
    (maintenance_info_breakpoints): Ditto.
    (watchpoints_info): New function.
    (tracepoints_info): Use breakpoint_1 filter.
    (set_ignore_count): Warn that tracepoint ignore count will be ignored.
    (_initialize_breakpoint): Make "info watchpoints" its own command.
    * breakpoint.h (is_tracepoint): Rename from breakpoint_is_tracepoint.
    * mi/mi-cmd-break.c (mi_cmd_break_commands): Use is_tracepoint.

    * gdb.texinfo (Setting Breakpoints): "info watch" no longer a synonym.
    (Setting Watchpoints): Update description of "info watch".
    (Disabling Breakpoints): Only "info break" lists all.

    * gdb.base/completion.exp: Update for new "info watchpoints".
    * gdb.base/default.exp: Ditto.
    * gdb.base/help.exp: Ditto.
    * gdb.base/watchpoint.exp: Ditto.
    * gdb.trace/infotrace.exp: Update "info tracpoints" output.


[-- Attachment #2: infotrace-patch-1 --]
[-- Type: text/plain, Size: 26590 bytes --]

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.475
diff -p -r1.475 breakpoint.c
*** breakpoint.c	2 Apr 2010 01:18:35 -0000	1.475
--- breakpoint.c	3 Apr 2010 02:48:15 -0000
*************** static int watchpoint_locations_match (s
*** 130,136 ****
  
  static void breakpoints_info (char *, int);
  
! static void breakpoint_1 (int, int);
  
  static bpstat bpstat_alloc (const struct bp_location *, bpstat);
  
--- 130,138 ----
  
  static void breakpoints_info (char *, int);
  
! static void watchpoints_info (char *, int);
! 
! static int breakpoint_1 (int, int, int (*) (const struct breakpoint *));
  
  static bpstat bpstat_alloc (const struct bp_location *, bpstat);
  
*************** static void update_global_location_list 
*** 204,212 ****
  
  static void update_global_location_list_nothrow (int);
  
! static int is_hardware_watchpoint (struct breakpoint *bpt);
  
! static int is_watchpoint (struct breakpoint *bpt);
  
  static void insert_breakpoint_locations (void);
  
--- 206,214 ----
  
  static void update_global_location_list_nothrow (int);
  
! static int is_hardware_watchpoint (const struct breakpoint *bpt);
  
! static int is_watchpoint (const struct breakpoint *bpt);
  
  static void insert_breakpoint_locations (void);
  
*************** static int overlay_events_enabled;
*** 366,372 ****
  
  #define ALL_TRACEPOINTS(B)  \
    for (B = breakpoint_chain; B; B = B->next)  \
!     if (tracepoint_type (B))
  
  /* Chains of all breakpoints defined.  */
  
--- 368,374 ----
  
  #define ALL_TRACEPOINTS(B)  \
    for (B = breakpoint_chain; B; B = B->next)  \
!     if (is_tracepoint (B))
  
  /* Chains of all breakpoints defined.  */
  
*************** clear_breakpoint_hit_counts (void)
*** 464,477 ****
      b->hit_count = 0;
  }
  
- /* Encapsulate tests for different types of tracepoints.  */
- 
- static int
- tracepoint_type (const struct breakpoint *b)
- {
-   return (b->type == bp_tracepoint || b->type == bp_fast_tracepoint);
- }
-   
  /* Allocate a new counted_command_line with reference count of 1.
     The new structure owns COMMANDS.  */
  
--- 466,471 ----
*************** check_no_tracepoint_commands (struct com
*** 817,836 ****
      }
  }
  
  int
! breakpoint_is_tracepoint (const struct breakpoint *b)
  {
!   switch (b->type)
!     {
!     case bp_tracepoint:
!     case bp_fast_tracepoint:
!       return 1;
!     default:
!       return 0;
! 
!     }
  }
! 
  /* A helper function that validsates that COMMANDS are valid for a
     breakpoint.  This function will throw an exception if a problem is
     found.  */
--- 811,824 ----
      }
  }
  
+ /* Encapsulate tests for different types of tracepoints.  */
+ 
  int
! is_tracepoint (const struct breakpoint *b)
  {
!   return (b->type == bp_tracepoint || b->type == bp_fast_tracepoint);
  }
!   
  /* A helper function that validsates that COMMANDS are valid for a
     breakpoint.  This function will throw an exception if a problem is
     found.  */
*************** static void
*** 839,845 ****
  validate_commands_for_breakpoint (struct breakpoint *b,
  				  struct command_line *commands)
  {
!   if (breakpoint_is_tracepoint (b))
      {
        /* We need to verify that each top-level element of commands
  	 is valid for tracepoints, that there's at most one while-stepping
--- 827,833 ----
  validate_commands_for_breakpoint (struct breakpoint *b,
  				  struct command_line *commands)
  {
!   if (is_tracepoint (b))
      {
        /* We need to verify that each top-level element of commands
  	 is valid for tracepoints, that there's at most one while-stepping
*************** do_map_commands_command (struct breakpoi
*** 949,955 ****
  
  	  l = read_command_lines (str,
  				  info->from_tty, 1,
! 				  (breakpoint_is_tracepoint (b)
  				   ? check_tracepoint_command : 0),
  				  b);
  
--- 937,943 ----
  
  	  l = read_command_lines (str,
  				  info->from_tty, 1,
! 				  (is_tracepoint (b)
  				   ? check_tracepoint_command : 0),
  				  b);
  
*************** insert_catchpoint (struct ui_out *uo, vo
*** 1175,1181 ****
  /* Return true if BPT is of any hardware watchpoint kind.  */
  
  static int
! is_hardware_watchpoint (struct breakpoint *bpt)
  {
    return (bpt->type == bp_hardware_watchpoint
  	  || bpt->type == bp_read_watchpoint
--- 1163,1169 ----
  /* Return true if BPT is of any hardware watchpoint kind.  */
  
  static int
! is_hardware_watchpoint (const struct breakpoint *bpt)
  {
    return (bpt->type == bp_hardware_watchpoint
  	  || bpt->type == bp_read_watchpoint
*************** is_hardware_watchpoint (struct breakpoin
*** 1186,1192 ****
     software.  */
  
  static int
! is_watchpoint (struct breakpoint *bpt)
  {
    return (is_hardware_watchpoint (bpt)
  	  || bpt->type == bp_watchpoint);
--- 1174,1180 ----
     software.  */
  
  static int
! is_watchpoint (const struct breakpoint *bpt)
  {
    return (is_hardware_watchpoint (bpt)
  	  || bpt->type == bp_watchpoint);
*************** should_be_inserted (struct bp_location *
*** 1589,1595 ****
  
    /* Tracepoints are inserted by the target at a time of its choosing,
       not by us.  */
!   if (tracepoint_type (bpt->owner))
      return 0;
  
    return 1;
--- 1577,1583 ----
  
    /* Tracepoints are inserted by the target at a time of its choosing,
       not by us.  */
!   if (is_tracepoint (bpt->owner))
      return 0;
  
    return 1;
*************** bpstat_check_location (const struct bp_l
*** 3733,3739 ****
  
    /* By definition, the inferior does not report stops at
       tracepoints.  */
!   if (tracepoint_type (b))
      return 0;
  
    if (b->type != bp_watchpoint
--- 3721,3727 ----
  
    /* By definition, the inferior does not report stops at
       tracepoints.  */
!   if (is_tracepoint (b))
      return 0;
  
    if (b->type != bp_watchpoint
*************** print_one_breakpoint_location (struct br
*** 4788,4794 ****
           because the condition is an internal implementation detail
           that we do not want to expose to the user.  */
        annotate_field (7);
!       if (tracepoint_type (b))
  	ui_out_text (uiout, "\ttrace only if ");
        else
  	ui_out_text (uiout, "\tstop only if ");
--- 4776,4782 ----
           because the condition is an internal implementation detail
           that we do not want to expose to the user.  */
        annotate_field (7);
!       if (is_tracepoint (b))
  	ui_out_text (uiout, "\ttrace only if ");
        else
  	ui_out_text (uiout, "\tstop only if ");
*************** user_settable_breakpoint (const struct b
*** 4968,4974 ****
    return (b->type == bp_breakpoint
  	  || b->type == bp_catchpoint
  	  || b->type == bp_hardware_breakpoint
! 	  || tracepoint_type (b)
  	  || b->type == bp_watchpoint
  	  || b->type == bp_read_watchpoint
  	  || b->type == bp_access_watchpoint
--- 4956,4962 ----
    return (b->type == bp_breakpoint
  	  || b->type == bp_catchpoint
  	  || b->type == bp_hardware_breakpoint
! 	  || is_tracepoint (b)
  	  || b->type == bp_watchpoint
  	  || b->type == bp_read_watchpoint
  	  || b->type == bp_access_watchpoint
*************** user_settable_breakpoint (const struct b
*** 4976,4986 ****
  }
  	
  /* Print information on user settable breakpoint (watchpoint, etc)
!    number BNUM.  If BNUM is -1 print all user settable breakpoints.
!    If ALLFLAG is non-zero, include non- user settable breakpoints. */
  
! static void
! breakpoint_1 (int bnum, int allflag)
  {
    struct breakpoint *b;
    struct bp_location *last_loc = NULL;
--- 4964,4977 ----
  }
  	
  /* Print information on user settable breakpoint (watchpoint, etc)
!    number BNUM.  If BNUM is -1 print all user-settable breakpoints.
!    If ALLFLAG is non-zero, include non-user-settable breakpoints.  If
!    FILTER is non-NULL, call it on each breakpoint and only include the
!    ones for which it returns non-zero.  Return the total number of
!    breakpoints listed.  */
  
! static int
! breakpoint_1 (int bnum, int allflag, int (*filter) (const struct breakpoint *))
  {
    struct breakpoint *b;
    struct bp_location *last_loc = NULL;
*************** breakpoint_1 (int bnum, int allflag)
*** 4998,5003 ****
--- 4989,4998 ----
      if (bnum == -1
  	|| bnum == b->number)
        {
+ 	/* If we have a filter, only list the breakpoints it accepts.  */
+ 	if (filter && !filter (b))
+ 	  continue;
+ 	
  	if (allflag || user_settable_breakpoint (b))
  	  {
  	    int addr_bit = breakpoint_address_bits (b);
*************** breakpoint_1 (int bnum, int allflag)
*** 5053,5058 ****
--- 5048,5057 ----
      if (bnum == -1
  	|| bnum == b->number)
        {
+ 	/* If we have a filter, only list the breakpoints it accepts.  */
+ 	if (filter && !filter (b))
+ 	  continue;
+ 	
  	/* We only print out user settable breakpoints unless the
  	   allflag is set. */
  	if (allflag || user_settable_breakpoint (b))
*************** breakpoint_1 (int bnum, int allflag)
*** 5064,5074 ****
  
    if (nr_printable_breakpoints == 0)
      {
!       if (bnum == -1)
! 	ui_out_message (uiout, 0, "No breakpoints or watchpoints.\n");
!       else
! 	ui_out_message (uiout, 0, "No breakpoint or watchpoint number %d.\n",
! 			bnum);
      }
    else
      {
--- 5063,5077 ----
  
    if (nr_printable_breakpoints == 0)
      {
!       /* If there's a filter, let the caller decide how to report empty list.  */
!       if (!filter)
! 	{
! 	  if (bnum == -1)
! 	    ui_out_message (uiout, 0, "No breakpoints or watchpoints.\n");
! 	  else
! 	    ui_out_message (uiout, 0, "No breakpoint or watchpoint number %d.\n",
! 			    bnum);
! 	}
      }
    else
      {
*************** breakpoint_1 (int bnum, int allflag)
*** 5079,5084 ****
--- 5082,5089 ----
    /* FIXME? Should this be moved up so that it is only called when
       there have been breakpoints? */
    annotate_breakpoints_table_end ();
+ 
+   return nr_printable_breakpoints;
  }
  
  static void
*************** breakpoints_info (char *bnum_exp, int fr
*** 5089,5095 ****
    if (bnum_exp)
      bnum = parse_and_eval_long (bnum_exp);
  
!   breakpoint_1 (bnum, 0);
  }
  
  static void
--- 5094,5119 ----
    if (bnum_exp)
      bnum = parse_and_eval_long (bnum_exp);
  
!   breakpoint_1 (bnum, 0, NULL);
! }
! 
! static void
! watchpoints_info (char *wpnum_exp, int from_tty)
! {
!   int wpnum = -1, num_printed;
! 
!   if (wpnum_exp)
!     wpnum = parse_and_eval_long (wpnum_exp);
! 
!   num_printed = breakpoint_1 (wpnum, 0, is_watchpoint);
! 
!   if (num_printed == 0)
!     {
!       if (wpnum == -1)
! 	ui_out_message (uiout, 0, "No watchpoints.\n");
!       else
! 	ui_out_message (uiout, 0, "No watchpoint number %d.\n", wpnum);
!     }
  }
  
  static void
*************** maintenance_info_breakpoints (char *bnum
*** 5100,5106 ****
    if (bnum_exp)
      bnum = parse_and_eval_long (bnum_exp);
  
!   breakpoint_1 (bnum, 1);
  }
  
  static int
--- 5124,5130 ----
    if (bnum_exp)
      bnum = parse_and_eval_long (bnum_exp);
  
!   breakpoint_1 (bnum, 1, NULL);
  }
  
  static int
*************** set_breakpoint_location_function (struct
*** 5429,5435 ****
  {
    if (loc->owner->type == bp_breakpoint
        || loc->owner->type == bp_hardware_breakpoint
!       || tracepoint_type (loc->owner))
      {
        find_pc_partial_function (loc->address, &(loc->function_name), 
  				NULL, NULL);
--- 5453,5459 ----
  {
    if (loc->owner->type == bp_breakpoint
        || loc->owner->type == bp_hardware_breakpoint
!       || is_tracepoint (loc->owner))
      {
        find_pc_partial_function (loc->address, &(loc->function_name), 
  				NULL, NULL);
*************** disable_breakpoints_in_shlibs (void)
*** 5716,5722 ****
      if (((b->type == bp_breakpoint)
  	 || (b->type == bp_jit_event)
  	 || (b->type == bp_hardware_breakpoint)
! 	 || (tracepoint_type (b)))
  	&& loc->pspace == current_program_space
  	&& !loc->shlib_disabled
  #ifdef PC_SOLIB
--- 5740,5746 ----
      if (((b->type == bp_breakpoint)
  	 || (b->type == bp_jit_event)
  	 || (b->type == bp_hardware_breakpoint)
! 	 || (is_tracepoint (b)))
  	&& loc->pspace == current_program_space
  	&& !loc->shlib_disabled
  #ifdef PC_SOLIB
*************** update_global_location_list (int should_
*** 9072,9078 ****
  	  || !loc->enabled
  	  || loc->shlib_disabled
  	  || !breakpoint_address_is_meaningful (b)
! 	  || tracepoint_type (b))
  	continue;
  
        /* Permanent breakpoint should always be inserted.  */
--- 9096,9102 ----
  	  || !loc->enabled
  	  || loc->shlib_disabled
  	  || !breakpoint_address_is_meaningful (b)
! 	  || is_tracepoint (b))
  	continue;
  
        /* Permanent breakpoint should always be inserted.  */
*************** set_ignore_count (int bptnum, int count,
*** 9732,9737 ****
--- 9756,9769 ----
    ALL_BREAKPOINTS (b)
      if (b->number == bptnum)
      {
+       if (is_tracepoint (b))
+ 	{
+ 	  if (from_tty && count != 0)
+ 	    printf_filtered (_("Ignore count ignored for tracepoint %d."),
+ 			     bptnum);
+ 	  return;
+ 	}
+       
        b->ignore_count = count;
        if (from_tty)
  	{
*************** create_tracepoint_from_upload (struct up
*** 10451,10479 ****
  static void
  tracepoints_info (char *tpnum_exp, int from_tty)
  {
!   struct breakpoint *b;
!   int tps_to_list = 0;
  
!   /* In the no-arguments case, say "No tracepoints" if none found.  */
!   if (tpnum_exp == 0)
      {
!       ALL_TRACEPOINTS (b)
!       {
! 	if (b->number >= 0)
! 	  {
! 	    tps_to_list = 1;
! 	    break;
! 	  }
!       }
!       if (!tps_to_list)
! 	{
! 	  ui_out_message (uiout, 0, "No tracepoints.\n");
! 	  return;
! 	}
      }
- 
-   /* Otherwise be the same as "info break".  */
-   breakpoints_info (tpnum_exp, from_tty);
  }
  
  /* The 'enable trace' command enables tracepoints.  
--- 10483,10502 ----
  static void
  tracepoints_info (char *tpnum_exp, int from_tty)
  {
!   int tpnum = -1, num_printed;
! 
!   if (tpnum_exp)
!     tpnum = parse_and_eval_long (tpnum_exp);
  
!   num_printed = breakpoint_1 (tpnum, 0, is_tracepoint);
! 
!   if (num_printed == 0)
      {
!       if (tpnum == -1)
! 	ui_out_message (uiout, 0, "No tracepoints.\n");
!       else
! 	ui_out_message (uiout, 0, "No tracepoint number %d.\n", tpnum);
      }
  }
  
  /* The 'enable trace' command enables tracepoints.  
*************** delete_trace_command (char *arg, int fro
*** 10522,10528 ****
  	{
  	  ALL_BREAKPOINTS_SAFE (b, temp)
  	  {
! 	    if (tracepoint_type (b)
  		&& b->number >= 0)
  	      delete_breakpoint (b);
  	  }
--- 10545,10551 ----
  	{
  	  ALL_BREAKPOINTS_SAFE (b, temp)
  	  {
! 	    if (is_tracepoint (b)
  		&& b->number >= 0)
  	      delete_breakpoint (b);
  	  }
*************** A watchpoint stops execution of your pro
*** 11164,11171 ****
  an expression is either read or written."));
    set_cmd_completer (c, expression_completer);
  
!   add_info ("watchpoints", breakpoints_info,
! 	    _("Synonym for ``info breakpoints''."));
  
  
    /* XXX: cagney/2005-02-23: This should be a boolean, and should
--- 11187,11195 ----
  an expression is either read or written."));
    set_cmd_completer (c, expression_completer);
  
!   add_info ("watchpoints", watchpoints_info, _("\
! Status of watchpoints, or watchpoint number NUMBER."));
! 
  
  
    /* XXX: cagney/2005-02-23: This should be a boolean, and should
Index: breakpoint.h
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.h,v
retrieving revision 1.114
diff -p -r1.114 breakpoint.h
*** breakpoint.h	2 Apr 2010 01:18:34 -0000	1.114
--- breakpoint.h	3 Apr 2010 02:48:15 -0000
*************** extern struct breakpoint *get_tracepoint
*** 1041,1047 ****
     is newly allocated; the caller should free when done with it.  */
  extern VEC(breakpoint_p) *all_tracepoints (void);
  
! extern int breakpoint_is_tracepoint (const struct breakpoint *b);
  
  /* Function that can be passed to read_command_line to validate
     that each command is suitable for tracepoint command list.  */
--- 1041,1047 ----
     is newly allocated; the caller should free when done with it.  */
  extern VEC(breakpoint_p) *all_tracepoints (void);
  
! extern int is_tracepoint (const struct breakpoint *b);
  
  /* Function that can be passed to read_command_line to validate
     that each command is suitable for tracepoint command list.  */
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.693
diff -p -r1.693 gdb.texinfo
*** doc/gdb.texinfo	1 Apr 2010 14:11:23 -0000	1.693
--- doc/gdb.texinfo	3 Apr 2010 02:48:16 -0000
*************** The @code{rbreak} command can be used to
*** 3388,3394 ****
  @cindex @code{$_} and @code{info breakpoints}
  @item info breakpoints @r{[}@var{n}@r{]}
  @itemx info break @r{[}@var{n}@r{]}
- @itemx info watchpoints @r{[}@var{n}@r{]}
  Print a table of all breakpoints, watchpoints, and catchpoints set and
  not deleted.  Optional argument @var{n} means print information only
  about the specified breakpoint (or watchpoint or catchpoint).  For
--- 3388,3393 ----
*************** or written into by the program.
*** 3705,3712 ****
  
  @kindex info watchpoints @r{[}@var{n}@r{]}
  @item info watchpoints
! This command prints a list of watchpoints, breakpoints, and catchpoints;
! it is the same as @code{info break} (@pxref{Set Breaks}).
  @end table
  
  @value{GDBN} sets a @dfn{hardware watchpoint} if possible.  Hardware
--- 3704,3711 ----
  
  @kindex info watchpoints @r{[}@var{n}@r{]}
  @item info watchpoints
! This command prints a list of watchpoints, using the same format as
! @code{info break} (@pxref{Set Breaks}).
  @end table
  
  @value{GDBN} sets a @dfn{hardware watchpoint} if possible.  Hardware
*************** it had been deleted, but remembers the i
*** 4135,4144 ****
  that you can @dfn{enable} it again later.
  
  You disable and enable breakpoints, watchpoints, and catchpoints with
! the @code{enable} and @code{disable} commands, optionally specifying one
! or more breakpoint numbers as arguments.  Use @code{info break} or
! @code{info watch} to print a list of breakpoints, watchpoints, and
! catchpoints if you do not know which numbers to use.
  
  Disabling and enabling a breakpoint that has multiple locations
  affects all of its locations.
--- 4134,4143 ----
  that you can @dfn{enable} it again later.
  
  You disable and enable breakpoints, watchpoints, and catchpoints with
! the @code{enable} and @code{disable} commands, optionally specifying
! one or more breakpoint numbers as arguments.  Use @code{info break} to
! print a list of all breakpoints, watchpoints, and catchpoints if you
! do not know which numbers to use.
  
  Disabling and enabling a breakpoint that has multiple locations
  affects all of its locations.
Index: mi/mi-cmd-break.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-break.c,v
retrieving revision 1.32
diff -p -r1.32 mi-cmd-break.c
*** mi/mi-cmd-break.c	23 Mar 2010 21:48:14 -0000	1.32
--- mi/mi-cmd-break.c	3 Apr 2010 02:48:16 -0000
*************** mi_cmd_break_commands (char *command, ch
*** 303,309 ****
    mi_command_line_array_ptr = 1;
    mi_command_line_array_cnt = argc;
  
!   if (breakpoint_is_tracepoint (b))
      break_command = read_command_lines_1 (mi_read_next_line, 1,
  					  check_tracepoint_command, b);
    else
--- 303,309 ----
    mi_command_line_array_ptr = 1;
    mi_command_line_array_cnt = argc;
  
!   if (is_tracepoint (b))
      break_command = read_command_lines_1 (mi_read_next_line, 1,
  					  check_tracepoint_command, b);
    else
Index: testsuite/gdb.base/completion.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/completion.exp,v
retrieving revision 1.43
diff -p -r1.43 completion.exp
*** testsuite/gdb.base/completion.exp	24 Mar 2010 21:28:13 -0000	1.43
--- testsuite/gdb.base/completion.exp	3 Apr 2010 02:48:16 -0000
*************** gdb_expect  {
*** 354,360 ****
          -re "^help info watchpoints $"\
              { send_gdb "\n"
                gdb_expect {
!                       -re "Synonym for .*\r\n.*$gdb_prompt $"\
                            { pass "complete help info wat" }
                        -re ".*$gdb_prompt $" { fail "complete help info wat"}
                        timeout   {fail "(timeout) complete help info wat"}
--- 354,360 ----
          -re "^help info watchpoints $"\
              { send_gdb "\n"
                gdb_expect {
!                       -re "Status of watchpoints, .*\r\n.*$gdb_prompt $"\
                            { pass "complete help info wat" }
                        -re ".*$gdb_prompt $" { fail "complete help info wat"}
                        timeout   {fail "(timeout) complete help info wat"}
Index: testsuite/gdb.base/default.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/default.exp,v
retrieving revision 1.36
diff -p -r1.36 default.exp
*** testsuite/gdb.base/default.exp	24 Mar 2010 21:24:09 -0000	1.36
--- testsuite/gdb.base/default.exp	3 Apr 2010 02:48:16 -0000
*************** gdb_test "info vector" "The program has 
*** 353,359 ****
  #test info warranty
  gdb_test "info warranty" "15. *Disclaimer of Warranty.*" "info warranty"
  #test info watchpoints
! gdb_test "info watchpoints" "No breakpoints or watchpoints." "info watchpoints"
  #test inspect
  gdb_test "inspect" "The history is empty." "inspect"
  #test jump
--- 353,359 ----
  #test info warranty
  gdb_test "info warranty" "15. *Disclaimer of Warranty.*" "info warranty"
  #test info watchpoints
! gdb_test "info watchpoints" "No watchpoints." "info watchpoints"
  #test inspect
  gdb_test "inspect" "The history is empty." "inspect"
  #test jump
Index: testsuite/gdb.base/help.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/help.exp,v
retrieving revision 1.37
diff -p -r1.37 help.exp
*** testsuite/gdb.base/help.exp	1 Jan 2010 07:32:01 -0000	1.37
--- testsuite/gdb.base/help.exp	3 Apr 2010 02:48:16 -0000
*************** gdb_test "help info variables" "All glob
*** 294,300 ****
  # test help info warranty
  gdb_test "help info warranty" "Various kinds of warranty you do not have\." "help info warranty"
  # test help info watchpoints
! gdb_test "help info watchpoints" "Synonym for ``info breakpoints''\." "help info watchpoints"
  # test help inspect
  gdb_test "help inspect" "Same as \"print\" command, except that if you are running in the epoch\[\r\n\]+environment, the value is printed in its own window\." "help inspect"
  # test help jump
--- 294,300 ----
  # test help info warranty
  gdb_test "help info warranty" "Various kinds of warranty you do not have\." "help info warranty"
  # test help info watchpoints
! gdb_test "help info watchpoints" "Status of watchpoints, or watchpoint number NUMBER\." "help info watchpoints"
  # test help inspect
  gdb_test "help inspect" "Same as \"print\" command, except that if you are running in the epoch\[\r\n\]+environment, the value is printed in its own window\." "help inspect"
  # test help jump
Index: testsuite/gdb.base/watchpoint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/watchpoint.exp,v
retrieving revision 1.23
diff -p -r1.23 watchpoint.exp
*** testsuite/gdb.base/watchpoint.exp	1 Jan 2010 07:32:01 -0000	1.23
--- testsuite/gdb.base/watchpoint.exp	3 Apr 2010 02:48:16 -0000
*************** proc initialize {} {
*** 102,110 ****
          }
      }
  
!     # "info watch" is the same as "info break"
! 
!     if [gdb_test "info watch" "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n3\[ \]*.*watchpoint.*ival3" "watchpoint found in watchpoint/breakpoint table" ] { 
        return 0; 
      }
  
--- 102,108 ----
          }
      }
  
!     if [gdb_test "info watch" "3\[ \]*.*watchpoint.*ival3" "watchpoint found in watchpoint/breakpoint table" ] { 
        return 0; 
      }
  
*************** proc test_simple_watchpoint {} {
*** 176,186 ****
  
          set wp_set 1
  
- 	# "info watch" is the same as "info break"
- 
  	send_gdb "info watch\n"
  	gdb_expect {
! 	    -re "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n3\[ \]*.*watchpoint.*ival3\r\n$gdb_prompt $" {
  	        pass "watchpoint found in watchpoint/breakpoint table"
  	    }
  	    -re ".*$gdb_prompt $" {
--- 174,182 ----
  
          set wp_set 1
  
  	send_gdb "info watch\n"
  	gdb_expect {
! 	    -re "3\[ \]*.*watchpoint.*ival3\r\n$gdb_prompt $" {
  	        pass "watchpoint found in watchpoint/breakpoint table"
  	    }
  	    -re ".*$gdb_prompt $" {
*************** proc test_disabling_watchpoints {} {
*** 297,303 ****
      global hex
  
      # "info watch" is the same as "info break"
!     gdb_test "info watch" "\[0-9\]+\[ \]*breakpoint.*marker1.*\r\n\[0-9\]+\[ \]*breakpoint.*marker2.*\r\n\[0-9]+\[ \]*.*watchpoint.*ival3\r\n\.*\[0-9\]+ times.*" "watchpoints found in watchpoint/breakpoint table"
  
      # Ensure that the watchpoint is disabled when we startup.
  
--- 293,299 ----
      global hex
  
      # "info watch" is the same as "info break"
!     gdb_test "info watch" "\[0-9]+\[ \]*.*watchpoint.*ival3\r\n\.*\[0-9\]+ times.*" "watchpoints found in watchpoint/breakpoint table"
  
      # Ensure that the watchpoint is disabled when we startup.
  
Index: testsuite/gdb.trace/infotrace.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/infotrace.exp,v
retrieving revision 1.14
diff -p -r1.14 infotrace.exp
*** testsuite/gdb.trace/infotrace.exp	1 Jan 2010 07:32:07 -0000	1.14
--- testsuite/gdb.trace/infotrace.exp	3 Apr 2010 02:48:16 -0000
*************** gdb_test "info tracepoint $asm_test_num"
*** 74,80 ****
  
  # 2.3 info tracepoint (invalid tracepoint number)
  gdb_test "info tracepoint [expr $c_test_num + $asm_test_num]" \
!     "No breakpoint or watchpoint number [expr $c_test_num + $asm_test_num]." \
      "2.3: info tracepoint (invalid tracepoint number)"
  
  # 2.4 info tracepoints (list of numbers)
--- 74,80 ----
  
  # 2.3 info tracepoint (invalid tracepoint number)
  gdb_test "info tracepoint [expr $c_test_num + $asm_test_num]" \
!     "No tracepoint number [expr $c_test_num + $asm_test_num]." \
      "2.3: info tracepoint (invalid tracepoint number)"
  
  # 2.4 info tracepoints (list of numbers)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix info tracepoints, etc
  2010-04-03  3:01 [PATCH] Fix info tracepoints, etc Stan Shebs
@ 2010-04-03  7:38 ` Eli Zaretskii
  2010-04-04 23:39   ` Stan Shebs
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2010-04-03  7:38 UTC (permalink / raw)
  To: Stan Shebs; +Cc: gdb-patches

> Date: Fri, 02 Apr 2010 20:01:10 -0700
> From: Stan Shebs <stan@codesourcery.com>
> 
> Originally just a simple fix to make "info tracepoints" display only 
> tracepoints, it's grown a bit. :-) The key change is to pass an optional 
> filter function to breakpoint_1, which has a nice bonus of letting "info 
> watchpoints" being the only-watchpoints lister that it was always 
> supposed to be - which then requires doc and testsuite changes.  I also 
> took the opportunity of merging the duplicate tracepoint predicates that 
> found their way into the code, plus there's now a warning that 
> tracepoints don't do ignore counts.

Thanks.

> *** doc/gdb.texinfo	1 Apr 2010 14:11:23 -0000	1.693
> --- doc/gdb.texinfo	3 Apr 2010 02:48:16 -0000

This part is okay, but I have one question:

> *************** it had been deleted, but remembers the i
> *** 4135,4144 ****
>   that you can @dfn{enable} it again later.
>   
>   You disable and enable breakpoints, watchpoints, and catchpoints with
> ! the @code{enable} and @code{disable} commands, optionally specifying one
> ! or more breakpoint numbers as arguments.  Use @code{info break} or
> ! @code{info watch} to print a list of breakpoints, watchpoints, and
> ! catchpoints if you do not know which numbers to use.
>   
>   Disabling and enabling a breakpoint that has multiple locations
>   affects all of its locations.
> --- 4134,4143 ----
>   that you can @dfn{enable} it again later.
>   
>   You disable and enable breakpoints, watchpoints, and catchpoints with
> ! the @code{enable} and @code{disable} commands, optionally specifying
> ! one or more breakpoint numbers as arguments.  Use @code{info break} to
> ! print a list of all breakpoints, watchpoints, and catchpoints if you
> ! do not know which numbers to use.

Why did you need to remove the reference to "info watch" from this
passage?  The command is still available, and will do its job.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix info tracepoints, etc
  2010-04-03  7:38 ` Eli Zaretskii
@ 2010-04-04 23:39   ` Stan Shebs
  0 siblings, 0 replies; 3+ messages in thread
From: Stan Shebs @ 2010-04-04 23:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Stan Shebs, gdb-patches

Eli Zaretskii wrote:
>> *************** it had been deleted, but remembers the i
>> *** 4135,4144 ****
>>   that you can @dfn{enable} it again later.
>>   
>>   You disable and enable breakpoints, watchpoints, and catchpoints with
>> ! the @code{enable} and @code{disable} commands, optionally specifying one
>> ! or more breakpoint numbers as arguments.  Use @code{info break} or
>> ! @code{info watch} to print a list of breakpoints, watchpoints, and
>> ! catchpoints if you do not know which numbers to use.
>>   
>>   Disabling and enabling a breakpoint that has multiple locations
>>   affects all of its locations.
>> --- 4134,4143 ----
>>   that you can @dfn{enable} it again later.
>>   
>>   You disable and enable breakpoints, watchpoints, and catchpoints with
>> ! the @code{enable} and @code{disable} commands, optionally specifying
>> ! one or more breakpoint numbers as arguments.  Use @code{info break} to
>> ! print a list of all breakpoints, watchpoints, and catchpoints if you
>> ! do not know which numbers to use.
>>     
>
> Why did you need to remove the reference to "info watch" from this
> passage?  The command is still available, and will do its job.
>
>   

In this context, the implication is that the user wants to get a list of 
all actionpoints, and it is now the case that only "info break" will 
list everything.  If we wanted to retain a mention of "info watch", 
there would be some complicated rephrasing to clarify that "info watch" 
will not show regular breakpoints etc, and since the point of the 
sentence is just to remind the user that the info command is a 
convenient way to find out the valid actionpoint numbers, simpler seemed 
better.

Stan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-04 23:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-03  3:01 [PATCH] Fix info tracepoints, etc Stan Shebs
2010-04-03  7:38 ` Eli Zaretskii
2010-04-04 23:39   ` Stan Shebs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox