mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
Remove cleanup from solib-svr4.c
This removes a cleanup from solib-svr4.c, replacing it with make_scope_exit. 2019-03-06 Tom Tromey <tom@tromey.com> * solib-svr4.c (disable_probes_interface): Remove parameter. (svr4_handle_solib_event): Use make_scope_exit.
This commit is contained in:
parent
37991b4f52
commit
d01c587766
@ -1,3 +1,8 @@
|
||||
2019-03-06 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* solib-svr4.c (disable_probes_interface): Remove parameter.
|
||||
(svr4_handle_solib_event): Use make_scope_exit.
|
||||
|
||||
2019-03-06 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* remote.c (struct stop_reply_deleter): Remove.
|
||||
|
@ -1826,7 +1826,7 @@ solist_update_incremental (struct svr4_info *info, CORE_ADDR lm)
|
||||
ones set up for the probes-based interface are adequate. */
|
||||
|
||||
static void
|
||||
disable_probes_interface_cleanup (void *arg)
|
||||
disable_probes_interface ()
|
||||
{
|
||||
struct svr4_info *info = get_svr4_info ();
|
||||
|
||||
@ -1847,7 +1847,6 @@ svr4_handle_solib_event (void)
|
||||
struct svr4_info *info = get_svr4_info ();
|
||||
struct probe_and_action *pa;
|
||||
enum probe_action action;
|
||||
struct cleanup *old_chain;
|
||||
struct value *val = NULL;
|
||||
CORE_ADDR pc, debug_base, lm = 0;
|
||||
struct frame_info *frame = get_current_frame ();
|
||||
@ -1858,26 +1857,20 @@ svr4_handle_solib_event (void)
|
||||
|
||||
/* If anything goes wrong we revert to the original linker
|
||||
interface. */
|
||||
old_chain = make_cleanup (disable_probes_interface_cleanup, NULL);
|
||||
auto cleanup = make_scope_exit (disable_probes_interface);
|
||||
|
||||
pc = regcache_read_pc (get_current_regcache ());
|
||||
pa = solib_event_probe_at (info, pc);
|
||||
if (pa == NULL)
|
||||
{
|
||||
do_cleanups (old_chain);
|
||||
return;
|
||||
}
|
||||
|
||||
action = solib_event_probe_action (pa);
|
||||
if (action == PROBES_INTERFACE_FAILED)
|
||||
{
|
||||
do_cleanups (old_chain);
|
||||
return;
|
||||
}
|
||||
|
||||
if (action == DO_NOTHING)
|
||||
{
|
||||
discard_cleanups (old_chain);
|
||||
cleanup.release ();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1907,25 +1900,16 @@ svr4_handle_solib_event (void)
|
||||
END_CATCH
|
||||
|
||||
if (val == NULL)
|
||||
{
|
||||
do_cleanups (old_chain);
|
||||
return;
|
||||
}
|
||||
|
||||
debug_base = value_as_address (val);
|
||||
if (debug_base == 0)
|
||||
{
|
||||
do_cleanups (old_chain);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Always locate the debug struct, in case it moved. */
|
||||
info->debug_base = 0;
|
||||
if (locate_base (info) == 0)
|
||||
{
|
||||
do_cleanups (old_chain);
|
||||
return;
|
||||
}
|
||||
|
||||
/* GDB does not currently support libraries loaded via dlmopen
|
||||
into namespaces other than the initial one. We must ignore
|
||||
@ -1943,7 +1927,6 @@ svr4_handle_solib_event (void)
|
||||
CATCH (ex, RETURN_MASK_ERROR)
|
||||
{
|
||||
exception_print (gdb_stderr, ex);
|
||||
do_cleanups (old_chain);
|
||||
return;
|
||||
}
|
||||
END_CATCH
|
||||
@ -1968,13 +1951,10 @@ svr4_handle_solib_event (void)
|
||||
if (action == FULL_RELOAD)
|
||||
{
|
||||
if (!solist_update_full (info))
|
||||
{
|
||||
do_cleanups (old_chain);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
discard_cleanups (old_chain);
|
||||
cleanup.release ();
|
||||
}
|
||||
|
||||
/* Helper function for svr4_update_solib_event_breakpoints. */
|
||||
|
Loading…
Reference in New Issue
Block a user