Plumb enum remove_bp_reason all the way to target_remove_breakpoint

So the target knows whether we're detaching breakpoints.
Nothing uses the parameter in this patch yet.

gdb/ChangeLog:
2016-08-10  Pedro Alves  <palves@redhat.com>

	PR gdb/19187
	* break-catch-sig.c (signal_catchpoint_remove_location): Adjust
	interface.
	* break-catch-syscall.c (remove_catch_syscall):
	* breakpoint.c (enum remove_bp_reason): Moved to breakpoint.h.
	(remove_breakpoint_1): Pass 'reason' down.
	(remove_catch_fork, remove_catch_vfork, remove_catch_solib)
	(remove_catch_exec, remove_watchpoint, remove_masked_watchpoint)
	(base_breakpoint_remove_location, bkpt_remove_location)
	(bkpt_probe_remove_location, bkpt_probe_remove_location): Adjust
	interface.
	* breakpoint.h (enum remove_bp_reason): Moved here from
	breakpoint.c.
	(struct breakpoint_ops) <remove_location>: Add 'reason' parameter.
	* corelow.c (core_remove_breakpoint): New function.
	(init_core_ops): Install it as to_remove_breakpoint method.
	* exec.c (exec_remove_breakpoint): New function.
	(init_exec_ops): Install it as to_remove_breakpoint method.
	* mem-break.c (memory_remove_breakpoint): Adjust interface.
	* record-btrace.c (record_btrace_remove_breakpoint): Adjust
	interface.
	* record-full.c (record_full_remove_breakpoint)
	(record_full_core_remove_breakpoint): Adjust interface.
	* remote.c (remote_remove_breakpoint): Adjust interface.
	* target-debug.h (target_debug_print_enum_remove_bp_reason): New
	macro.
	* target-delegates.c: Regenerate.
	* target.c (target_remove_breakpoint): Add 'reason' parameter.
	* target.h (struct target_ops) <to_remove_breakpoint>: Add
	'reason' parameter.
	(target_remove_breakpoint, memory_remove_breakpoint): Add 'reason'
	parameter.
This commit is contained in:
Pedro Alves
2016-08-10 23:03:29 +01:00
parent b2b6a7dab9
commit 7397181903
16 changed files with 125 additions and 51 deletions

View File

@ -1,3 +1,38 @@
2016-08-10 Pedro Alves <palves@redhat.com>
PR gdb/19187
* break-catch-sig.c (signal_catchpoint_remove_location): Adjust
interface.
* break-catch-syscall.c (remove_catch_syscall):
* breakpoint.c (enum remove_bp_reason): Moved to breakpoint.h.
(remove_breakpoint_1): Pass 'reason' down.
(remove_catch_fork, remove_catch_vfork, remove_catch_solib)
(remove_catch_exec, remove_watchpoint, remove_masked_watchpoint)
(base_breakpoint_remove_location, bkpt_remove_location)
(bkpt_probe_remove_location, bkpt_probe_remove_location): Adjust
interface.
* breakpoint.h (enum remove_bp_reason): Moved here from
breakpoint.c.
(struct breakpoint_ops) <remove_location>: Add 'reason' parameter.
* corelow.c (core_remove_breakpoint): New function.
(init_core_ops): Install it as to_remove_breakpoint method.
* exec.c (exec_remove_breakpoint): New function.
(init_exec_ops): Install it as to_remove_breakpoint method.
* mem-break.c (memory_remove_breakpoint): Adjust interface.
* record-btrace.c (record_btrace_remove_breakpoint): Adjust
interface.
* record-full.c (record_full_remove_breakpoint)
(record_full_core_remove_breakpoint): Adjust interface.
* remote.c (remote_remove_breakpoint): Adjust interface.
* target-debug.h (target_debug_print_enum_remove_bp_reason): New
macro.
* target-delegates.c: Regenerate.
* target.c (target_remove_breakpoint): Add 'reason' parameter.
* target.h (struct target_ops) <to_remove_breakpoint>: Add
'reason' parameter.
(target_remove_breakpoint, memory_remove_breakpoint): Add 'reason'
parameter.
2016-08-10 Pedro Alves <palves@redhat.com> 2016-08-10 Pedro Alves <palves@redhat.com>
PR gdb/19187 PR gdb/19187

View File

