[pushed] gdbsupport, gdb: change observer_debug to bool

Message ID 20210423203902.4109216-1-simon.marchi@polymtl.ca
State New
Headers show
Series
  • [pushed] gdbsupport, gdb: change observer_debug to bool
Related show

Commit Message

Simon Marchi via Gdb-patches April 23, 2021, 8:39 p.m.
gdb/ChangeLog:

	* observable.c (observer_debug): Change to bool.

gdbsupport/ChangeLog:

	* observable.h (observer_debug): Change to bool.

Change-Id: I58634235a20740a66eacb1c83bae3cf3304ae1fd
---
 gdb/ChangeLog           |  4 ++++
 gdb/observable.c        | 12 ++++++------
 gdbsupport/ChangeLog    |  4 ++++
 gdbsupport/observable.h |  2 +-
 4 files changed, 15 insertions(+), 7 deletions(-)

-- 
2.30.1

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5013d730f35c..94a8296e6a1b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@ 
+2021-04-23  Simon Marchi  <simon.marchi@polymtl.ca>
+
+	* observable.c (observer_debug): Change to bool.
+
 2021-04-23  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* dwarf2/read.c: Add 'unordered_set' include.
diff --git a/gdb/observable.c b/gdb/observable.c
index 10b8aad829eb..51f5edb0a1f6 100644
--- a/gdb/observable.c
+++ b/gdb/observable.c
@@ -28,7 +28,7 @@  namespace gdb
 namespace observers
 {
 
-unsigned int observer_debug;
+bool observer_debug = false;
 
 #define DEFINE_OBSERVABLE(name) decltype (name) name (# name)
 
@@ -92,12 +92,12 @@  void _initialize_observer ();
 void
 _initialize_observer ()
 {
-  add_setshow_zuinteger_cmd ("observer", class_maintenance,
-			     &gdb::observers::observer_debug, _("\
+  add_setshow_boolean_cmd ("observer", class_maintenance,
+			   &gdb::observers::observer_debug, _("\
 Set observer debugging."), _("\
 Show observer debugging."), _("\
 When non-zero, observer debugging is enabled."),
-			     NULL,
-			     show_observer_debug,
-			     &setdebuglist, &showdebuglist);
+			   NULL,
+			   show_observer_debug,
+			   &setdebuglist, &showdebuglist);
 }
diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog
index dfbb06e61b61..3ceeb3dab49e 100644
--- a/gdbsupport/ChangeLog
+++ b/gdbsupport/ChangeLog
@@ -1,3 +1,7 @@ 
+2021-04-23  Simon Marchi  <simon.marchi@polymtl.ca>
+
+	* observable.h (observer_debug): Change to bool.
+
 2021-04-23  Simon Marchi  <simon.marchi@polymtl.ca>
 
 	* common-debug.h: Include preprocessor.h.
diff --git a/gdbsupport/observable.h b/gdbsupport/observable.h
index 1a9e767ba18b..0532500dd5fa 100644
--- a/gdbsupport/observable.h
+++ b/gdbsupport/observable.h
@@ -30,7 +30,7 @@  namespace gdb
 namespace observers
 {
 
-extern unsigned int observer_debug;
+extern bool observer_debug;
 
 /* An observer is an entity which is interested in being notified
    when GDB reaches certain states, or certain events occur in GDB.