This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Use show_debug_regs as a boolean


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=60a191edda5bb9c189df43542ab249ea530a3c73

commit 60a191edda5bb9c189df43542ab249ea530a3c73
Author: Yao Qi <yao.qi@linaro.org>
Date:   Fri Mar 6 14:14:27 2015 +0000

    Use show_debug_regs as a boolean
    
    I happen to see that show_debug_regs is used as an arithmetic type,
    but it should be a boolean,
    
      if (show_debug_regs > 1)
    
    On the other hand, GDB RSP only allows setting it to either 0 or 1,
    so it makes no sense to check whether it is greater than 1.  This
    patch fixes it.
    
    gdb/gdbserver:
    
    2015-03-06  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (aarch64_insert_point): Use
    	show_debug_regs as a boolean.
    	(aarch64_remove_point): Likewise.

Diff:
---
 gdb/gdbserver/ChangeLog           | 6 ++++++
 gdb/gdbserver/linux-aarch64-low.c | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 7a99838..e735c8e 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-06  Yao Qi  <yao.qi@linaro.org>
+
+	* linux-aarch64-low.c (aarch64_insert_point): Use
+	show_debug_regs as a boolean.
+	(aarch64_remove_point): Likewise.
+
 2015-03-05  Pedro Alves  <palves@redhat.com>
 
 	* lynx-low.c (lynx_target_ops): Install NULL hooks for
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index a34fe5d..7934e78 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -990,7 +990,7 @@ aarch64_insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
     ret =
       aarch64_handle_breakpoint (targ_type, addr, len, 1 /* is_insert */);
 
-  if (show_debug_regs > 1)
+  if (show_debug_regs)
     aarch64_show_debug_reg_state (aarch64_get_debug_reg_state (),
 				  "insert_point", addr, len, targ_type);
 
@@ -1027,7 +1027,7 @@ aarch64_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
     ret =
       aarch64_handle_breakpoint (targ_type, addr, len, 0 /* is_insert */);
 
-  if (show_debug_regs > 1)
+  if (show_debug_regs)
     aarch64_show_debug_reg_state (aarch64_get_debug_reg_state (),
 				  "remove_point", addr, len, targ_type);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]