2011-07-25 Pedro Alves <pedro@codesourcery.com>
* breakpoint.c (bkpt_print_it, internal_bkpt_print_it) (momentary_bkpt_print_it): Simplify.
This commit is contained in:
parent
06edf0c005
commit
001c8c333d
2 changed files with 40 additions and 94 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2011-07-25 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
|
* breakpoint.c (bkpt_print_it, internal_bkpt_print_it)
|
||||||
|
(momentary_bkpt_print_it): Simplify.
|
||||||
|
|
||||||
2011-07-25 Pedro Alves <pedro@codesourcery.com>
|
2011-07-25 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
Split internal, momentary and user breakpoints breakpoint_ops
|
Split internal, momentary and user breakpoints breakpoint_ops
|
||||||
|
|
129
gdb/breakpoint.c
129
gdb/breakpoint.c
|
@ -10783,53 +10783,35 @@ bkpt_works_in_software_mode (const struct breakpoint *b)
|
||||||
enum print_stop_action
|
enum print_stop_action
|
||||||
bkpt_print_it (bpstat bs)
|
bkpt_print_it (bpstat bs)
|
||||||
{
|
{
|
||||||
struct cleanup *old_chain;
|
|
||||||
struct breakpoint *b;
|
struct breakpoint *b;
|
||||||
const struct bp_location *bl;
|
const struct bp_location *bl;
|
||||||
struct ui_stream *stb;
|
int bp_temp;
|
||||||
int bp_temp = 0;
|
|
||||||
enum print_stop_action result;
|
|
||||||
|
|
||||||
gdb_assert (bs->bp_location_at != NULL);
|
gdb_assert (bs->bp_location_at != NULL);
|
||||||
|
|
||||||
bl = bs->bp_location_at;
|
bl = bs->bp_location_at;
|
||||||
b = bs->breakpoint_at;
|
b = bs->breakpoint_at;
|
||||||
|
|
||||||
stb = ui_out_stream_new (uiout);
|
bp_temp = b->disposition == disp_del;
|
||||||
old_chain = make_cleanup_ui_out_stream_delete (stb);
|
if (bl->address != bl->requested_address)
|
||||||
|
breakpoint_adjustment_warning (bl->requested_address,
|
||||||
switch (b->type)
|
bl->address,
|
||||||
|
b->number, 1);
|
||||||
|
annotate_breakpoint (b->number);
|
||||||
|
if (bp_temp)
|
||||||
|
ui_out_text (uiout, "\nTemporary breakpoint ");
|
||||||
|
else
|
||||||
|
ui_out_text (uiout, "\nBreakpoint ");
|
||||||
|
if (ui_out_is_mi_like_p (uiout))
|
||||||
{
|
{
|
||||||
case bp_breakpoint:
|
ui_out_field_string (uiout, "reason",
|
||||||
case bp_hardware_breakpoint:
|
async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT));
|
||||||
bp_temp = b->disposition == disp_del;
|
ui_out_field_string (uiout, "disp", bpdisp_text (b->disposition));
|
||||||
if (bl->address != bl->requested_address)
|
|
||||||
breakpoint_adjustment_warning (bl->requested_address,
|
|
||||||
bl->address,
|
|
||||||
b->number, 1);
|
|
||||||
annotate_breakpoint (b->number);
|
|
||||||
if (bp_temp)
|
|
||||||
ui_out_text (uiout, "\nTemporary breakpoint ");
|
|
||||||
else
|
|
||||||
ui_out_text (uiout, "\nBreakpoint ");
|
|
||||||
if (ui_out_is_mi_like_p (uiout))
|
|
||||||
{
|
|
||||||
ui_out_field_string (uiout, "reason",
|
|
||||||
async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT));
|
|
||||||
ui_out_field_string (uiout, "disp", bpdisp_text (b->disposition));
|
|
||||||
}
|
|
||||||
ui_out_field_int (uiout, "bkptno", b->number);
|
|
||||||
ui_out_text (uiout, ", ");
|
|
||||||
result = PRINT_SRC_AND_LOC;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
result = PRINT_UNKNOWN;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
ui_out_field_int (uiout, "bkptno", b->number);
|
||||||
|
ui_out_text (uiout, ", ");
|
||||||
|
|
||||||
do_cleanups (old_chain);
|
return PRINT_SRC_AND_LOC;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -10944,21 +10926,10 @@ internal_bkpt_check_status (bpstat bs)
|
||||||
static enum print_stop_action
|
static enum print_stop_action
|
||||||
internal_bkpt_print_it (bpstat bs)
|
internal_bkpt_print_it (bpstat bs)
|
||||||
{
|
{
|
||||||
struct cleanup *old_chain;
|
|
||||||
struct breakpoint *b;
|
struct breakpoint *b;
|
||||||
const struct bp_location *bl;
|
|
||||||
struct ui_stream *stb;
|
|
||||||
int bp_temp = 0;
|
|
||||||
enum print_stop_action result;
|
|
||||||
|
|
||||||
gdb_assert (bs->bp_location_at != NULL);
|
|
||||||
|
|
||||||
bl = bs->bp_location_at;
|
|
||||||
b = bs->breakpoint_at;
|
b = bs->breakpoint_at;
|
||||||
|
|
||||||
stb = ui_out_stream_new (uiout);
|
|
||||||
old_chain = make_cleanup_ui_out_stream_delete (stb);
|
|
||||||
|
|
||||||
switch (b->type)
|
switch (b->type)
|
||||||
{
|
{
|
||||||
case bp_shlib_event:
|
case bp_shlib_event:
|
||||||
|
@ -10966,49 +10937,38 @@ internal_bkpt_print_it (bpstat bs)
|
||||||
variable? (If so, we report this as a generic, "Stopped due
|
variable? (If so, we report this as a generic, "Stopped due
|
||||||
to shlib event" message.) */
|
to shlib event" message.) */
|
||||||
printf_filtered (_("Stopped due to shared library event\n"));
|
printf_filtered (_("Stopped due to shared library event\n"));
|
||||||
result = PRINT_NOTHING;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case bp_thread_event:
|
case bp_thread_event:
|
||||||
/* Not sure how we will get here.
|
/* Not sure how we will get here.
|
||||||
GDB should not stop for these breakpoints. */
|
GDB should not stop for these breakpoints. */
|
||||||
printf_filtered (_("Thread Event Breakpoint: gdb should not stop!\n"));
|
printf_filtered (_("Thread Event Breakpoint: gdb should not stop!\n"));
|
||||||
result = PRINT_NOTHING;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case bp_overlay_event:
|
case bp_overlay_event:
|
||||||
/* By analogy with the thread event, GDB should not stop for these. */
|
/* By analogy with the thread event, GDB should not stop for these. */
|
||||||
printf_filtered (_("Overlay Event Breakpoint: gdb should not stop!\n"));
|
printf_filtered (_("Overlay Event Breakpoint: gdb should not stop!\n"));
|
||||||
result = PRINT_NOTHING;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case bp_longjmp_master:
|
case bp_longjmp_master:
|
||||||
/* These should never be enabled. */
|
/* These should never be enabled. */
|
||||||
printf_filtered (_("Longjmp Master Breakpoint: gdb should not stop!\n"));
|
printf_filtered (_("Longjmp Master Breakpoint: gdb should not stop!\n"));
|
||||||
result = PRINT_NOTHING;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case bp_std_terminate_master:
|
case bp_std_terminate_master:
|
||||||
/* These should never be enabled. */
|
/* These should never be enabled. */
|
||||||
printf_filtered (_("std::terminate Master Breakpoint: "
|
printf_filtered (_("std::terminate Master Breakpoint: "
|
||||||
"gdb should not stop!\n"));
|
"gdb should not stop!\n"));
|
||||||
result = PRINT_NOTHING;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case bp_exception_master:
|
case bp_exception_master:
|
||||||
/* These should never be enabled. */
|
/* These should never be enabled. */
|
||||||
printf_filtered (_("Exception Master Breakpoint: "
|
printf_filtered (_("Exception Master Breakpoint: "
|
||||||
"gdb should not stop!\n"));
|
"gdb should not stop!\n"));
|
||||||
result = PRINT_NOTHING;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
result = PRINT_UNKNOWN;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
do_cleanups (old_chain);
|
return PRINT_NOTHING;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -11064,46 +11024,27 @@ momentary_bkpt_check_status (bpstat bs)
|
||||||
static enum print_stop_action
|
static enum print_stop_action
|
||||||
momentary_bkpt_print_it (bpstat bs)
|
momentary_bkpt_print_it (bpstat bs)
|
||||||
{
|
{
|
||||||
struct cleanup *old_chain;
|
if (ui_out_is_mi_like_p (uiout))
|
||||||
struct breakpoint *b;
|
|
||||||
const struct bp_location *bl;
|
|
||||||
struct ui_stream *stb;
|
|
||||||
int bp_temp = 0;
|
|
||||||
enum print_stop_action result;
|
|
||||||
|
|
||||||
gdb_assert (bs->bp_location_at != NULL);
|
|
||||||
|
|
||||||
bl = bs->bp_location_at;
|
|
||||||
b = bs->breakpoint_at;
|
|
||||||
|
|
||||||
stb = ui_out_stream_new (uiout);
|
|
||||||
old_chain = make_cleanup_ui_out_stream_delete (stb);
|
|
||||||
|
|
||||||
switch (b->type)
|
|
||||||
{
|
{
|
||||||
case bp_finish:
|
struct breakpoint *b = bs->breakpoint_at;
|
||||||
if (ui_out_is_mi_like_p (uiout))
|
|
||||||
ui_out_field_string
|
|
||||||
(uiout, "reason",
|
|
||||||
async_reason_lookup (EXEC_ASYNC_FUNCTION_FINISHED));
|
|
||||||
result = PRINT_UNKNOWN;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case bp_until:
|
switch (b->type)
|
||||||
if (ui_out_is_mi_like_p (uiout))
|
{
|
||||||
ui_out_field_string
|
case bp_finish:
|
||||||
(uiout, "reason",
|
ui_out_field_string
|
||||||
async_reason_lookup (EXEC_ASYNC_LOCATION_REACHED));
|
(uiout, "reason",
|
||||||
result = PRINT_UNKNOWN;
|
async_reason_lookup (EXEC_ASYNC_FUNCTION_FINISHED));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
case bp_until:
|
||||||
result = PRINT_UNKNOWN;
|
ui_out_field_string
|
||||||
break;
|
(uiout, "reason",
|
||||||
|
async_reason_lookup (EXEC_ASYNC_LOCATION_REACHED));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
do_cleanups (old_chain);
|
return PRINT_UNKNOWN;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue