+2017-10-26 Yao Qi <yao.qi@linaro.org>
+
+ * breakpoint.c (breakpoint_location_address_match): Change
+ "struct address_space *" to "const address_space".
+ (breakpoint_location_address_range_overlap): Likewise.
+ (breakpoint_here_p): Likewise.
+ (breakpoint_in_range_p): Likewise.
+ (moribund_breakpoint_here_p): Likewise.
+ (bp_location_inserted_here_p): Likewise.
+ (software_breakpoint_inserted_here_p): Likewise.
+ (hardware_breakpoint_inserted_here_p): Likewise.
+ (hardware_watchpoint_inserted_in_range): Likewise.
+ (bpstat_check_location): Likewise.
+ (bpstat_stop_status): Likewise.
+ (breakpoint_address_match): Likewise.
+ (breakpoint_address_match_range): Likewise.
+ (breakpoint_location_address_match): Likewise.
+ (breakpoint_location_address_range_overlap): Likewise.
+ (insert_single_step_breakpoint): Likewise.
+ (breakpoint_has_location_inserted_here): Likewise.
+ (single_step_breakpoint_inserted_here_p): Likewise.
+ (pc_at_non_inline_function): Likewise.
+ * breakpoint.h (bpstat_stop_status): Update declaration.
+ (breakpoint_here_p): Likewise.
+ (breakpoint_in_range_p): Likewise.
+ (moribund_breakpoint_here_p): Likewise.
+ (breakpoint_inserted_here_p): Likewise.
+ (software_breakpoint_inserted_here_p): Likewise.
+ (hardware_breakpoint_inserted_here_p): Likewise.
+ (breakpoint_has_location_inserted_here): Likewise.
+ (single_step_breakpoint_inserted_here_p): Likewise.
+ (hardware_watchpoint_inserted_in_range): Likewise.
+ (breakpoint_address_match): Likewise.
+ (insert_single_step_breakpoint): Likewise.
+ (pc_at_non_inline_function): Likewise.
+ * gdbthread.h (thread_has_single_step_breakpoint_here): Likewise.
+ * record.c (record_check_stopped_by_breakpoint): Likewise.
+ * record.h (record_check_stopped_by_breakpoint): Likewise.
+ * thread.c (thread_has_single_step_breakpoint_here): Likewise.
+
2017-10-25 Yao Qi <yao.qi@linaro.org>
* aarch32-linux-nat.c (aarch32_gp_regcache_supply): Use
struct bp_location *loc2);
static int breakpoint_location_address_match (struct bp_location *bl,
- struct address_space *aspace,
+ const struct address_space *aspace,
CORE_ADDR addr);
static int breakpoint_location_address_range_overlap (struct bp_location *,
- struct address_space *,
+ const address_space *,
CORE_ADDR, int);
static void info_breakpoints_command (char *, int);
the target, to advance the PC past the breakpoint. */
enum breakpoint_here
-breakpoint_here_p (struct address_space *aspace, CORE_ADDR pc)
+breakpoint_here_p (const address_space *aspace, CORE_ADDR pc)
{
struct bp_location *bl, **blp_tmp;
int any_breakpoint_here = 0;
/* See breakpoint.h. */
int
-breakpoint_in_range_p (struct address_space *aspace,
+breakpoint_in_range_p (const address_space *aspace,
CORE_ADDR addr, ULONGEST len)
{
struct bp_location *bl, **blp_tmp;
/* Return true if there's a moribund breakpoint at PC. */
int
-moribund_breakpoint_here_p (struct address_space *aspace, CORE_ADDR pc)
+moribund_breakpoint_here_p (const address_space *aspace, CORE_ADDR pc)
{
struct bp_location *loc;
int ix;
static int
bp_location_inserted_here_p (struct bp_location *bl,
- struct address_space *aspace, CORE_ADDR pc)
+ const address_space *aspace, CORE_ADDR pc)
{
if (bl->inserted
&& breakpoint_address_match (bl->pspace->aspace, bl->address,
/* Returns non-zero iff there's a breakpoint inserted at PC. */
int
-breakpoint_inserted_here_p (struct address_space *aspace, CORE_ADDR pc)
+breakpoint_inserted_here_p (const address_space *aspace, CORE_ADDR pc)
{
struct bp_location **blp, **blp_tmp = NULL;
inserted at PC. */
int
-software_breakpoint_inserted_here_p (struct address_space *aspace,
+software_breakpoint_inserted_here_p (const address_space *aspace,
CORE_ADDR pc)
{
struct bp_location **blp, **blp_tmp = NULL;
/* See breakpoint.h. */
int
-hardware_breakpoint_inserted_here_p (struct address_space *aspace,
+hardware_breakpoint_inserted_here_p (const address_space *aspace,
CORE_ADDR pc)
{
struct bp_location **blp, **blp_tmp = NULL;
}
int
-hardware_watchpoint_inserted_in_range (struct address_space *aspace,
+hardware_watchpoint_inserted_in_range (const address_space *aspace,
CORE_ADDR addr, ULONGEST len)
{
struct breakpoint *bpt;
static int
bpstat_check_location (const struct bp_location *bl,
- struct address_space *aspace, CORE_ADDR bp_addr,
+ const address_space *aspace, CORE_ADDR bp_addr,
const struct target_waitstatus *ws)
{
struct breakpoint *b = bl->owner;
/* BL is from an existing breakpoint. */
gdb_assert (b != NULL);
- return b->ops->breakpoint_hit (bl, aspace, bp_addr, ws);
+ return b->ops->breakpoint_hit (bl, const_cast<address_space *> (aspace),
+ bp_addr, ws);
}
/* Determine if the watched values have actually changed, and we
commands, FIXME??? fields. */
bpstat
-bpstat_stop_status (struct address_space *aspace,
+bpstat_stop_status (const address_space *aspace,
CORE_ADDR bp_addr, ptid_t ptid,
const struct target_waitstatus *ws)
{
/* See breakpoint.h. */
int
-breakpoint_address_match (struct address_space *aspace1, CORE_ADDR addr1,
- struct address_space *aspace2, CORE_ADDR addr2)
+breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1,
+ const address_space *aspace2, CORE_ADDR addr2)
{
return ((gdbarch_has_global_breakpoints (target_gdbarch ())
|| aspace1 == aspace2)
space doesn't really matter. */
static int
-breakpoint_address_match_range (struct address_space *aspace1, CORE_ADDR addr1,
- int len1, struct address_space *aspace2,
+breakpoint_address_match_range (const address_space *aspace1,
+ CORE_ADDR addr1,
+ int len1, const address_space *aspace2,
CORE_ADDR addr2)
{
return ((gdbarch_has_global_breakpoints (target_gdbarch ())
static int
breakpoint_location_address_match (struct bp_location *bl,
- struct address_space *aspace,
+ const address_space *aspace,
CORE_ADDR addr)
{
return (breakpoint_address_match (bl->pspace->aspace, bl->address,
static int
breakpoint_location_address_range_overlap (struct bp_location *bl,
- struct address_space *aspace,
+ const address_space *aspace,
CORE_ADDR addr, int len)
{
if (gdbarch_has_global_breakpoints (target_gdbarch ())
void
insert_single_step_breakpoint (struct gdbarch *gdbarch,
- struct address_space *aspace,
+ const address_space *aspace,
CORE_ADDR next_pc)
{
struct thread_info *tp = inferior_thread ();
int
breakpoint_has_location_inserted_here (struct breakpoint *bp,
- struct address_space *aspace,
+ const address_space *aspace,
CORE_ADDR pc)
{
struct bp_location *loc;
PC. */
int
-single_step_breakpoint_inserted_here_p (struct address_space *aspace,
+single_step_breakpoint_inserted_here_p (const address_space *aspace,
CORE_ADDR pc)
{
struct breakpoint *bpt;
have been inlined. */
int
-pc_at_non_inline_function (struct address_space *aspace, CORE_ADDR pc,
+pc_at_non_inline_function (const address_space *aspace, CORE_ADDR pc,
const struct target_waitstatus *ws)
{
struct breakpoint *b;
is part of the bpstat is copied as well. */
extern bpstat bpstat_copy (bpstat);
-extern bpstat bpstat_stop_status (struct address_space *aspace,
+extern bpstat bpstat_stop_status (const address_space *aspace,
CORE_ADDR pc, ptid_t ptid,
const struct target_waitstatus *ws);
\f
extern int program_breakpoint_here_p (struct gdbarch *gdbarch, CORE_ADDR address);
-extern enum breakpoint_here breakpoint_here_p (struct address_space *,
+extern enum breakpoint_here breakpoint_here_p (const address_space *,
CORE_ADDR);
/* Return true if an enabled breakpoint exists in the range defined by
ADDR and LEN, in ASPACE. */
-extern int breakpoint_in_range_p (struct address_space *aspace,
+extern int breakpoint_in_range_p (const address_space *aspace,
CORE_ADDR addr, ULONGEST len);
-extern int moribund_breakpoint_here_p (struct address_space *, CORE_ADDR);
+extern int moribund_breakpoint_here_p (const address_space *, CORE_ADDR);
-extern int breakpoint_inserted_here_p (struct address_space *, CORE_ADDR);
+extern int breakpoint_inserted_here_p (const address_space *,
+ CORE_ADDR);
extern int regular_breakpoint_inserted_here_p (struct address_space *,
CORE_ADDR);
-extern int software_breakpoint_inserted_here_p (struct address_space *,
+extern int software_breakpoint_inserted_here_p (const address_space *,
CORE_ADDR);
/* Return non-zero iff there is a hardware breakpoint inserted at
PC. */
-extern int hardware_breakpoint_inserted_here_p (struct address_space *,
+extern int hardware_breakpoint_inserted_here_p (const address_space *,
CORE_ADDR);
/* Check whether any location of BP is inserted at PC. */
extern int breakpoint_has_location_inserted_here (struct breakpoint *bp,
- struct address_space *aspace,
+ const address_space *aspace,
CORE_ADDR pc);
-extern int single_step_breakpoint_inserted_here_p (struct address_space *,
+extern int single_step_breakpoint_inserted_here_p (const address_space *,
CORE_ADDR);
/* Returns true if there's a hardware watchpoint or access watchpoint
inserted in the range defined by ADDR and LEN. */
-extern int hardware_watchpoint_inserted_in_range (struct address_space *,
+extern int hardware_watchpoint_inserted_in_range (const address_space *,
CORE_ADDR addr,
ULONGEST len);
if ASPACE1 matches ASPACE2. On targets that have global
breakpoints, the address space doesn't really matter. */
-extern int breakpoint_address_match (struct address_space *aspace1,
+extern int breakpoint_address_match (const address_space *aspace1,
CORE_ADDR addr1,
- struct address_space *aspace2,
+ const address_space *aspace2,
CORE_ADDR addr2);
extern void until_break_command (const char *, int, int);
new location to the set of potential addresses the next instruction
is at. */
extern void insert_single_step_breakpoint (struct gdbarch *,
- struct address_space *,
+ const address_space *,
CORE_ADDR);
/* Insert all software single step breakpoints for the current frame.
/* Nonzero if the specified PC cannot be a location where functions
have been inlined. */
-extern int pc_at_non_inline_function (struct address_space *aspace,
+extern int pc_at_non_inline_function (const address_space *aspace,
CORE_ADDR pc,
const struct target_waitstatus *ws);
/* Check whether the thread has software single stepping breakpoints
set at PC. */
extern int thread_has_single_step_breakpoint_here (struct thread_info *tp,
- struct address_space *aspace,
+ const address_space *aspace,
CORE_ADDR addr);
/* Translate the global integer thread id (GDB's homegrown id, not the
/* See record.h. */
int
-record_check_stopped_by_breakpoint (struct address_space *aspace, CORE_ADDR pc,
+record_check_stopped_by_breakpoint (const address_space *aspace,
+ CORE_ADDR pc,
enum target_stop_reason *reason)
{
if (breakpoint_inserted_here_p (aspace, pc))
otherwise. */
extern int
- record_check_stopped_by_breakpoint (struct address_space *aspace,
+ record_check_stopped_by_breakpoint (const address_space *aspace,
CORE_ADDR pc,
enum target_stop_reason *reason);
int
thread_has_single_step_breakpoint_here (struct thread_info *tp,
- struct address_space *aspace,
+ const address_space *aspace,
CORE_ADDR addr)
{
struct breakpoint *ss_bps = tp->control.single_step_breakpoints;