#include "cli/cli-script.h"
#include "gdb_assert.h"
#include "block.h"
+#include "solib.h"
#include "solist.h"
#include "observer.h"
#include "exceptions.h"
#include "gdb-events.h"
+#include "mi/mi-common.h"
/* Prototypes for local functions. */
if such is available. */
static int can_use_hw_watchpoints;
+static void
+show_can_use_hw_watchpoints (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file, _("\
+Debugger's willingness to use watchpoint hardware is %s.\n"),
+ value);
+}
+
/* If AUTO_BOOLEAN_FALSE, gdb will not attempt to create pending breakpoints.
If AUTO_BOOLEAN_TRUE, gdb will automatically create pending breakpoints
for unrecognized breakpoint locations.
If AUTO_BOOLEAN_AUTO, gdb will query when breakpoints are unrecognized. */
static enum auto_boolean pending_break_support;
+static void
+show_pending_break_support (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file, _("\
+Debugger's behavior regarding pending breakpoints is %s.\n"),
+ value);
+}
void _initialize_breakpoint (void);
shadow contents, not the breakpoints themselves. From breakpoint.c. */
int
-deprecated_read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len)
+deprecated_read_memory_nobpt (CORE_ADDR memaddr, gdb_byte *myaddr,
+ unsigned len)
{
int status;
struct bp_location *b;
if (val)
{
/* Can't set the breakpoint. */
+ if (
#if defined (DISABLE_UNSETTABLE_BREAK)
- if (DISABLE_UNSETTABLE_BREAK (bpt->address))
+ DISABLE_UNSETTABLE_BREAK (bpt->address)
+#else
+ solib_address (bpt->address)
+#endif
+ )
{
/* See also: disable_breakpoints_in_shlibs. */
val = 0;
"breakpoint #%d\n", bpt->owner->number);
}
else
-#endif
{
#ifdef ONE_PROCESS_WRITETEXT
*process_warning = 1;
|| bpt->owner->type == bp_catch_vfork
|| bpt->owner->type == bp_catch_exec)
{
- struct exception e = catch_exception (uiout, insert_catchpoint,
- bpt->owner, RETURN_MASK_ERROR);
+ struct gdb_exception e = catch_exception (uiout, insert_catchpoint,
+ bpt->owner, RETURN_MASK_ERROR);
exception_fprintf (gdb_stderr, e, "warning: inserting catchpoint %d: ",
bpt->owner->number);
if (e.reason < 0)
annotate_breakpoint (bs->breakpoint_at->number);
ui_out_text (uiout, "\nBreakpoint ");
if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string (uiout, "reason", "breakpoint-hit");
+ ui_out_field_string (uiout, "reason",
+ async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT));
ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
ui_out_text (uiout, ", ");
return PRINT_SRC_AND_LOC;
{
annotate_watchpoint (bs->breakpoint_at->number);
if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string (uiout, "reason", "watchpoint-trigger");
+ ui_out_field_string
+ (uiout, "reason",
+ async_reason_lookup (EXEC_ASYNC_WATCHPOINT_TRIGGER));
mention (bs->breakpoint_at);
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nOld value = ");
case bp_read_watchpoint:
if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string (uiout, "reason", "read-watchpoint-trigger");
+ ui_out_field_string
+ (uiout, "reason",
+ async_reason_lookup (EXEC_ASYNC_READ_WATCHPOINT_TRIGGER));
mention (bs->breakpoint_at);
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nValue = ");
{
annotate_watchpoint (bs->breakpoint_at->number);
if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
+ ui_out_field_string
+ (uiout, "reason",
+ async_reason_lookup (EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER));
mention (bs->breakpoint_at);
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nOld value = ");
{
mention (bs->breakpoint_at);
if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
+ ui_out_field_string
+ (uiout, "reason",
+ async_reason_lookup (EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER));
ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
ui_out_text (uiout, "\nValue = ");
}
case bp_finish:
if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string (uiout, "reason", "function-finished");
+ ui_out_field_string
+ (uiout, "reason",
+ async_reason_lookup (EXEC_ASYNC_FUNCTION_FINISHED));
return PRINT_UNKNOWN;
break;
will be deleted already. So we have no choice but print the
information here. */
if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string (uiout, "reason", "watchpoint-scope");
+ ui_out_field_string
+ (uiout, "reason", async_reason_lookup (EXEC_ASYNC_WATCHPOINT_SCOPE));
ui_out_text (uiout, "\nWatchpoint ");
ui_out_field_int (uiout, "wpnum", bs->breakpoint_at->number);
ui_out_text (uiout, " deleted because the program has left the block in\n\
return rc;
}
-#ifdef SOLIB_ADD
void
remove_solib_event_breakpoints (void)
{
/* See also: insert_breakpoints, under DISABLE_UNSETTABLE_BREAK. */
ALL_BREAKPOINTS (b)
{
-#if defined (PC_SOLIB)
- if (((b->type == bp_breakpoint) ||
- (b->type == bp_hardware_breakpoint)) &&
- breakpoint_enabled (b) &&
- !b->loc->duplicate &&
- PC_SOLIB (b->loc->address))
+ if (((b->type == bp_breakpoint) || (b->type == bp_hardware_breakpoint))
+ && breakpoint_enabled (b) && !b->loc->duplicate
+#ifdef PC_SOLIB
+ && PC_SOLIB (b->loc->address)
+#else
+ && solib_address (b->loc->address)
+#endif
+ )
{
b->enable_state = bp_shlib_disabled;
if (!silent)
warning (_("breakpoint #%d "), b->number);
}
}
-#endif
}
}
struct breakpoint *b;
int disabled_shlib_breaks = 0;
-#if defined (PC_SOLIB)
/* See also: insert_breakpoints, under DISABLE_UNSETTABLE_BREAK. */
ALL_BREAKPOINTS (b)
{
if ((b->loc->loc_type == bp_loc_hardware_breakpoint
|| b->loc->loc_type == bp_loc_software_breakpoint)
- && breakpoint_enabled (b)
- && !b->loc->duplicate)
+ && breakpoint_enabled (b) && !b->loc->duplicate)
{
+#ifdef PC_SOLIB
char *so_name = PC_SOLIB (b->loc->address);
- if (so_name
- && !strcmp (so_name, solib->so_name))
+#else
+ char *so_name = solib_address (b->loc->address);
+#endif
+ if (so_name && !strcmp (so_name, solib->so_name))
{
b->enable_state = bp_shlib_disabled;
/* At this point, we cannot rely on remove_breakpoint
}
}
}
-#endif
}
/* Try to reenable any breakpoints in shared libraries. */
{
if (b->enable_state == bp_shlib_disabled)
{
- char buf[1], *lib;
+ gdb_byte buf[1];
+ char *lib;
- /* Do not reenable the breakpoint if the shared library
- is still not mapped in. */
+ /* Do not reenable the breakpoint if the shared library is
+ still not mapped in. */
+#ifdef PC_SOLIB
lib = PC_SOLIB (b->loc->address);
+#else
+ lib = solib_address (b->loc->address);
+#endif
if (lib != NULL && target_read_memory (b->loc->address, buf, 1) == 0)
b->enable_state = bp_enabled;
}
}
}
-#endif
-
static void
solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname,
char *cond_string, enum bptype bp_kind)
static int
break_command_1 (char *arg, int flag, int from_tty, struct breakpoint *pending_bp)
{
- struct exception e;
+ struct gdb_exception e;
int tempflag, hardwareflag;
struct symtabs_and_lines sals;
struct expression **cond = 0;
static struct cmd_list_element *breakpoint_show_cmdlist;
struct cmd_list_element *c;
-#ifdef SOLIB_ADD
observer_attach_solib_unloaded (disable_breakpoints_in_unloaded_shlib);
-#endif
breakpoint_chain = 0;
/* Don't bother to call set_breakpoint_count. $bpnum isn't useful
_("Synonym for ``info breakpoints''."));
- c = add_set_cmd ("can-use-hw-watchpoints", class_support, var_zinteger,
- (char *) &can_use_hw_watchpoints,
- "Set debugger's willingness to use watchpoint hardware.\n\
+ /* XXX: cagney/2005-02-23: This should be a boolean, and should
+ respond to changes - contrary to the description. */
+ add_setshow_zinteger_cmd ("can-use-hw-watchpoints", class_support,
+ &can_use_hw_watchpoints, _("\
+Set debugger's willingness to use watchpoint hardware."), _("\
+Show debugger's willingness to use watchpoint hardware."), _("\
If zero, gdb will not use hardware for new watchpoints, even if\n\
such is available. (However, any hardware watchpoints that were\n\
created before setting this to nonzero, will continue to use watchpoint\n\
-hardware.)",
- &setlist);
- deprecated_add_show_from_set (c, &showlist);
+hardware.)"),
+ NULL,
+ show_can_use_hw_watchpoints,
+ &setlist, &showlist);
can_use_hw_watchpoints = 1;
pending breakpoint. If off, an unrecognized breakpoint location results in\n\
an error. If auto, an unrecognized breakpoint location results in a\n\
user-query to see if a pending breakpoint should be created."),
- NULL, /* FIXME: i18n: Debugger's behavior regarding pending breakpoints is %s. */
- NULL, NULL,
+ NULL,
+ show_pending_break_support,
&breakpoint_set_cmdlist,
&breakpoint_show_cmdlist);