@ -137,7 +137,8 @@ signal_catchpoint_insert_location (struct bp_location *bl)
catchpoints. */ catchpoints. */
static int static int
signal_catchpoint_remove_location (struct bp_location *bl) signal_catchpoint_remove_location (struct bp_location *bl,
enum remove_bp_reason reason)
{ {
struct signal_catchpoint *c = (struct signal_catchpoint *) bl->owner; struct signal_catchpoint *c = (struct signal_catchpoint *) bl->owner;
int i; int i;

View File

@ -158,7 +158,7 @@ insert_catch_syscall (struct bp_location *bl)
catchpoints. */ catchpoints. */
static int static int
remove_catch_syscall (struct bp_location *bl) remove_catch_syscall (struct bp_location *bl, enum remove_bp_reason reason)
{ {
struct syscall_catchpoint *c = (struct syscall_catchpoint *) bl->owner; struct syscall_catchpoint *c = (struct syscall_catchpoint *) bl->owner;
struct inferior *inf = current_inferior (); struct inferior *inf = current_inferior ();

View File

@ -194,18 +194,6 @@ static void commands_command (char *, int);
static void condition_command (char *, int); static void condition_command (char *, int);
/* Why are we removing the breakpoint from the target? */
enum remove_bp_reason
{
/* A regular remove. Remove the breakpoint and forget everything
about it. */
REMOVE_BREAKPOINT,
/* Detach the breakpoints from a fork child. */
DETACH_BREAKPOINT,
};
static int remove_breakpoint (struct bp_location *); static int remove_breakpoint (struct bp_location *);
static int remove_breakpoint_1 (struct bp_location *, enum remove_bp_reason); static int remove_breakpoint_1 (struct bp_location *, enum remove_bp_reason);
@ -3996,7 +3984,7 @@ remove_breakpoint_1 (struct bp_location *bl, enum remove_bp_reason reason)
&& !memory_validate_breakpoint (bl->gdbarch, &bl->target_info)) && !memory_validate_breakpoint (bl->gdbarch, &bl->target_info))
val = 0; val = 0;
else else
val = bl->owner->ops->remove_location (bl); val = bl->owner->ops->remove_location (bl, reason);
} }
else else
{ {
@ -4014,7 +4002,8 @@ remove_breakpoint_1 (struct bp_location *bl, enum remove_bp_reason reason)
&bl->overlay_target_info); &bl->overlay_target_info);
else else
target_remove_breakpoint (bl->gdbarch, target_remove_breakpoint (bl->gdbarch,
&bl->overlay_target_info); &bl->overlay_target_info,
reason);
} }
/* Did we set a breakpoint at the VMA? /* Did we set a breakpoint at the VMA?
If so, we will have marked the breakpoint 'inserted'. */ If so, we will have marked the breakpoint 'inserted'. */
@ -4030,7 +4019,7 @@ remove_breakpoint_1 (struct bp_location *bl, enum remove_bp_reason reason)
wrong code with the saved shadow contents. */ wrong code with the saved shadow contents. */
if (bl->loc_type == bp_loc_hardware_breakpoint if (bl->loc_type == bp_loc_hardware_breakpoint
|| section_is_mapped (bl->section)) || section_is_mapped (bl->section))
val = bl->owner->ops->remove_location (bl); val = bl->owner->ops->remove_location (bl, reason);
else else
val = 0; val = 0;
} }
@ -4068,7 +4057,7 @@ remove_breakpoint_1 (struct bp_location *bl, enum remove_bp_reason reason)
&& bl->owner->ops->remove_location != NULL); && bl->owner->ops->remove_location != NULL);
bl->inserted = (reason == DETACH_BREAKPOINT); bl->inserted = (reason == DETACH_BREAKPOINT);
bl->owner->ops->remove_location (bl); bl->owner->ops->remove_location (bl, reason);
/* Failure to remove any of the hardware watchpoints comes here. */ /* Failure to remove any of the hardware watchpoints comes here. */
if (reason == REMOVE_BREAKPOINT && bl->inserted) if (reason == REMOVE_BREAKPOINT && bl->inserted)
@ -4082,7 +4071,7 @@ remove_breakpoint_1 (struct bp_location *bl, enum remove_bp_reason reason)
gdb_assert (bl->owner->ops != NULL gdb_assert (bl->owner->ops != NULL
&& bl->owner->ops->remove_location != NULL); && bl->owner->ops->remove_location != NULL);
val = bl->owner->ops->remove_location (bl); val = bl->owner->ops->remove_location (bl, reason);
if (val) if (val)
return val; return val;
@ -8120,7 +8109,7 @@ insert_catch_fork (struct bp_location *bl)
catchpoints. */ catchpoints. */
static int static int
remove_catch_fork (struct bp_location *bl) remove_catch_fork (struct bp_location *bl, enum remove_bp_reason reason)
{ {
return target_remove_fork_catchpoint (ptid_get_pid (inferior_ptid)); return target_remove_fork_catchpoint (ptid_get_pid (inferior_ptid));
} }
@ -8238,7 +8227,7 @@ insert_catch_vfork (struct bp_location *bl)
catchpoints. */ catchpoints. */
static int static int
remove_catch_vfork (struct bp_location *bl) remove_catch_vfork (struct bp_location *bl, enum remove_bp_reason reason)
{ {
return target_remove_vfork_catchpoint (ptid_get_pid (inferior_ptid)); return target_remove_vfork_catchpoint (ptid_get_pid (inferior_ptid));
} }
@ -8381,7 +8370,7 @@ insert_catch_solib (struct bp_location *ignore)
} }
static int static int
remove_catch_solib (struct bp_location *ignore) remove_catch_solib (struct bp_location *ignore, enum remove_bp_reason reason)
{ {
return 0; return 0;
} }
@ -8711,7 +8700,7 @@ insert_catch_exec (struct bp_location *bl)
} }
static int static int
remove_catch_exec (struct bp_location *bl) remove_catch_exec (struct bp_location *bl, enum remove_bp_reason reason)
{ {
return target_remove_exec_catchpoint (ptid_get_pid (inferior_ptid)); return target_remove_exec_catchpoint (ptid_get_pid (inferior_ptid));
} }
@ -10720,7 +10709,7 @@ insert_watchpoint (struct bp_location *bl)
/* Implement the "remove" breakpoint_ops method for hardware watchpoints. */ /* Implement the "remove" breakpoint_ops method for hardware watchpoints. */
static int static int
remove_watchpoint (struct bp_location *bl) remove_watchpoint (struct bp_location *bl, enum remove_bp_reason reason)
{ {
struct watchpoint *w = (struct watchpoint *) bl->owner; struct watchpoint *w = (struct watchpoint *) bl->owner;
int length = w->exact ? 1 : bl->length; int length = w->exact ? 1 : bl->length;
@ -10975,7 +10964,7 @@ insert_masked_watchpoint (struct bp_location *bl)
masked hardware watchpoints. */ masked hardware watchpoints. */
static int static int
remove_masked_watchpoint (struct bp_location *bl) remove_masked_watchpoint (struct bp_location *bl, enum remove_bp_reason reason)
{ {
struct watchpoint *w = (struct watchpoint *) bl->owner; struct watchpoint *w = (struct watchpoint *) bl->owner;
@ -12971,7 +12960,8 @@ base_breakpoint_insert_location (struct bp_location *bl)
} }
static int static int
base_breakpoint_remove_location (struct bp_location *bl) base_breakpoint_remove_location (struct bp_location *bl,
enum remove_bp_reason reason)
{ {
internal_error_pure_virtual_called (); internal_error_pure_virtual_called ();
} }
@ -13133,12 +13123,12 @@ bkpt_insert_location (struct bp_location *bl)
} }
static int static int
bkpt_remove_location (struct bp_location *bl) bkpt_remove_location (struct bp_location *bl, enum remove_bp_reason reason)
{ {
if (bl->loc_type == bp_loc_hardware_breakpoint) if (bl->loc_type == bp_loc_hardware_breakpoint)
return target_remove_hw_breakpoint (bl->gdbarch, &bl->target_info); return target_remove_hw_breakpoint (bl->gdbarch, &bl->target_info);
else else
return target_remove_breakpoint (bl->gdbarch, &bl->target_info); return target_remove_breakpoint (bl->gdbarch, &bl->target_info, reason);
} }
static int static int
@ -13481,7 +13471,8 @@ bkpt_probe_insert_location (struct bp_location *bl)
} }
static int static int
bkpt_probe_remove_location (struct bp_location *bl) bkpt_probe_remove_location (struct bp_location *bl,
enum remove_bp_reason reason)
{ {
/* Let's clear the semaphore before removing the location. */ /* Let's clear the semaphore before removing the location. */
if (bl->probe.probe->pops->clear_semaphore != NULL) if (bl->probe.probe->pops->clear_semaphore != NULL)
@ -13489,7 +13480,7 @@ bkpt_probe_remove_location (struct bp_location *bl)
bl->probe.objfile, bl->probe.objfile,
bl->gdbarch); bl->gdbarch);
return bkpt_remove_location (bl); return bkpt_remove_location (bl, reason);
} }
static void static void

