public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* Re: [patch] Fix for 'too much spew with "set verbose on"'
       [not found] <AANLkTinY+o2nw0Ld5dq5Grkd05Oyc+ZTiDE=7N0XdDj_@mail.gmail.com>
@ 2010-07-30 18:09 ` Eli Zaretskii
  2010-07-30 18:18   ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2010-07-30 18:09 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: gdb-patches, roland

> From: Paul Pluzhnikov <ppluzhnikov@google.com>
> Date: Fri, 30 Jul 2010 09:24:38 -0700
> Cc: Roland McGrath <roland@redhat.com>,        Paul Pluzhnikov <ppluzhnikov@google.com>
> 
> +Set whether to show processing of libthread_db."), _("\
> +Show whether to show processing of libthread_db."), _("\

"Show whether to show" sounds awkward.  How about

  "Show whether to be verbose during processing of libthread_db."

(and a similar change for the "Set" part)?

> +@kindex maint set show-libthread-db-processing
> +@kindex maint show show-libthread-db-processing
> +@cindex processing @code{libthread_db}
> +@item maint set show-libthread-db-processing
> +@itemx maint show show-libthread-db-processing
> +Control whether to show various internal events while searching for and
> +using @code{libthread_db}.  Use @code{ON} to enable, @code{OFF} to disable.
>  @end table

This part is fine.

Thanks.

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

* Re: [patch] Fix for 'too much spew with "set verbose on"'
  2010-07-30 18:09 ` [patch] Fix for 'too much spew with "set verbose on"' Eli Zaretskii
@ 2010-07-30 18:18   ` Pedro Alves
  2010-07-30 21:52     ` Paul Pluzhnikov
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2010-07-30 18:18 UTC (permalink / raw)
  To: gdb-patches, Eli Zaretskii; +Cc: Paul Pluzhnikov, roland

On Friday 30 July 2010 19:08:28, Eli Zaretskii wrote:
> "Show whether to show" sounds awkward.  How about
> 
>   "Show whether to be verbose during processing of libthread_db."
> 
> (and a similar change for the "Set" part)?

I think that stems from the command name.

 maint set verbose-libthread-db-processing

would get rid of the double show there too.

Paul, by putting this command under the "maint" commands,
are you saying that regular users won't find a need
for this command?  If so, do you think something like:

 set debug libthread-db

instead would be appropriate?  That would be more in
line with the other internal debug commands.

Otherwise, if users are supposed to need this for some
reason, then you should move it out of "maint".

-- 
Pedro Alves

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

* Re: [patch] Fix for 'too much spew with "set verbose on"'
  2010-07-30 18:18   ` Pedro Alves
@ 2010-07-30 21:52     ` Paul Pluzhnikov
  2010-07-30 22:14       ` Pedro Alves
  2010-07-31  7:10       ` Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Pluzhnikov @ 2010-07-30 21:52 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Eli Zaretskii, roland

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

On Fri, Jul 30, 2010 at 11:18 AM, Pedro Alves <pedro@codesourcery.com> wrote:

> set debug libthread-db

Good idea.  Revised patch attached.

Thanks,
-- 
Paul Pluzhnikov

2010-07-30  Paul Pluzhnikov  <ppluzhnikov@google.com>

       * linux-thread-db.c (libthread_db_debug): New variable.
       (thread_db_find_new_threads_silently): Control verbosity with it.
       (try_thread_db_load_1, try_thread_db_load): Likewise.
       (find_new_threads_once): Likewise.
       (_initialize_thread_db): Set/show it.

doc/ChangeLog:

2010-07-30  Paul Pluzhnikov  <ppluzhnikov@google.com>

       * gdb.texinfo (Threads): Document 'debug libthread-db'.

