diff options
author | Gary Benson <gbenson@redhat.com> | 2014-09-11 11:19:56 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2014-09-11 11:19:56 +0100 |
commit | c5e92cca56da9153985d4c15dab243e383f66919 (patch) | |
tree | 92e704193346474629577b55d7ff0b80167df4f0 /gdb/gdbserver | |
parent | 3adc1a7d457d7fcdc413b970f1ed02b0925e6da8 (diff) | |
download | gdb-c5e92cca56da9153985d4c15dab243e383f66919.zip gdb-c5e92cca56da9153985d4c15dab243e383f66919.tar.gz gdb-c5e92cca56da9153985d4c15dab243e383f66919.tar.bz2 |
Introduce show_debug_regs
This commit adds a new global flag show_debug_regs to common-debug.h
to replace the flag debug_hw_points used by gdbserver and by the
Linux x86 and AArch64 ports, and to replace the flag maint_show_dr
used by the Linux MIPS port.
Note that some debug printing in the AArch64 port was enabled only if
debug_hw_points > 1 but no way to set debug_hw_points to values other
than 0 and 1 was provided; that code was effectively dead. This
commit enables all debug printing if show_debug_regs is nonzero, so
the AArch64 output will be more verbose than previously.
gdb/ChangeLog:
* common/common-debug.h (show_debug_regs): Declare.
* common/common-debug.c (show_debug_regs): Define.
* aarch64-linux-nat.c (debug_hw_points): Don't define. Replace
all uses with show_debug_regs. Replace all uses that considered
debug_hw_points as a multi-value integer with straight boolean
uses.
* x86-nat.c (debug_hw_points): Don't define. Replace all uses
with show_debug_regs.
* nat/x86-dregs.c (debug_hw_points): Don't declare. Replace
all uses with show_debug_regs.
* mips-linux-nat.c (maint_show_dr): Don't define. Replace all
uses with show_debug_regs.
gdb/gdbserver/ChangeLog:
* server.h (debug_hw_points): Don't declare.
* server.c (debug_hw_points): Don't define. Replace all uses
with show_debug_regs.
* linux-aarch64-low.c (debug_hw_points): Don't define. Replace
all uses with show_debug_regs.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/gdbserver/linux-aarch64-low.c | 19 | ||||
-rw-r--r-- | gdb/gdbserver/server.c | 7 | ||||
-rw-r--r-- | gdb/gdbserver/server.h | 1 |
4 files changed, 18 insertions, 17 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index c860daf..04410fe 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,11 @@ +2014-09-11 Gary Benson <gbenson@redhat.com> + + * server.h (debug_hw_points): Don't declare. + * server.c (debug_hw_points): Don't define. Replace all uses + with show_debug_regs. + * linux-aarch64-low.c (debug_hw_points): Don't define. Replace + all uses with show_debug_regs. + 2014-09-08 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index 6066e15..ca096b0 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -267,9 +267,6 @@ aarch64_store_fpregset (struct regcache *regcache, const void *buf) supply_register (regcache, AARCH64_V0_REGNO + i, ®set->vregs[i]); } -/* Debugging of hardware breakpoint/watchpoint support. */ -extern int debug_hw_points; - /* Enable miscellaneous debugging output. The name is historical - it was originally used to debug LinuxThreads support. */ extern int debug_threads; @@ -626,7 +623,7 @@ debug_reg_change_callback (struct inferior_list_entry *entry, void *ptr) dr_changed_t *dr_changed_ptr; dr_changed_t dr_changed; - if (debug_hw_points) + if (show_debug_regs) { fprintf (stderr, "debug_reg_change_callback: \n\tOn entry:\n"); fprintf (stderr, "\tpid%d, tid: %ld, dr_changed_bp=0x%llx, " @@ -677,7 +674,7 @@ debug_reg_change_callback (struct inferior_list_entry *entry, void *ptr) linux_stop_lwp (lwp); } - if (debug_hw_points) + if (show_debug_regs) { fprintf (stderr, "\tOn exit:\n\tpid%d, tid: %ld, dr_changed_bp=0x%llx, " "dr_changed_wp=0x%llx\n", @@ -917,7 +914,7 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, ret = aarch64_dr_state_remove_one_point (state, type, aligned_addr, aligned_len); - if (debug_hw_points) + if (show_debug_regs) fprintf (stderr, "handle_unaligned_watchpoint: is_insert: %d\n" " aligned_addr: 0x%s, aligned_len: %d\n" @@ -973,7 +970,7 @@ aarch64_insert_point (enum raw_bkpt_type type, CORE_ADDR addr, int ret; enum target_hw_bp_type targ_type; - if (debug_hw_points) + if (show_debug_regs) fprintf (stderr, "insert_point on entry (addr=0x%08lx, len=%d)\n", (unsigned long) addr, len); @@ -987,7 +984,7 @@ aarch64_insert_point (enum raw_bkpt_type type, CORE_ADDR addr, ret = aarch64_handle_breakpoint (targ_type, addr, len, 1 /* is_insert */); - if (debug_hw_points > 1) + if (show_debug_regs > 1) aarch64_show_debug_reg_state (aarch64_get_debug_reg_state (), "insert_point", addr, len, targ_type); @@ -1009,7 +1006,7 @@ aarch64_remove_point (enum raw_bkpt_type type, CORE_ADDR addr, int ret; enum target_hw_bp_type targ_type; - if (debug_hw_points) + if (show_debug_regs) fprintf (stderr, "remove_point on entry (addr=0x%08lx, len=%d)\n", (unsigned long) addr, len); @@ -1024,7 +1021,7 @@ aarch64_remove_point (enum raw_bkpt_type type, CORE_ADDR addr, ret = aarch64_handle_breakpoint (targ_type, addr, len, 0 /* is_insert */); - if (debug_hw_points > 1) + if (show_debug_regs > 1) aarch64_show_debug_reg_state (aarch64_get_debug_reg_state (), "remove_point", addr, len, targ_type); @@ -1150,7 +1147,7 @@ aarch64_linux_prepare_to_resume (struct lwp_info *lwp) struct aarch64_debug_reg_state *state = &proc->private->arch_private->debug_reg_state; - if (debug_hw_points) + if (show_debug_regs) fprintf (stderr, "prepare_to_resume thread %ld\n", lwpid_of (thread)); /* Watchpoints. */ diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 81cb2e1..8d95761 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -69,9 +69,6 @@ int disable_randomization = 1; static char **program_argv, **wrapper_argv; -/* Enable debugging of h/w breakpoint/watchpoint support. */ -int debug_hw_points; - int pass_signals[GDB_SIGNAL_LAST]; int program_signals[GDB_SIGNAL_LAST]; int program_signals_p; @@ -1012,12 +1009,12 @@ handle_monitor_command (char *mon, char *own_buf) } else if (strcmp (mon, "set debug-hw-points 1") == 0) { - debug_hw_points = 1; + show_debug_regs = 1; monitor_output ("H/W point debugging output enabled.\n"); } else if (strcmp (mon, "set debug-hw-points 0") == 0) { - debug_hw_points = 0; + show_debug_regs = 0; monitor_output ("H/W point debugging output disabled.\n"); } else if (strcmp (mon, "set remote-debug 1") == 0) diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index 812f533..ed54f77 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -82,7 +82,6 @@ extern ptid_t cont_thread; extern ptid_t general_thread; extern int server_waiting; -extern int debug_hw_points; extern int pass_signals[]; extern int program_signals[]; extern int program_signals_p; |