[1/2] Make 'print_thread_events' static

Message ID 20250112-announce-thread-pr-19584-v1-1-2260ceda33d4@tromey.com
State New
Headers
Series Show gdb thread ID in new thread message |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed

Commit Message

Tom Tromey Jan. 12, 2025, 1:42 p.m. UTC
  This makes the 'print_thread_events' global static.  It's never used
outside of thread.c.
---
 gdb/gdbthread.h | 4 ----
 gdb/thread.c    | 5 +++--
 2 files changed, 3 insertions(+), 6 deletions(-)
  

Comments

Rohr, Stephan Jan. 13, 2025, 8:47 a.m. UTC | #1
Hi Tom,

This looks reasonable.

Stephan

Reviewed-by: Stephan Rohr <stephan.rohr@intel.com>

> -----Original Message-----
> From: Tom Tromey <tom@tromey.com>
> Sent: Sunday, 12 January 2025 14:42
> To: gdb-patches@sourceware.org
> Cc: Tom Tromey <tom@tromey.com>
> Subject: [PATCH 1/2] Make 'print_thread_events' static
> 
> This makes the 'print_thread_events' global static.  It's never used
> outside of thread.c.
> ---
>  gdb/gdbthread.h | 4 ----
>  gdb/thread.c    | 5 +++--
>  2 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
> index
> ee62153551f37d177a43739921ea8f531866a19a..8b77d326b161b54decc4
> bccaf16107cfa4ee4b6e 100644
> --- a/gdb/gdbthread.h
> +++ b/gdb/gdbthread.h
> @@ -866,10 +866,6 @@ extern struct cmd_list_element *thread_cmd_list;
> 
>  extern void thread_command (const char *tidstr, int from_tty);
> 
> -/* Print notices on thread events (attach, detach, etc.), set with
> -   `set print thread-events'.  */
> -extern bool print_thread_events;
> -
>  /* Prints the list of threads and their details on UIOUT.  If
>     REQUESTED_THREADS, a list of GDB ids/ranges, is not NULL, only
>     print threads whose ID is included in the list.  If PID is not -1,
> diff --git a/gdb/thread.c b/gdb/thread.c
> index
> 5892b158603a7d11cb7c7efc3346f01714797201..ef8a495a5a52418412fd0
> 624f598c03d715afb5a 100644
> --- a/gdb/thread.c
> +++ b/gdb/thread.c
> @@ -52,6 +52,9 @@
>  #include "interps.h"
>  #include "record-full.h"
> 
> +/* Print notices when new threads are attached and detached.  */
> +static bool print_thread_events = true;
> +
>  /* See gdbthread.h.  */
> 
>  bool debug_threads = false;
> @@ -2048,8 +2051,6 @@ thread_find_command (const char *arg, int
> from_tty)
>      gdb_printf (_("No threads match '%s'\n"), arg);
>  }
> 
> -/* Print notices when new threads are attached and detached.  */
> -bool print_thread_events = true;
>  static void
>  show_print_thread_events (struct ui_file *file, int from_tty,
>  			  struct cmd_list_element *c, const char *value)
> 
> --
> 2.46.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
  

Patch

diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index ee62153551f37d177a43739921ea8f531866a19a..8b77d326b161b54decc4bccaf16107cfa4ee4b6e 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -866,10 +866,6 @@  extern struct cmd_list_element *thread_cmd_list;
 
 extern void thread_command (const char *tidstr, int from_tty);
 
-/* Print notices on thread events (attach, detach, etc.), set with
-   `set print thread-events'.  */
-extern bool print_thread_events;
-
 /* Prints the list of threads and their details on UIOUT.  If
    REQUESTED_THREADS, a list of GDB ids/ranges, is not NULL, only
    print threads whose ID is included in the list.  If PID is not -1,
diff --git a/gdb/thread.c b/gdb/thread.c
index 5892b158603a7d11cb7c7efc3346f01714797201..ef8a495a5a52418412fd0624f598c03d715afb5a 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -52,6 +52,9 @@ 
 #include "interps.h"
 #include "record-full.h"
 
+/* Print notices when new threads are attached and detached.  */
+static bool print_thread_events = true;
+
 /* See gdbthread.h.  */
 
 bool debug_threads = false;
@@ -2048,8 +2051,6 @@  thread_find_command (const char *arg, int from_tty)
     gdb_printf (_("No threads match '%s'\n"), arg);
 }
 
-/* Print notices when new threads are attached and detached.  */
-bool print_thread_events = true;
 static void
 show_print_thread_events (struct ui_file *file, int from_tty,
 			  struct cmd_list_element *c, const char *value)