[-- Attachment #2: gdb-libthreaddb-20100730a.txt --]
[-- Type: text/plain, Size: 3826 bytes --]

Index: linux-thread-db.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-thread-db.c,v
retrieving revision 1.75
diff -u -p -u -r1.75 linux-thread-db.c
--- linux-thread-db.c	11 Jun 2010 12:10:12 -0000	1.75
+++ linux-thread-db.c	30 Jul 2010 21:42:27 -0000
@@ -75,6 +75,18 @@
 
 static char *libthread_db_search_path;
 
+/* If non-zero, print details of libthread_db processing.  */
+
+static int libthread_db_debug;
+
+static void
+show_libthread_db_debug (struct ui_file *file, int from_tty,
+			 struct cmd_list_element *c, const char *value)
+{
+  fprintf_filtered (file, _("libhtread-db debugging is %s.\n"), value);
+}
+
+
 /* If we're running on GNU/Linux, we must explicitly attach to any new
    threads.  */
 
@@ -601,7 +613,7 @@ thread_db_find_new_threads_silently (pti
       thread_db_find_new_threads_2 (ptid, 1);
     }
 
-  if (except.reason < 0 && info_verbose)
+  if (except.reason < 0 && libthread_db_debug)
     {
       exception_fprintf (gdb_stderr, except,
 			 "Warning: thread_db_find_new_threads_silently: ");
@@ -658,7 +670,7 @@ try_thread_db_load_1 (struct thread_db_i
   err = info->td_ta_new_p (&info->proc_handle, &info->thread_agent);
   if (err != TD_OK)
     {
-      if (info_verbose)
+      if (libthread_db_debug)
 	printf_unfiltered (_("td_ta_new failed: %s\n"),
 			   thread_db_err_str (err));
       else
@@ -708,7 +720,7 @@ try_thread_db_load_1 (struct thread_db_i
 
   printf_unfiltered (_("[Thread debugging using libthread_db enabled]\n"));
 
-  if (info_verbose || *libthread_db_search_path)
+  if (libthread_db_debug || *libthread_db_search_path)
     {
       const char *library;
 
@@ -745,18 +757,18 @@ try_thread_db_load (const char *library)
   void *handle;
   struct thread_db_info *info;
 
-  if (info_verbose)
+  if (libthread_db_debug)
     printf_unfiltered (_("Trying host libthread_db library: %s.\n"),
                        library);
   handle = dlopen (library, RTLD_NOW);
   if (handle == NULL)
     {
-      if (info_verbose)
+      if (libthread_db_debug)
 	printf_unfiltered (_("dlopen failed: %s.\n"), dlerror ());
       return 0;
     }
 
-  if (info_verbose && strchr (library, '/') == NULL)
+  if (libthread_db_debug && strchr (library, '/') == NULL)
     {
       void *td_init;
 
@@ -1381,7 +1393,7 @@ find_new_threads_once (struct thread_db_
 				    TD_THR_ANY_USER_FLAGS);
     }
 
-  if (info_verbose)
+  if (libthread_db_debug)
     {
       if (except.reason < 0)
 	exception_fprintf (gdb_stderr, except,
@@ -1685,6 +1697,16 @@ gdb itself."),
 			    NULL,
 			    NULL,
 			    &setlist, &showlist);
+
+  add_setshow_zinteger_cmd ("libthread-db", class_maintenance,
+			    &libthread_db_debug, _("\
+Set libthread-db debugging."), _("\
+Show libthread-db debugging."), _("\
+When non-zero, libthread-db debugging is enabled."),
+			    NULL,
+			    show_libthread_db_debug,
+			    &setdebuglist, &showdebuglist);
+
   /* Add ourselves to objfile event chain.  */
   observer_attach_new_objfile (thread_db_new_objfile);
 }
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.745
diff -u -p -u -r1.745 gdb.texinfo
--- doc/gdb.texinfo	30 Jul 2010 14:32:02 -0000	1.745
+++ doc/gdb.texinfo	30 Jul 2010 21:42:27 -0000
@@ -2864,6 +2864,14 @@ only on some platforms.
 @kindex show libthread-db-search-path 
 @item show libthread-db-search-path 
 Display current libthread_db search path.
+
+@kindex set debug libthread-db
+@kindex show debug libthread-db
+@cindex debugging @code{libthread_db}
+@item set debug libthread-db
+@itemx show debug libthread-db
+Turns on or off display of @code{libthread_db}-related events.
+Use @code{1} to enable, @code{0} to disable.
 @end table
 
 @node Forks

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

* Re: [patch] Fix for 'too much spew with "set verbose on"'
  2010-07-30 21:52     ` Paul Pluzhnikov
@ 2010-07-30 22:14       ` Pedro Alves
  2010-07-31  7:10       ` Eli Zaretskii
  1 sibling, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2010-07-30 22:14 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: gdb-patches, Eli Zaretskii, roland

On Friday 30 July 2010 22:52:15, Paul Pluzhnikov wrote:
> On Fri, Jul 30, 2010 at 11:18 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> 
> > set debug libthread-db
> 
> Good idea.  Revised patch attached.

Thanks.

> 2010-07-30  Paul Pluzhnikov  <ppluzhnikov@google.com>
> 
>        * linux-thread-db.c (libthread_db_debug): New variable.
>        (thread_db_find_new_threads_silently): Control verbosity with it.
>        (try_thread_db_load_1, try_thread_db_load): Likewise.
>        (find_new_threads_once): Likewise.
>        (_initialize_thread_db): Set/show it.

This is okay.  Please wait for Eli to comment on the new
docs / help strings.

> doc/ChangeLog:
> 
> 2010-07-30  Paul Pluzhnikov  <ppluzhnikov@google.com>
> 
>        * gdb.texinfo (Threads): Document 'debug libthread-db'.

> +static void
> +show_libthread_db_debug (struct ui_file *file, int from_tty,
> +                        struct cmd_list_element *c, const char *value)
> +{
> +  fprintf_filtered (file, _("libhtread-db debugging is %s.\n"), value);

Typo, "libthread-db".

-- 
Pedro Alves

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

* Re: [patch] Fix for 'too much spew with "set verbose on"'
  2010-07-30 21:52     ` Paul Pluzhnikov
  2010-07-30 22:14       ` Pedro Alves
@ 2010-07-31  7:10       ` Eli Zaretskii
  2010-07-31 15:41         ` Paul Pluzhnikov
  1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2010-07-31  7:10 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: pedro, gdb-patches, roland

> From: Paul Pluzhnikov <ppluzhnikov@google.com>
> Date: Fri, 30 Jul 2010 14:52:15 -0700
> Cc: gdb-patches@sourceware.org, Eli Zaretskii <eliz@gnu.org>,
>         roland@redhat.com
> 
> --001636e1ef44fb5cc7048ca1de0a
> Content-Type: text/plain; charset=ISO-8859-1
> 
> On Fri, Jul 30, 2010 at 11:18 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> 
> > set debug libthread-db
> 
> Good idea.  Revised patch attached.

The doco and the help strings are okay with me.

Thanks.

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

* Re: [patch] Fix for 'too much spew with "set verbose on"'
  2010-07-31  7:10       ` Eli Zaretskii
@ 2010-07-31 15:41         ` Paul Pluzhnikov
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Pluzhnikov @ 2010-07-31 15:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: pedro, gdb-patches, roland

On Sat, Jul 31, 2010 at 12:09 AM, Eli Zaretskii <eliz@gnu.org> wrote:

> The doco and the help strings are okay with me.

Thanks, so committed.

-- 
Paul Pluzhnikov

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

end of thread, other threads:[~2010-07-31 15:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AANLkTinY+o2nw0Ld5dq5Grkd05Oyc+ZTiDE=7N0XdDj_@mail.gmail.com>
2010-07-30 18:09 ` [patch] Fix for 'too much spew with "set verbose on"' Eli Zaretskii
2010-07-30 18:18   ` Pedro Alves
2010-07-30 21:52     ` Paul Pluzhnikov
2010-07-30 22:14       ` Pedro Alves
2010-07-31  7:10       ` Eli Zaretskii
2010-07-31 15:41         ` Paul Pluzhnikov

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).