public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH/RFC] Include value of default-collect in breakpoint/tracepoint  list
@ 2010-04-05 23:30 Stan Shebs
  2010-04-07 19:56 ` Tom Tromey
  2010-04-09  0:55 ` Stan Shebs
  0 siblings, 2 replies; 4+ messages in thread
From: Stan Shebs @ 2010-04-05 23:30 UTC (permalink / raw)
  To: gdb-patches

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

Although it's always possible to find out the value of default-collect 
by doing a show command, in practice it's convenient to see it listed as 
part of "info break" or "info trace"; it helps keep the user aware that 
more may be getting collected than is listed with individual 
tracepoints.  This patch just gives it a line after the listing, and 
doesn't say anything if it is empty.

Since this is not strictly necessary and maybe even a little irregular, 
I invite comments - if enough people put finger down throat and make 
gagging noises, I'll withdraw it. :-)

Stan

2010-04-05  Stan Shebs  <stan@codesourcery.com>

    * breakpoint.c (default_collect_info): New function.
    (breakpoints_info): Call it.
    (maintenance_info_breakpoints): Ditto.
    (tracepoints_info): Ditto.



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

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.478
diff -p -r1.478 breakpoint.c
*** breakpoint.c	5 Apr 2010 10:07:30 -0000	1.478
--- breakpoint.c	5 Apr 2010 23:17:37 -0000
*************** breakpoint_commands (struct breakpoint *
*** 241,246 ****
--- 241,248 ----
    return b->commands ? b->commands->commands : NULL;
  }
  
+ static void default_collect_info (void);
+ 
  /* Flag indicating that a command has proceeded the inferior past the
     current breakpoint.  */
  
*************** breakpoints_info (char *bnum_exp, int fr
*** 5061,5066 ****
--- 5063,5070 ----
      bnum = parse_and_eval_long (bnum_exp);
  
    breakpoint_1 (bnum, 0, NULL);
+ 
+   default_collect_info ();
  }
  
  static void
*************** maintenance_info_breakpoints (char *bnum
*** 5091,5096 ****
--- 5095,5102 ----
      bnum = parse_and_eval_long (bnum_exp);
  
    breakpoint_1 (bnum, 1, NULL);
+ 
+   default_collect_info ();
  }
  
  static int
*************** tracepoints_info (char *tpnum_exp, int f
*** 10463,10470 ****
--- 10469,10497 ----
        else
  	ui_out_message (uiout, 0, "No tracepoint number %d.\n", tpnum);
      }
+ 
+   default_collect_info ();
  }
  
+ /* Display the value of default-collect in a way that is generally
+    compatible with the breakpoint list.  */
+ 
+ void
+ default_collect_info (void)
+ {
+   /* If it has no value (which is frequently the case), say nothing; a
+      message like "No default-collect." gets in user's face when it's
+      not wanted.  */
+   if (!*default_collect)
+     return;
+ 
+   /* The following phrase lines up nicely with per-tracepoint collect
+      actions.  */
+   ui_out_text (uiout, "default collect ");
+   ui_out_field_string (uiout, "default-collect", default_collect);
+   ui_out_text (uiout, " \n");
+ }
+   
  /* The 'enable trace' command enables tracepoints.  
     Not supported by all targets.  */
  static void

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

* Re: [PATCH/RFC] Include value of default-collect in breakpoint/tracepoint  list
  2010-04-05 23:30 [PATCH/RFC] Include value of default-collect in breakpoint/tracepoint list Stan Shebs
@ 2010-04-07 19:56 ` Tom Tromey
  2010-04-08 23:18   ` Stan Shebs
  2010-04-09  0:55 ` Stan Shebs
  1 sibling, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2010-04-07 19:56 UTC (permalink / raw)
  To: Stan Shebs; +Cc: gdb-patches

>>>>> "Stan" == Stan Shebs <stan@codesourcery.com> writes:

Stan> 2010-04-05  Stan Shebs  <stan@codesourcery.com>
Stan>    * breakpoint.c (default_collect_info): New function.
Stan>    (breakpoints_info): Call it.
Stan>    (maintenance_info_breakpoints): Ditto.
Stan>    (tracepoints_info): Ditto.

Stan> + static void default_collect_info (void);

Stan> + /* Display the value of default-collect in a way that is generally
Stan> +    compatible with the breakpoint list.  */
Stan> + 
Stan> + void
Stan> + default_collect_info (void)

It is mildly weird for the declaration to have 'static' but not the
definition.

Also, I think the preferred style nowadays is to order functions so that
we don't need forward declarations (when possible).

FWIW, and since you asked, I think the idea behind the patch seems fine.

Tom

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

* Re: [PATCH/RFC] Include value of default-collect in breakpoint/tracepoint   list
  2010-04-07 19:56 ` Tom Tromey