View File

@ -39,6 +39,18 @@ struct linespec_result;
struct linespec_sals; struct linespec_sals;
struct event_location; struct event_location;
/* Why are we removing the breakpoint from the target? */
enum remove_bp_reason
{
/* A regular remove. Remove the breakpoint and forget everything
about it. */
REMOVE_BREAKPOINT,
/* Detach the breakpoints from a fork child. */
DETACH_BREAKPOINT,
};
/* This is the maximum number of bytes a breakpoint instruction can /* This is the maximum number of bytes a breakpoint instruction can
take. Feel free to increase it. It's just used in a few places to take. Feel free to increase it. It's just used in a few places to
size arrays that should be independent of the target size arrays that should be independent of the target
@ -519,7 +531,7 @@ struct breakpoint_ops
with the "insert" method above. Return 0 for success, 1 if the with the "insert" method above. Return 0 for success, 1 if the
breakpoint, watchpoint or catchpoint type is not supported, breakpoint, watchpoint or catchpoint type is not supported,
-1 for failure. */ -1 for failure. */
int (*remove_location) (struct bp_location *); int (*remove_location) (struct bp_location *, enum remove_bp_reason reason);
/* Return true if it the target has stopped due to hitting /* Return true if it the target has stopped due to hitting
breakpoint location BL. This function does not check if we breakpoint location BL. This function does not check if we

View File

@ -920,6 +920,16 @@ ignore (struct target_ops *ops, struct gdbarch *gdbarch,
return 0; return 0;
} }
/* Implement the to_remove_breakpoint method. */
static int
core_remove_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt,
enum remove_bp_reason reason)
{
return 0;
}
/* Okay, let's be honest: threads gleaned from a core file aren't /* Okay, let's be honest: threads gleaned from a core file aren't
exactly lively, are they? On the other hand, if we don't claim exactly lively, are they? On the other hand, if we don't claim
@ -1043,7 +1053,7 @@ init_core_ops (void)
core_ops.to_xfer_partial = core_xfer_partial; core_ops.to_xfer_partial = core_xfer_partial;
core_ops.to_files_info = core_files_info; core_ops.to_files_info = core_files_info;
core_ops.to_insert_breakpoint = ignore; core_ops.to_insert_breakpoint = ignore;
core_ops.to_remove_breakpoint = ignore; core_ops.to_remove_breakpoint = core_remove_breakpoint;
core_ops.to_thread_alive = core_thread_alive; core_ops.to_thread_alive = core_thread_alive;
core_ops.to_read_description = core_read_description; core_ops.to_read_description = core_read_description;
core_ops.to_pid_to_str = core_pid_to_str; core_ops.to_pid_to_str = core_pid_to_str;

View File

@ -1075,6 +1075,16 @@ ignore (struct target_ops *ops, struct gdbarch *gdbarch,
return 0; return 0;
} }
/* Implement the to_remove_breakpoint method. */
static int
exec_remove_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt,
enum remove_bp_reason reason)
{
return 0;
}
static int static int
exec_has_memory (struct target_ops *ops) exec_has_memory (struct target_ops *ops)
{ {
@ -1106,7 +1116,7 @@ Specify the filename of the executable file.";
exec_ops.to_get_section_table = exec_get_section_table; exec_ops.to_get_section_table = exec_get_section_table;
exec_ops.to_files_info = exec_files_info; exec_ops.to_files_info = exec_files_info;
exec_ops.to_insert_breakpoint = ignore; exec_ops.to_insert_breakpoint = ignore;
exec_ops.to_remove_breakpoint = ignore; exec_ops.to_remove_breakpoint = exec_remove_breakpoint;
exec_ops.to_stratum = file_stratum; exec_ops.to_stratum = file_stratum;
exec_ops.to_has_memory = exec_has_memory; exec_ops.to_has_memory = exec_has_memory;
exec_ops.to_make_corefile_notes = exec_make_note_section; exec_ops.to_make_corefile_notes = exec_make_note_section;

View File

@ -93,7 +93,8 @@ memory_insert_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch,
int int
memory_remove_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch, memory_remove_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt) struct bp_target_info *bp_tgt,
enum remove_bp_reason reason)
{ {
return gdbarch_memory_remove_breakpoint (gdbarch, bp_tgt); return gdbarch_memory_remove_breakpoint (gdbarch, bp_tgt);
} }

