* infrun.c (normal_stop, proceed): Remove call to print_sys_errmsg
when breakpoints fail. Move general breakpoint error messages to insert_breakpoints. * breakpoint.c (insert_breakpoints): Change warnings when breakpoints are nto inserted to specify the type. Remove call to memory_error when hardware breakpoints can't be inserted. Remove multiple calls to warning so all messages are sent to the user at once. (delete_breakpoints): Make insert error messsages more explicit.
This commit is contained in:
parent
0312286c94
commit
81d0cc192b
@ -1,3 +1,15 @@
|
|||||||
|
2002-08-23 Grace Sainsbury <graces@redhat.com>
|
||||||
|
|
||||||
|
* infrun.c (normal_stop, proceed): Remove call to print_sys_errmsg
|
||||||
|
when breakpoints fail. Move general breakpoint error messages to
|
||||||
|
insert_breakpoints.
|
||||||
|
* breakpoint.c (insert_breakpoints): Change warnings when
|
||||||
|
breakpoints are nto inserted to specify the type. Remove call to
|
||||||
|
memory_error when hardware breakpoints can't be inserted. Remove
|
||||||
|
multiple calls to warning so all messages are sent to the user at
|
||||||
|
once.
|
||||||
|
(delete_breakpoints): Make insert error messsages more explicit.
|
||||||
|
|
||||||
2002-08-23 Daniel Jacobowitz <drow@mvista.com>
|
2002-08-23 Daniel Jacobowitz <drow@mvista.com>
|
||||||
|
|
||||||
* ChangeLog: Move gdbserver entries after GDB 5.2 to
|
* ChangeLog: Move gdbserver entries after GDB 5.2 to
|
||||||
@ -65,6 +77,7 @@
|
|||||||
i960-*-vxworks* obsolete.
|
i960-*-vxworks* obsolete.
|
||||||
* MAINTAINERS: Note that the i960 is obsolete.
|
* MAINTAINERS: Note that the i960 is obsolete.
|
||||||
|
|
||||||
|
>>>>>>> 1.3141
|
||||||
2002-08-21 Corinna Vinschen <vinschen@redhat.com
|
2002-08-21 Corinna Vinschen <vinschen@redhat.com
|
||||||
|
|
||||||
* aix-thread.c (aix_thread_detach): Disable thread debugging on
|
* aix-thread.c (aix_thread_detach): Disable thread debugging on
|
||||||
@ -95,6 +108,7 @@
|
|||||||
* config/mips/tm-mips.h (DEFAULT_MIPS_TYPE): Delete unused macro.
|
* config/mips/tm-mips.h (DEFAULT_MIPS_TYPE): Delete unused macro.
|
||||||
* config/mips/tm-embed.h (DEFAULT_MIPS_TYPE): Delete unused macro.
|
* config/mips/tm-embed.h (DEFAULT_MIPS_TYPE): Delete unused macro.
|
||||||
|
|
||||||
|
>>>>>>> 1.3134
|
||||||
2002-08-21 Jim Blandy <jimb@redhat.com>
|
2002-08-21 Jim Blandy <jimb@redhat.com>
|
||||||
|
|
||||||
* valops.c (value_cast): Simplify and correct logic for doing a
|
* valops.c (value_cast): Simplify and correct logic for doing a
|
||||||
@ -257,6 +271,7 @@
|
|||||||
mips_push_dummy_frame, mips_pop_frame, mips_skip_prologue,
|
mips_push_dummy_frame, mips_pop_frame, mips_skip_prologue,
|
||||||
mips_breakpoint_from_pc, mips_call_dummy_address): Make static.
|
mips_breakpoint_from_pc, mips_call_dummy_address): Make static.
|
||||||
|
|
||||||
|
>>>>>>> 1.3128
|
||||||
2002-08-19 Michael Snyder <msnyder@redhat.com>
|
2002-08-19 Michael Snyder <msnyder@redhat.com>
|
||||||
|
|
||||||
* mips-tdep.c (mips_frame_num_args): New function.
|
* mips-tdep.c (mips_frame_num_args): New function.
|
||||||
|
118
gdb/breakpoint.c
118
gdb/breakpoint.c
@ -715,10 +715,22 @@ insert_breakpoints (void)
|
|||||||
int return_val = 0; /* return success code. */
|
int return_val = 0; /* return success code. */
|
||||||
int val = 0;
|
int val = 0;
|
||||||
int disabled_breaks = 0;
|
int disabled_breaks = 0;
|
||||||
|
int hw_breakpoint_error = 0;
|
||||||
|
int process_warning = 0;
|
||||||
|
|
||||||
static char message1[] = "Error inserting catchpoint %d:\n";
|
static char message1[] = "Error inserting catchpoint %d:\n";
|
||||||
static char message[sizeof (message1) + 30];
|
static char message[sizeof (message1) + 30];
|
||||||
|
|
||||||
|
#ifdef ONE_PROCESS_WRITETEXT
|
||||||
|
process_warning = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct ui_file *tmp_error_stream = mem_fileopen ();
|
||||||
|
make_cleanup_ui_file_delete (tmp_error_stream);
|
||||||
|
|
||||||
|
/* Explicitly mark the warning -- this will only be printed if
|
||||||
|
there was an error. */
|
||||||
|
fprintf_unfiltered (tmp_error_stream, "Warning:\n");
|
||||||
|
|
||||||
ALL_BREAKPOINTS_SAFE (b, temp)
|
ALL_BREAKPOINTS_SAFE (b, temp)
|
||||||
{
|
{
|
||||||
@ -776,8 +788,9 @@ insert_breakpoints (void)
|
|||||||
/* Set a software (trap) breakpoint at the LMA. */
|
/* Set a software (trap) breakpoint at the LMA. */
|
||||||
val = target_insert_breakpoint (addr, b->shadow_contents);
|
val = target_insert_breakpoint (addr, b->shadow_contents);
|
||||||
if (val != 0)
|
if (val != 0)
|
||||||
warning ("overlay breakpoint %d failed: in ROM?",
|
fprintf_unfiltered (tmp_error_stream,
|
||||||
b->number);
|
"Overlay breakpoint %d failed: in ROM?",
|
||||||
|
b->number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Shall we set a breakpoint at the VMA? */
|
/* Shall we set a breakpoint at the VMA? */
|
||||||
@ -810,22 +823,34 @@ insert_breakpoints (void)
|
|||||||
b->enable_state = bp_shlib_disabled;
|
b->enable_state = bp_shlib_disabled;
|
||||||
if (!disabled_breaks)
|
if (!disabled_breaks)
|
||||||
{
|
{
|
||||||
target_terminal_ours_for_output ();
|
fprintf_unfiltered (tmp_error_stream,
|
||||||
warning ("Cannot insert breakpoint %d:", b->number);
|
"Cannot insert breakpoint %d.\n", b->number);
|
||||||
warning ("Temporarily disabling shared library breakpoints:");
|
fprintf_unfiltered (tmp_error_stream,
|
||||||
|
"Temporarily disabling shared library breakpoints:\n");
|
||||||
}
|
}
|
||||||
disabled_breaks = 1;
|
disabled_breaks = 1;
|
||||||
warning ("breakpoint #%d ", b->number);
|
fprintf_unfiltered (tmp_error_stream, "breakpoint #%d\n", b->number);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
target_terminal_ours_for_output ();
|
process_warning = 1;
|
||||||
warning ("Cannot insert breakpoint %d:", b->number);
|
if (b->type == bp_hardware_breakpoint)
|
||||||
#ifdef ONE_PROCESS_WRITETEXT
|
{
|
||||||
warning ("The same program may be running in another process.");
|
hw_breakpoint_error = 1;
|
||||||
#endif
|
fprintf_unfiltered (tmp_error_stream,
|
||||||
memory_error (val, b->address); /* which bombs us out */
|
"Cannot insert hardware breakpoint %d.\n",
|
||||||
|
b->number);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf_unfiltered (tmp_error_stream, "Cannot insert breakpoint %d.\n", b->number);
|
||||||
|
fprintf_filtered (tmp_error_stream, "Error accessing memory address ");
|
||||||
|
print_address_numeric (b->address, 1, tmp_error_stream);
|
||||||
|
fprintf_filtered (tmp_error_stream, ": %s.\n",
|
||||||
|
safe_strerror (val));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -852,9 +877,13 @@ insert_breakpoints (void)
|
|||||||
if (val)
|
if (val)
|
||||||
{
|
{
|
||||||
/* Couldn't set breakpoint for some reason */
|
/* Couldn't set breakpoint for some reason */
|
||||||
target_terminal_ours_for_output ();
|
fprintf_unfiltered (tmp_error_stream,
|
||||||
warning ("Cannot insert catchpoint %d; disabling it.",
|
"Cannot insert catchpoint %d; disabling it.\n",
|
||||||
b->number);
|
b->number);
|
||||||
|
fprintf_filtered (tmp_error_stream, "Error accessing memory address ");
|
||||||
|
print_address_numeric (b->address, 1, tmp_error_stream);
|
||||||
|
fprintf_filtered (tmp_error_stream, ": %s.\n",
|
||||||
|
safe_strerror (val));
|
||||||
b->enable_state = bp_disabled;
|
b->enable_state = bp_disabled;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -876,9 +905,9 @@ insert_breakpoints (void)
|
|||||||
if (val == -1)
|
if (val == -1)
|
||||||
{
|
{
|
||||||
/* something went wrong */
|
/* something went wrong */
|
||||||
target_terminal_ours_for_output ();
|
fprintf_unfiltered (tmp_error_stream,
|
||||||
warning ("Cannot insert catchpoint %d; disabling it.",
|
"Cannot insert catchpoint %d; disabling it.\n",
|
||||||
b->number);
|
b->number);
|
||||||
b->enable_state = bp_disabled;
|
b->enable_state = bp_disabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -955,7 +984,7 @@ insert_breakpoints (void)
|
|||||||
|
|
||||||
addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
|
addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
|
||||||
len = TYPE_LENGTH (VALUE_TYPE (v));
|
len = TYPE_LENGTH (VALUE_TYPE (v));
|
||||||
type = hw_write;
|
type = hw_write;
|
||||||
if (b->type == bp_read_watchpoint)
|
if (b->type == bp_read_watchpoint)
|
||||||
type = hw_read;
|
type = hw_read;
|
||||||
else if (b->type == bp_access_watchpoint)
|
else if (b->type == bp_access_watchpoint)
|
||||||
@ -980,9 +1009,11 @@ insert_breakpoints (void)
|
|||||||
value chain brings us here. */
|
value chain brings us here. */
|
||||||
if (!b->inserted)
|
if (!b->inserted)
|
||||||
{
|
{
|
||||||
|
process_warning = 1;
|
||||||
remove_breakpoint (b, mark_uninserted);
|
remove_breakpoint (b, mark_uninserted);
|
||||||
warning ("Could not insert hardware watchpoint %d.",
|
hw_breakpoint_error = 1;
|
||||||
b->number);
|
fprintf_unfiltered (tmp_error_stream,
|
||||||
|
"Cannot insert hardware watchpoint %d.\n", b->number);
|
||||||
val = -1;
|
val = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1029,8 +1060,7 @@ insert_breakpoints (void)
|
|||||||
}
|
}
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
{
|
{
|
||||||
target_terminal_ours_for_output ();
|
fprintf_unfiltered (tmp_error_stream, "Cannot insert catchpoint %d.", b->number);
|
||||||
warning ("Cannot insert catchpoint %d.", b->number);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
b->inserted = 1;
|
b->inserted = 1;
|
||||||
@ -1039,11 +1069,26 @@ insert_breakpoints (void)
|
|||||||
return_val = val; /* remember failure */
|
return_val = val; /* remember failure */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (return_val)
|
||||||
|
{
|
||||||
|
/* If a hardware breakpoint or watchpoint was inserted, add a
|
||||||
|
message about possibly exhausted resources. */
|
||||||
|
if (hw_breakpoint_error)
|
||||||
|
{
|
||||||
|
fprintf_unfiltered (tmp_error_stream, "Could not insert hardware breakpoints:\n"
|
||||||
|
"You may have requested too many hardware breakpoints/watchpoints.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process_warning)
|
||||||
|
fprintf_unfiltered (tmp_error_stream,"The same program may be running in another process.");
|
||||||
|
|
||||||
|
target_terminal_ours_for_output ();
|
||||||
|
error_stream (tmp_error_stream);
|
||||||
|
}
|
||||||
return return_val;
|
return return_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
remove_breakpoints (void)
|
remove_breakpoints (void)
|
||||||
{
|
{
|
||||||
@ -6681,11 +6726,32 @@ delete_breakpoint (struct breakpoint *bpt)
|
|||||||
else
|
else
|
||||||
val = target_insert_breakpoint (b->address, b->shadow_contents);
|
val = target_insert_breakpoint (b->address, b->shadow_contents);
|
||||||
|
|
||||||
|
/* If there was an error in the insert, print a message, then stop execution. */
|
||||||
if (val != 0)
|
if (val != 0)
|
||||||
{
|
{
|
||||||
|
struct ui_file *tmp_error_stream = mem_fileopen ();
|
||||||
|
make_cleanup_ui_file_delete (tmp_error_stream);
|
||||||
|
|
||||||
|
|
||||||
|
if (b->type == bp_hardware_breakpoint)
|
||||||
|
{
|
||||||
|
fprintf_unfiltered (tmp_error_stream,
|
||||||
|
"Cannot insert hardware breakpoint %d.\n"
|
||||||
|
"You may have requested too many hardware breakpoints.\n",
|
||||||
|
b->number);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf_unfiltered (tmp_error_stream, "Cannot insert breakpoint %d.\n", b->number);
|
||||||
|
fprintf_filtered (tmp_error_stream, "Error accessing memory address ");
|
||||||
|
print_address_numeric (b->address, 1, tmp_error_stream);
|
||||||
|
fprintf_filtered (tmp_error_stream, ": %s.\n",
|
||||||
|
safe_strerror (val));
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf_unfiltered (tmp_error_stream,"The same program may be running in another process.");
|
||||||
target_terminal_ours_for_output ();
|
target_terminal_ours_for_output ();
|
||||||
warning ("Cannot insert breakpoint %d:", b->number);
|
error_stream(tmp_error_stream);
|
||||||
memory_error (val, b->address); /* which bombs us out */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
b->inserted = 1;
|
b->inserted = 1;
|
||||||
|
23
gdb/infrun.c
23
gdb/infrun.c
@ -990,16 +990,9 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
|
|||||||
trap_expected = 1;
|
trap_expected = 1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int temp = insert_breakpoints ();
|
insert_breakpoints ();
|
||||||
if (temp)
|
/* If we get here there was no call to error() in
|
||||||
{
|
insert breakpoints -- so they were inserted. */
|
||||||
print_sys_errmsg ("insert_breakpoints", temp);
|
|
||||||
error ("Cannot insert breakpoints.\n\
|
|
||||||
The same program may be running in another process,\n\
|
|
||||||
or you may have requested too many hardware\n\
|
|
||||||
breakpoints and/or watchpoints.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
breakpoints_inserted = 1;
|
breakpoints_inserted = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3379,16 +3372,6 @@ normal_stop (void)
|
|||||||
if (target_has_execution && get_current_frame ())
|
if (target_has_execution && get_current_frame ())
|
||||||
(get_current_frame ())->pc = read_pc ();
|
(get_current_frame ())->pc = read_pc ();
|
||||||
|
|
||||||
if (breakpoints_failed)
|
|
||||||
{
|
|
||||||
target_terminal_ours_for_output ();
|
|
||||||
print_sys_errmsg ("While inserting breakpoints", breakpoints_failed);
|
|
||||||
printf_filtered ("Stopped; cannot insert breakpoints.\n\
|
|
||||||
The same program may be running in another process,\n\
|
|
||||||
or you may have requested too many hardware breakpoints\n\
|
|
||||||
and/or watchpoints.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (target_has_execution && breakpoints_inserted)
|
if (target_has_execution && breakpoints_inserted)
|
||||||
{
|
{
|
||||||
if (remove_breakpoints ())
|
if (remove_breakpoints ())
|
||||||
|
Loading…
Reference in New Issue
Block a user