gdb: turn arc_debug into a bool
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 13 Jan 2021 19:32:23 +0000 (14:32 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Wed, 13 Jan 2021 19:32:23 +0000 (14:32 -0500)
Shahab suggested we get rid of the verbosity level for the ARC debug
logging [1].  This patch does that, before doing any other change.

gdb/ChangeLog:

* arc-tdep.h (arc_debug): Change type to bool.
* arc-tdep.c (arc_debug): Change type to bool.
(arc_analyze_prologue): Adjust.
(_initialize_arc_tdep): Use add_setshow_boolean_cmd.
* arc-linux-nat.c (ps_get_thread_area): Adjust.

[1] https://sourceware.org/pipermail/gdb-patches/2021-January/175075.html

Change-Id: I16688bd42ed8978ae1acf57012c8d41a943044a5

gdb/ChangeLog
gdb/arc-linux-nat.c
gdb/arc-tdep.c
gdb/arc-tdep.h

index 58392b25cd9f763ab63ba7c1b19d145944e70c39..8b40c5a232c77bafdf22a8bb758315fac6b8da18 100644 (file)
@@ -1,3 +1,11 @@
+2021-01-13  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * arc-tdep.h (arc_debug): Change type to bool.
+       * arc-tdep.c (arc_debug): Change type to bool.
+       (arc_analyze_prologue): Adjust.
+       (_initialize_arc_tdep): Use add_setshow_boolean_cmd.
+       * arc-linux-nat.c (ps_get_thread_area): Adjust.
+
 2021-01-13  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * auto-load.c (auto_load_objfile_script_1): Use bool.
index db5d44312a68d6abfac8063aea3419e7e28125d0..b03363a4865443e876fe602fc472869a7272de51 100644 (file)
@@ -295,7 +295,7 @@ ps_err_e
 ps_get_thread_area (struct ps_prochandle *ph, lwpid_t lwpid, int idx,
                    void **base)
 {
-  if (arc_debug >= 2)
+  if (arc_debug)
     debug_printf ("arc-linux-nat: ps_get_thread_area called");
 
   if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
index 9b8457112111c9185bf18b3a86a868621b4a44fe..e2f855142e1304fa4b179016edd9e53d5d601c83 100644 (file)
@@ -87,7 +87,7 @@ struct arc_frame_cache
 
 /* Global debug flag.  */
 
-int arc_debug;
+bool arc_debug;
 
 /* List of "maintenance print arc" commands.  */
 
@@ -1421,7 +1421,7 @@ arc_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR entrypoint,
       arc_insn_decode (current_prologue_end, &di, arc_delayed_print_insn,
                       &insn);
 
-      if (arc_debug >= 2)
+      if (arc_debug)
        arc_insn_dump (insn);
 
       /* If this instruction is in the prologue, fields in the cache will be
@@ -2517,10 +2517,10 @@ _initialize_arc_tdep ()
           &maintenance_print_arc_list);
 
   /* Debug internals for ARC GDB.  */
-  add_setshow_zinteger_cmd ("arc", class_maintenance,
-                           &arc_debug,
-                           _("Set ARC specific debugging."),
-                           _("Show ARC specific debugging."),
-                           _("Non-zero enables ARC specific debugging."),
-                           NULL, NULL, &setdebuglist, &showdebuglist);
+  add_setshow_boolean_cmd ("arc", class_maintenance,
+                          &arc_debug,
+                          _("Set ARC specific debugging."),
+                          _("Show ARC specific debugging."),
+                          _("When set, ARC specific debugging is enabled."),
+                          NULL, NULL, &setdebuglist, &showdebuglist);
 }
index 70fc3d95c483fdb1b370f2424ec97e16c6ce0515..575cd28cacdbf20e8f412dcfc733587ec59b0d40 100644 (file)
@@ -112,7 +112,7 @@ enum arc_regnum
 
 #define arc_print(fmt, args...) fprintf_unfiltered (gdb_stdlog, fmt, ##args)
 
-extern int arc_debug;
+extern bool arc_debug;
 
 /* Target-dependent information.  */
 
This page took 0.029328 seconds and 4 git commands to generate.