View File

@ -1004,7 +1004,8 @@ procfs_insert_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch,
static int static int
procfs_remove_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch, procfs_remove_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt) struct bp_target_info *bp_tgt,
enum remove_bp_reason reason)
{ {
return procfs_breakpoint (bp_tgt->placed_address, _DEBUG_BREAK_EXEC, -1); return procfs_breakpoint (bp_tgt->placed_address, _DEBUG_BREAK_EXEC, -1);
} }

View File

@ -1433,7 +1433,8 @@ record_btrace_insert_breakpoint (struct target_ops *ops,
static int static int
record_btrace_remove_breakpoint (struct target_ops *ops, record_btrace_remove_breakpoint (struct target_ops *ops,
struct gdbarch *gdbarch, struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt) struct bp_target_info *bp_tgt,
enum remove_bp_reason reason)
{ {
const char *old; const char *old;
int ret; int ret;
@ -1446,7 +1447,8 @@ record_btrace_remove_breakpoint (struct target_ops *ops,
ret = 0; ret = 0;
TRY TRY
{ {
ret = ops->beneath->to_remove_breakpoint (ops->beneath, gdbarch, bp_tgt); ret = ops->beneath->to_remove_breakpoint (ops->beneath, gdbarch, bp_tgt,
reason);
} }
CATCH (except, RETURN_MASK_ALL) CATCH (except, RETURN_MASK_ALL)
{ {

View File

@ -1703,7 +1703,8 @@ record_full_insert_breakpoint (struct target_ops *ops,
static int static int
record_full_remove_breakpoint (struct target_ops *ops, record_full_remove_breakpoint (struct target_ops *ops,
struct gdbarch *gdbarch, struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt) struct bp_target_info *bp_tgt,
enum remove_bp_reason reason)
{ {
struct record_full_breakpoint *bp; struct record_full_breakpoint *bp;
int ix; int ix;
@ -1723,7 +1724,7 @@ record_full_remove_breakpoint (struct target_ops *ops,
old_cleanups = record_full_gdb_operation_disable_set (); old_cleanups = record_full_gdb_operation_disable_set ();
ret = ops->beneath->to_remove_breakpoint (ops->beneath, gdbarch, ret = ops->beneath->to_remove_breakpoint (ops->beneath, gdbarch,
bp_tgt); bp_tgt, reason);
do_cleanups (old_cleanups); do_cleanups (old_cleanups);
if (ret != 0) if (ret != 0)
@ -2190,7 +2191,8 @@ record_full_core_insert_breakpoint (struct target_ops *ops,
static int static int
record_full_core_remove_breakpoint (struct target_ops *ops, record_full_core_remove_breakpoint (struct target_ops *ops,
struct gdbarch *gdbarch, struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt) struct bp_target_info *bp_tgt,
enum remove_bp_reason reason)
{ {
return 0; return 0;
} }

View File

@ -9335,7 +9335,8 @@ Target doesn't support breakpoints that have target side commands."));
static int static int
remote_remove_breakpoint (struct target_ops *ops, remote_remove_breakpoint (struct target_ops *ops,
struct gdbarch *gdbarch, struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt) struct bp_target_info *bp_tgt,
enum remove_bp_reason reason)
{ {
CORE_ADDR addr = bp_tgt->placed_address; CORE_ADDR addr = bp_tgt->placed_address;
struct remote_state *rs = get_remote_state (); struct remote_state *rs = get_remote_state ();
@ -9364,7 +9365,7 @@ remote_remove_breakpoint (struct target_ops *ops,
return (rs->buf[0] == 'E'); return (rs->buf[0] == 'E');
} }
return memory_remove_breakpoint (ops, gdbarch, bp_tgt); return memory_remove_breakpoint (ops, gdbarch, bp_tgt, reason);
} }
static enum Z_packet_type static enum Z_packet_type

View File

@ -158,6 +158,8 @@
target_debug_do_print (plongest (X)) target_debug_do_print (plongest (X))
#define target_debug_print_struct_inferior_p(X) \ #define target_debug_print_struct_inferior_p(X) \
target_debug_do_print (host_address_to_string (X)) target_debug_do_print (host_address_to_string (X))
#define target_debug_print_enum_remove_bp_reason(X) \
target_debug_do_print (plongest (X))
static void static void
target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status) target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)

View File

@ -262,24 +262,26 @@ debug_insert_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct b
} }
static int static int
delegate_remove_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2) delegate_remove_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2, enum remove_bp_reason arg3)
{ {
self = self->beneath; self = self->beneath;
return self->to_remove_breakpoint (self, arg1, arg2); return self->to_remove_breakpoint (self, arg1, arg2, arg3);
} }
static int static int
debug_remove_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2) debug_remove_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2, enum remove_bp_reason arg3)
{ {
int result; int result;
fprintf_unfiltered (gdb_stdlog, "-> %s->to_remove_breakpoint (...)\n", debug_target.to_shortname); fprintf_unfiltered (gdb_stdlog, "-> %s->to_remove_breakpoint (...)\n", debug_target.to_shortname);
result = debug_target.to_remove_breakpoint (&debug_target, arg1, arg2); result = debug_target.to_remove_breakpoint (&debug_target, arg1, arg2, arg3);
fprintf_unfiltered (gdb_stdlog, "<- %s->to_remove_breakpoint (", debug_target.to_shortname); fprintf_unfiltered (gdb_stdlog, "<- %s->to_remove_breakpoint (", debug_target.to_shortname);
target_debug_print_struct_target_ops_p (&debug_target); target_debug_print_struct_target_ops_p (&debug_target);
fputs_unfiltered (", ", gdb_stdlog); fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_struct_gdbarch_p (arg1); target_debug_print_struct_gdbarch_p (arg1);
fputs_unfiltered (", ", gdb_stdlog); fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_struct_bp_target_info_p (arg2); target_debug_print_struct_bp_target_info_p (arg2);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_enum_remove_bp_reason (arg3);
fputs_unfiltered (") = ", gdb_stdlog); fputs_unfiltered (") = ", gdb_stdlog);
target_debug_print_int (result); target_debug_print_int (result);
fputs_unfiltered ("\n", gdb_stdlog); fputs_unfiltered ("\n", gdb_stdlog);

View File

@ -2113,7 +2113,8 @@ target_insert_breakpoint (struct gdbarch *gdbarch,
int int
target_remove_breakpoint (struct gdbarch *gdbarch, target_remove_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt) struct bp_target_info *bp_tgt,
enum remove_bp_reason reason)
{ {
/* This is kind of a weird case to handle, but the permission might /* This is kind of a weird case to handle, but the permission might
have been changed after breakpoints were inserted - in which case have been changed after breakpoints were inserted - in which case
@ -2126,7 +2127,7 @@ target_remove_breakpoint (struct gdbarch *gdbarch,
} }
return current_target.to_remove_breakpoint (&current_target, return current_target.to_remove_breakpoint (&current_target,
gdbarch, bp_tgt); gdbarch, bp_tgt, reason);
} }
static void static void

View File

@ -478,7 +478,8 @@ struct target_ops
struct bp_target_info *) struct bp_target_info *)
TARGET_DEFAULT_FUNC (memory_insert_breakpoint); TARGET_DEFAULT_FUNC (memory_insert_breakpoint);
int (*to_remove_breakpoint) (struct target_ops *, struct gdbarch *, int (*to_remove_breakpoint) (struct target_ops *, struct gdbarch *,
struct bp_target_info *) struct bp_target_info *,
enum remove_bp_reason)
TARGET_DEFAULT_FUNC (memory_remove_breakpoint); TARGET_DEFAULT_FUNC (memory_remove_breakpoint);
/* Returns true if the target stopped because it executed a /* Returns true if the target stopped because it executed a
@ -1507,7 +1508,8 @@ extern int target_insert_breakpoint (struct gdbarch *gdbarch,
machine. Result is 0 for success, non-zero for error. */ machine. Result is 0 for success, non-zero for error. */
extern int target_remove_breakpoint (struct gdbarch *gdbarch, extern int target_remove_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt); struct bp_target_info *bp_tgt,
enum remove_bp_reason reason);
/* Returns true if the terminal settings of the inferior are in /* Returns true if the terminal settings of the inferior are in
effect. */ effect. */
@ -2373,7 +2375,8 @@ extern struct target_section_table *target_get_section_table
/* From mem-break.c */ /* From mem-break.c */
extern int memory_remove_breakpoint (struct target_ops *, struct gdbarch *, extern int memory_remove_breakpoint (struct target_ops *, struct gdbarch *,
struct bp_target_info *); struct bp_target_info *,
enum remove_bp_reason);
extern int memory_insert_breakpoint (struct target_ops *, struct gdbarch *, extern int memory_insert_breakpoint (struct target_ops *, struct gdbarch *,
struct bp_target_info *); struct bp_target_info *);