static int
aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr,
- int len, int is_insert)
+ int len, int is_insert,
+ struct aarch64_debug_reg_state *state)
{
- struct aarch64_debug_reg_state *state;
-
/* The hardware breakpoint on AArch64 should always be 4-byte
aligned. */
if (!aarch64_point_is_aligned (0 /* is_watchpoint */ , addr, len))
return -1;
- state = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
-
if (is_insert)
return aarch64_dr_state_insert_one_point (state, type, addr, len);
else
CORE_ADDR addr = bp_tgt->placed_address = bp_tgt->reqstd_address;
const int len = 4;
const enum target_hw_bp_type type = hw_execute;
+ struct aarch64_debug_reg_state *state
+ = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
if (show_debug_regs)
fprintf_unfiltered
"insert_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n",
(unsigned long) addr, len);
- ret = aarch64_handle_breakpoint (type, addr, len, 1 /* is_insert */);
+ ret = aarch64_handle_breakpoint (type, addr, len, 1 /* is_insert */, state);
if (show_debug_regs)
{
- struct aarch64_debug_reg_state *state
- = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
-
aarch64_show_debug_reg_state (state,
"insert_hw_breakpoint", addr, len, type);
}
CORE_ADDR addr = bp_tgt->placed_address;
const int len = 4;
const enum target_hw_bp_type type = hw_execute;
+ struct aarch64_debug_reg_state *state
+ = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
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 */);
+ ret = aarch64_handle_breakpoint (type, addr, len, 0 /* is_insert */, state);
if (show_debug_regs)
{
- struct aarch64_debug_reg_state *state
- = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
-
aarch64_show_debug_reg_state (state,
"remove_hw_watchpoint", addr, len, type);
}
static int
aarch64_handle_aligned_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
- int len, int is_insert)
+ int len, int is_insert,
+ struct aarch64_debug_reg_state *state)
{
- struct aarch64_debug_reg_state *state
- = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
-
if (is_insert)
return aarch64_dr_state_insert_one_point (state, type, addr, len);
else
static int
aarch64_handle_unaligned_watchpoint (int type, CORE_ADDR addr, int len,
- int is_insert)
+ int is_insert,
+ struct aarch64_debug_reg_state *state)
{
- struct aarch64_debug_reg_state *state
- = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
-
while (len > 0)
{
CORE_ADDR aligned_addr;
/* Implements insertion and removal of a single watchpoint. */
static int
-aarch64_handle_watchpoint (int type, CORE_ADDR addr, int len, int is_insert)
+aarch64_handle_watchpoint (int type, CORE_ADDR addr, int len, int is_insert,
+ struct aarch64_debug_reg_state *state)
{
if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len))
- return aarch64_handle_aligned_watchpoint (type, addr, len, is_insert);
+ return aarch64_handle_aligned_watchpoint (type, addr, len, is_insert,
+ state);
else
- return aarch64_handle_unaligned_watchpoint (type, addr, len, is_insert);
+ return aarch64_handle_unaligned_watchpoint (type, addr, len, is_insert,
+ state);
}
/* Implement the "to_insert_watchpoint" target_ops method.
struct expression *cond)
{
int ret;
+ struct aarch64_debug_reg_state *state
+ = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
if (show_debug_regs)
fprintf_unfiltered (gdb_stdlog,
gdb_assert (type != hw_execute);
- ret = aarch64_handle_watchpoint (type, addr, len, 1 /* is_insert */);
+ ret = aarch64_handle_watchpoint (type, addr, len, 1 /* is_insert */, state);
if (show_debug_regs)
{
- struct aarch64_debug_reg_state *state
- = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
-
aarch64_show_debug_reg_state (state,
"insert_watchpoint", addr, len, type);
}
struct expression *cond)
{
int ret;
+ struct aarch64_debug_reg_state *state
+ = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
if (show_debug_regs)
fprintf_unfiltered (gdb_stdlog,
gdb_assert (type != hw_execute);
- ret = aarch64_handle_watchpoint (type, addr, len, 0 /* is_insert */);
+ ret = aarch64_handle_watchpoint (type, addr, len, 0 /* is_insert */, state);
if (show_debug_regs)
{
- struct aarch64_debug_reg_state *state
- = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
-
aarch64_show_debug_reg_state (state,
"remove_watchpoint", addr, len, type);
}
static int
aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr,
- int len, int is_insert)
+ int len, int is_insert,
+ struct aarch64_debug_reg_state *state)
{
- struct aarch64_debug_reg_state *state;
-
/* The hardware breakpoint on AArch64 should always be 4-byte
aligned. */
if (!aarch64_point_is_aligned (0 /* is_watchpoint */ , addr, len))
return -1;
- state = aarch64_get_debug_reg_state ();
-
if (is_insert)
return aarch64_dr_state_insert_one_point (state, type, addr, len);
else
static int
aarch64_handle_aligned_watchpoint (enum target_hw_bp_type type,
- CORE_ADDR addr, int len, int is_insert)
+ CORE_ADDR addr, int len, int is_insert,
+ struct aarch64_debug_reg_state *state)
{
- struct aarch64_debug_reg_state *state;
-
- state = aarch64_get_debug_reg_state ();
-
if (is_insert)
return aarch64_dr_state_insert_one_point (state, type, addr, len);
else
static int
aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type,
- CORE_ADDR addr, int len, int is_insert)
+ CORE_ADDR addr, int len, int is_insert,
+ struct aarch64_debug_reg_state *state)
{
- struct aarch64_debug_reg_state *state
- = aarch64_get_debug_reg_state ();
-
while (len > 0)
{
CORE_ADDR aligned_addr;
static int
aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr,
- int len, int is_insert)
+ int len, int is_insert,
+ struct aarch64_debug_reg_state *state)
{
if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len))
- return aarch64_handle_aligned_watchpoint (type, addr, len, is_insert);
+ return aarch64_handle_aligned_watchpoint (type, addr, len, is_insert,
+ state);
else
- return aarch64_handle_unaligned_watchpoint (type, addr, len, is_insert);
+ return aarch64_handle_unaligned_watchpoint (type, addr, len, is_insert,
+ state);
}
/* Implementation of linux_target_ops method "supports_z_point_type". */
{
int ret;
enum target_hw_bp_type targ_type;
+ struct aarch64_debug_reg_state *state = aarch64_get_debug_reg_state ();
if (show_debug_regs)
fprintf (stderr, "insert_point on entry (addr=0x%08lx, len=%d)\n",
if (targ_type != hw_execute)
ret =
- aarch64_handle_watchpoint (targ_type, addr, len, 1 /* is_insert */);
+ aarch64_handle_watchpoint (targ_type, addr, len, 1 /* is_insert */,
+ state);
else
ret =
- aarch64_handle_breakpoint (targ_type, addr, len, 1 /* is_insert */);
+ aarch64_handle_breakpoint (targ_type, addr, len, 1 /* is_insert */,
+ state);
if (show_debug_regs)
aarch64_show_debug_reg_state (aarch64_get_debug_reg_state (),
{
int ret;
enum target_hw_bp_type targ_type;
+ struct aarch64_debug_reg_state *state = aarch64_get_debug_reg_state ();
if (show_debug_regs)
fprintf (stderr, "remove_point on entry (addr=0x%08lx, len=%d)\n",
/* Set up state pointers. */
if (targ_type != hw_execute)
ret =
- aarch64_handle_watchpoint (targ_type, addr, len, 0 /* is_insert */);
+ aarch64_handle_watchpoint (targ_type, addr, len, 0 /* is_insert */,
+ state);
else
ret =
- aarch64_handle_breakpoint (targ_type, addr, len, 0 /* is_insert */);
+ aarch64_handle_breakpoint (targ_type, addr, len, 0 /* is_insert */,
+ state);
if (show_debug_regs)
aarch64_show_debug_reg_state (aarch64_get_debug_reg_state (),