#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. */
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;
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 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