+2014-09-11 Gary Benson <gbenson@redhat.com>
+
+ * 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.
+
2014-09-10 Ulrich Weigand <uweigand@de.ibm.com>
* findvar.c (address_from_register): Handle targets requiring
static int aarch64_num_bp_regs;
static int aarch64_num_wp_regs;
-/* Debugging of hardware breakpoint/watchpoint support. */
-
-static int debug_hw_points;
-
/* Each bit of a variable of this type is used to indicate whether a
hardware breakpoint or watchpoint setting has been changed since
the last update.
if (info == NULL)
info = lwp->arch_private = XCNEW (struct arch_lwp_info);
- if (debug_hw_points)
+ if (show_debug_regs)
{
fprintf_unfiltered (gdb_stdlog,
"debug_reg_change_callback: \n\tOn entry:\n");
if (!lwp->stopped)
linux_stop_lwp (lwp);
- if (debug_hw_points)
+ if (show_debug_regs)
{
fprintf_unfiltered (gdb_stdlog,
"\tOn exit:\n\tpid%d, dr_changed_bp=0x%s, "
struct aarch64_debug_reg_state *state
= aarch64_get_debug_reg_state (ptid_get_pid (lwp->ptid));
- if (debug_hw_points)
+ if (show_debug_regs)
fprintf_unfiltered (gdb_stdlog, "prepare_to_resume thread %d\n", tid);
/* Watchpoints. */
const int len = 4;
const int type = hw_execute;
- if (debug_hw_points)
+ if (show_debug_regs)
fprintf_unfiltered
(gdb_stdlog,
"insert_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n",
ret = aarch64_handle_breakpoint (type, addr, len, 1 /* is_insert */);
- if (debug_hw_points > 1)
+ if (show_debug_regs)
{
struct aarch64_debug_reg_state *state
= aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
const int len = 4;
const int type = hw_execute;
- if (debug_hw_points)
+ if (show_debug_regs)
fprintf_unfiltered
(gdb_stdlog, "remove_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n",
(unsigned long) addr, len);
ret = aarch64_handle_breakpoint (type, addr, len, 0 /* is_insert */);
- if (debug_hw_points > 1)
+ if (show_debug_regs)
{
struct aarch64_debug_reg_state *state
= aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
ret = aarch64_dr_state_remove_one_point (state, type, aligned_addr,
aligned_len);
- if (debug_hw_points)
+ if (show_debug_regs)
fprintf_unfiltered (gdb_stdlog,
"handle_unaligned_watchpoint: is_insert: %d\n"
" aligned_addr: 0x%08lx, aligned_len: %d\n"
{
int ret;
- if (debug_hw_points)
+ if (show_debug_regs)
fprintf_unfiltered (gdb_stdlog,
"insert_watchpoint on entry (addr=0x%08lx, len=%d)\n",
(unsigned long) addr, len);
ret = aarch64_handle_watchpoint (type, addr, len, 1 /* is_insert */);
- if (debug_hw_points > 1)
+ if (show_debug_regs)
{
struct aarch64_debug_reg_state *state
= aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
{
int ret;
- if (debug_hw_points)
+ if (show_debug_regs)
fprintf_unfiltered (gdb_stdlog,
"remove_watchpoint on entry (addr=0x%08lx, len=%d)\n",
(unsigned long) addr, len);
ret = aarch64_handle_watchpoint (type, addr, len, 0 /* is_insert */);
- if (debug_hw_points > 1)
+ if (show_debug_regs)
{
struct aarch64_debug_reg_state *state
= aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
/* A maintenance command to enable printing the internal DRi mirror
variables. */
add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
- &debug_hw_points, _("\
+ &show_debug_regs, _("\
Set whether to show variables that mirror the AArch64 debug registers."), _("\
Show whether to show variables that mirror the AArch64 debug registers."), _("\
Use \"on\" to enable, \"off\" to disable.\n\
/* See common/common-debug.h. */
+int show_debug_regs;
+
+/* See common/common-debug.h. */
+
void
debug_printf (const char *fmt, ...)
{
#ifndef COMMON_DEBUG_H
#define COMMON_DEBUG_H
+/* Set to nonzero to enable debugging of hardware breakpoint/
+ watchpoint support code. */
+
+extern int show_debug_regs;
+
/* Print a formatted message to the appropriate channel for
debugging output for the client. */
+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
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;
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, "
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",
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"
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);
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);
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);
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);
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. */
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;
}
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)
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;
we'll clear this and use PTRACE_PEEKUSER instead. */
static int have_ptrace_regsets = 1;
-/* Whether or not to print the mirrored debug registers. */
-
-static int maint_show_dr;
-
/* Saved function pointers to fetch and store a single register using
PTRACE_PEEKUSER and PTRACE_POKEUSER. */
watch_mirror = regs;
retval = write_watchpoint_regs ();
- if (maint_show_dr)
+ if (show_debug_regs)
mips_show_dr ("insert_watchpoint", addr, len, type);
return retval;
retval = write_watchpoint_regs ();
- if (maint_show_dr)
+ if (show_debug_regs)
mips_show_dr ("remove_watchpoint", addr, len, type);
return retval;
struct target_ops *t;
add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
- &maint_show_dr, _("\
+ &show_debug_regs, _("\
Set whether to show variables that mirror the mips debug registers."), _("\
Show whether to show variables that mirror the mips debug registers."), _("\
Use \"on\" to enable, \"off\" to disable.\n\
/* Types of operations supported by x86_handle_nonaligned_watchpoint. */
typedef enum { WP_INSERT, WP_REMOVE, WP_COUNT } x86_wp_op_t;
-#ifndef GDBSERVER
-/* Whether or not to print the mirrored debug registers. */
-extern int debug_hw_points;
-#endif
-
/* Print the values of the mirrored debug registers. */
static void
if (retval == 0)
x86_update_inferior_debug_regs (state, &local_state);
- if (debug_hw_points)
+ if (show_debug_regs)
x86_show_dr (state, "insert_watchpoint", addr, len, type);
return retval;
if (retval == 0)
x86_update_inferior_debug_regs (state, &local_state);
- if (debug_hw_points)
+ if (show_debug_regs)
x86_show_dr (state, "remove_watchpoint", addr, len, type);
return retval;
{
addr = x86_dr_low_get_addr (i);
rc = 1;
- if (debug_hw_points)
+ if (show_debug_regs)
x86_show_dr (state, "watchpoint_hit", addr, -1, hw_write);
}
}
- if (debug_hw_points && addr == 0)
+ if (show_debug_regs && addr == 0)
x86_show_dr (state, "stopped_data_addr", 0, 0, hw_write);
if (rc)
The functions below implement debug registers sharing by reference
counts, and allow to watch regions up to 16 bytes long. */
-/* Whether or not to print the mirrored debug registers. */
-int debug_hw_points;
-
/* Low-level function vector. */
struct x86_dr_low_type x86_dr_low;
/* A maintenance command to enable printing the internal DRi mirror
variables. */
add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
- &debug_hw_points, _("\
+ &show_debug_regs, _("\
Set whether to show variables that mirror the x86 debug registers."), _("\
Show whether to show variables that mirror the x86 debug registers."), _("\
Use \"on\" to enable, \"off\" to disable.\n\