@ 2010-04-08 23:18   ` Stan Shebs
  0 siblings, 0 replies; 4+ messages in thread
From: Stan Shebs @ 2010-04-08 23:18 UTC (permalink / raw)
  To: tromey; +Cc: Stan Shebs, gdb-patches

Tom Tromey wrote:
>>>>>> "Stan" == Stan Shebs <stan@codesourcery.com> writes:
>>>>>>             
>
> Stan> 2010-04-05  Stan Shebs  <stan@codesourcery.com>
> Stan>    * breakpoint.c (default_collect_info): New function.
> Stan>    (breakpoints_info): Call it.
> Stan>    (maintenance_info_breakpoints): Ditto.
> Stan>    (tracepoints_info): Ditto.
>
>
> Also, I think the preferred style nowadays is to order functions so that
> we don't need forward declarations (when possible).
>   

I really hate that style, it's just as evil as top-posting. :-)  But as 
you say, it's now the fashion, so I committed it that way.

Stan

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

* Re: [PATCH/RFC] Include value of default-collect in breakpoint/tracepoint   list
  2010-04-05 23:30 [PATCH/RFC] Include value of default-collect in breakpoint/tracepoint list Stan Shebs
  2010-04-07 19:56 ` Tom Tromey
@ 2010-04-09  0:55 ` Stan Shebs
  1 sibling, 0 replies; 4+ messages in thread
From: Stan Shebs @ 2010-04-09  0:55 UTC (permalink / raw)
  To: Stan Shebs; +Cc: gdb-patches

I cleverly managed to regression-test the wrong tree - leftover 
default-collect settings can affect info output, so this patch cleans up 
after testing.  Committed to trunk.

Stan

2010-04-08  Stan Shebs  <stan@codesourcery.com>

    * gdb.trace/actions.exp: Clear default-collect.
    * gdb.trace/save-trace.exp: Clear default-collect.

Index: gdb.trace/actions.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/actions.exp,v
retrieving revision 1.17
diff -p -r1.17 actions.exp
*** gdb.trace/actions.exp    1 Apr 2010 22:57:25 -0000    1.17
--- gdb.trace/actions.exp    9 Apr 2010 00:49:20 -0000
*************** gdb_test "show default-collect" \
*** 204,209 ****
--- 204,213 ----
      "The list of expressions to collect by default is \"gdb_char_test, 
gdb_long_test - 100\"..*" \
      "5.9b: show default-collect"
 
+ gdb_test "set default-collect" \
+     "" \
+     "5.9c: set default-collect"
+
  # 5.10 teval
 
  gdb_test "tvariable \$tsv" \
Index: gdb.trace/save-trace.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.trace/save-trace.exp,v
retrieving revision 1.15
diff -p -r1.15 save-trace.exp
*** gdb.trace/save-trace.exp    31 Mar 2010 17:59:49 -0000    1.15
--- gdb.trace/save-trace.exp    9 Apr 2010 00:49:20 -0000
*************** gdb_test "save-tracepoints savetrace.tr"
*** 135,140 ****
--- 135,141 ----
  # 10.2 Read back tracepoint definitions
 
  gdb_delete_tracepoints
+ gdb_test "set default-collect" "" "10.2: clear default-collect"
  gdb_test "info tracepoints" "No tracepoints." "10.2: delete tracepoints"
  gdb_test "source savetrace.tr" \
      "Tracepoint \[0-9\]+ at .*" \
*************** gdb_test "save-tracepoints $objdir/savet
*** 151,156 ****
--- 152,158 ----
      "10.3: save tracepoint definitions, full path"
 
  gdb_delete_tracepoints
+ gdb_test "set default-collect" "" "10.3: clear default-collect"
  gdb_test "info tracepoints" "No tracepoints." "10.3: delete tracepoints"
  gdb_test "source $objdir/savetrace.tr" \
      "Tracepoint \[0-9\]+ at .*" \

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

end of thread, other threads:[~2010-04-09  0:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-05 23:30 [PATCH/RFC] Include value of default-collect in breakpoint/tracepoint list Stan Shebs
2010-04-07 19:56 ` Tom Tromey
2010-04-08 23:18   ` Stan Shebs
2010-04-09  0:55 ` Stan Shebs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).