mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 16:53:50 +08:00
Tell update_global_location_list to insert breakpoints
This adds a new mode for update_global_location_list, that allows callers saying "please insert breakpoints, even if breakpoints_always_inserted_mode() is false". This allows removing a couple breakpoints_always_inserted_mode checks. gdb/ 2014-09-22 Pedro Alves <palves@redhat.com> * breakpoint.c (enum ugll_insert_mode): Add UGLL_INSERT. (insert_breakpoints): Don't call insert_breakpoint_locations here. Instead, pass UGLL_INSERT to update_global_location_list. (update_global_location_list): Change parameter type from boolean to enum ugll_insert_mode. All callers adjusted. Adjust to use breakpoints_should_be_inserted_now and handle UGLL_INSERT. (create_solib_event_breakpoint_1): New, factored out from ... (create_solib_event_breakpoint): ... this. (create_and_insert_solib_event_breakpoint): Use create_solib_event_breakpoint_1 instead of calling insert_breakpoint_locations manually. (update_global_location_list): Handle UGLL_INSERT.
This commit is contained in:
@ -1,3 +1,18 @@
|
|||||||
|
2014-09-22 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* breakpoint.c (enum ugll_insert_mode): Add UGLL_INSERT.
|
||||||
|
(insert_breakpoints): Don't call insert_breakpoint_locations here.
|
||||||
|
Instead, pass UGLL_INSERT to update_global_location_list.
|
||||||
|
(update_global_location_list): Change parameter type from boolean
|
||||||
|
to enum ugll_insert_mode. All callers adjusted. Adjust to use
|
||||||
|
breakpoints_should_be_inserted_now and handle UGLL_INSERT.
|
||||||
|
(create_solib_event_breakpoint_1): New, factored out from ...
|
||||||
|
(create_solib_event_breakpoint): ... this.
|
||||||
|
(create_and_insert_solib_event_breakpoint): Use
|
||||||
|
create_solib_event_breakpoint_1 instead of calling
|
||||||
|
insert_breakpoint_locations manually.
|
||||||
|
(update_global_location_list): Handle UGLL_INSERT.
|
||||||
|
|
||||||
2014-09-22 Pedro Alves <palves@redhat.com>
|
2014-09-22 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* breakpoint.c (enum ugll_insert_mode): New enum.
|
* breakpoint.c (enum ugll_insert_mode): New enum.
|
||||||
|
@ -260,7 +260,11 @@ enum ugll_insert_mode
|
|||||||
|
|
||||||
/* May insert breakpoints if breakpoints_always_inserted_mode is
|
/* May insert breakpoints if breakpoints_always_inserted_mode is
|
||||||
true. */
|
true. */
|
||||||
UGLL_MAY_INSERT
|
UGLL_MAY_INSERT,
|
||||||
|
|
||||||
|
/* Insert locations now, even if breakpoints_always_inserted_mode is
|
||||||
|
false. */
|
||||||
|
UGLL_INSERT
|
||||||
};
|
};
|
||||||
|
|
||||||
static void update_global_location_list (enum ugll_insert_mode);
|
static void update_global_location_list (enum ugll_insert_mode);
|
||||||
@ -2954,13 +2958,10 @@ insert_breakpoints (void)
|
|||||||
update_watchpoint (w, 0 /* don't reparse. */);
|
update_watchpoint (w, 0 /* don't reparse. */);
|
||||||
}
|
}
|
||||||
|
|
||||||
update_global_location_list (UGLL_MAY_INSERT);
|
/* Updating watchpoints creates new locations, so update the global
|
||||||
|
location list. Explicitly tell ugll to insert locations and
|
||||||
/* update_global_location_list does not insert breakpoints when
|
ignore breakpoints_always_inserted_mode. */
|
||||||
always_inserted_mode is not enabled. Explicitly insert them
|
update_global_location_list (UGLL_INSERT);
|
||||||
now. */
|
|
||||||
if (!breakpoints_always_inserted_mode ())
|
|
||||||
insert_breakpoint_locations ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Invoke CALLBACK for each of bp_location. */
|
/* Invoke CALLBACK for each of bp_location. */
|
||||||
@ -7722,17 +7723,28 @@ remove_solib_event_breakpoints_at_next_stop (void)
|
|||||||
b->disposition = disp_del_at_next_stop;
|
b->disposition = disp_del_at_next_stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct breakpoint *
|
/* Helper for create_solib_event_breakpoint /
|
||||||
create_solib_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address)
|
create_and_insert_solib_event_breakpoint. Allows specifying which
|
||||||
|
INSERT_MODE to pass through to update_global_location_list. */
|
||||||
|
|
||||||
|
static struct breakpoint *
|
||||||
|
create_solib_event_breakpoint_1 (struct gdbarch *gdbarch, CORE_ADDR address,
|
||||||
|
enum ugll_insert_mode insert_mode)
|
||||||
{
|
{
|
||||||
struct breakpoint *b;
|
struct breakpoint *b;
|
||||||
|
|
||||||
b = create_internal_breakpoint (gdbarch, address, bp_shlib_event,
|
b = create_internal_breakpoint (gdbarch, address, bp_shlib_event,
|
||||||
&internal_breakpoint_ops);
|
&internal_breakpoint_ops);
|
||||||
update_global_location_list_nothrow (UGLL_MAY_INSERT);
|
update_global_location_list_nothrow (insert_mode);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct breakpoint *
|
||||||
|
create_solib_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address)
|
||||||
|
{
|
||||||
|
return create_solib_event_breakpoint_1 (gdbarch, address, UGLL_MAY_INSERT);
|
||||||
|
}
|
||||||
|
|
||||||
/* See breakpoint.h. */
|
/* See breakpoint.h. */
|
||||||
|
|
||||||
struct breakpoint *
|
struct breakpoint *
|
||||||
@ -7740,9 +7752,9 @@ create_and_insert_solib_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR add
|
|||||||
{
|
{
|
||||||
struct breakpoint *b;
|
struct breakpoint *b;
|
||||||
|
|
||||||
b = create_solib_event_breakpoint (gdbarch, address);
|
/* Explicitly tell update_global_location_list to insert
|
||||||
if (!breakpoints_always_inserted_mode ())
|
locations. */
|
||||||
insert_breakpoint_locations ();
|
b = create_solib_event_breakpoint_1 (gdbarch, address, UGLL_INSERT);
|
||||||
if (!b->loc->inserted)
|
if (!b->loc->inserted)
|
||||||
{
|
{
|
||||||
delete_breakpoint (b);
|
delete_breakpoint (b);
|
||||||
@ -12578,8 +12590,9 @@ force_breakpoint_reinsertion (struct bp_location *bl)
|
|||||||
deleted, to update the global location list and recompute which
|
deleted, to update the global location list and recompute which
|
||||||
locations are duplicate of which.
|
locations are duplicate of which.
|
||||||
|
|
||||||
The INSERT_MODE flag determines whether locations may or may not be
|
The INSERT_MODE flag determines whether locations may not, may, or
|
||||||
inserted now. See 'enum ugll_insert_mode' for more info. */
|
shall be inserted now. See 'enum ugll_insert_mode' for more
|
||||||
|
info. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_global_location_list (enum ugll_insert_mode insert_mode)
|
update_global_location_list (enum ugll_insert_mode insert_mode)
|
||||||
@ -12917,11 +12930,12 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
|
|||||||
"a permanent breakpoint"));
|
"a permanent breakpoint"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (breakpoints_always_inserted_mode ()
|
if (insert_mode == UGLL_INSERT
|
||||||
&& (have_live_inferiors ()
|
|| (breakpoints_always_inserted_mode ()
|
||||||
|| (gdbarch_has_global_breakpoints (target_gdbarch ()))))
|
&& (have_live_inferiors ()
|
||||||
|
|| (gdbarch_has_global_breakpoints (target_gdbarch ())))))
|
||||||
{
|
{
|
||||||
if (insert_mode == UGLL_MAY_INSERT)
|
if (insert_mode != UGLL_DONT_INSERT)
|
||||||
insert_breakpoint_locations ();
|
insert_breakpoint_locations ();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -12935,7 +12949,7 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (insert_mode == UGLL_MAY_INSERT)
|
if (insert_mode != UGLL_DONT_INSERT)
|
||||||
download_tracepoint_locations ();
|
download_tracepoint_locations ();
|
||||||
|
|
||||||
do_cleanups (cleanups);
|
do_cleanups (cleanups);
|
||||||
|
Reference in New Issue
Block a user