summaryrefslogtreecommitdiff
path: root/gdb/solib-svr4.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-01-23 22:23:15 -0700
committerTom Tromey <tom@tromey.com>2019-03-06 16:04:31 -0700
commitd01c5877664024043f4e5920d072c5f62fc7f89a (patch)
tree92be148cd98def2970277a5b3fd65101feabd167 /gdb/solib-svr4.c
parent37991b4f52e7d13c586137f401ac65dec4aa732f (diff)
downloadbinutils-gdb-d01c5877664024043f4e5920d072c5f62fc7f89a.tar.gz
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.
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r--gdb/solib-svr4.c40
1 files changed, 10 insertions, 30 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 787b98ba266..2b370ef96d0 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -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;
- }
+ return;
action = solib_event_probe_action (pa);
if (action == PROBES_INTERFACE_FAILED)
- {
- do_cleanups (old_chain);
- return;
- }
+ 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;
- }
+ return;
debug_base = value_as_address (val);
if (debug_base == 0)
- {
- do_cleanups (old_chain);
- return;
- }
+ return;
/* Always locate the debug struct, in case it moved. */
info->debug_base = 0;
if (locate_base (info) == 0)
- {
- do_cleanups (old_chain);
- return;
- }
+ 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;
- }
+ return;
}
- discard_cleanups (old_chain);
+ cleanup.release ();
}
/* Helper function for svr4_update_solib_event_breakpoints. */