Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Stan Shebs <stan@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [PATCH/RFC] Include value of default-collect in breakpoint/tracepoint  list
Date: Mon, 05 Apr 2010 23:30:00 -0000	[thread overview]
Message-ID: <4BBA7264.5060109@codesourcery.com> (raw)

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

             reply	other threads:[~2010-04-05 23:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-05 23:30 Stan Shebs [this message]
2010-04-07 19:56 ` Tom Tromey
2010-04-08 23:18   ` Stan Shebs
2010-04-09  0:55 ` Stan Shebs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BBA7264.5060109@codesourcery.com \
    --to=stan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox