aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-svr4.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-29 13:51:58 -0600
committerTom Tromey <tom@tromey.com>2018-06-18 13:16:45 -0600
commit06424eac62da949519c0c641fbc3e8372a9c7f0b (patch)
tree047b910268ca63e6c6d34502df1bdc5722366874 /gdb/solib-svr4.c
parentb4be9fadea469e2c937c81a8f1d3243206f9bcfc (diff)
downloadgdb-06424eac62da949519c0c641fbc3e8372a9c7f0b.zip
gdb-06424eac62da949519c0c641fbc3e8372a9c7f0b.tar.gz
gdb-06424eac62da949519c0c641fbc3e8372a9c7f0b.tar.bz2
Remove resume_section_map_updates_cleanup
This removes resume_section_map_updates_cleanup, replacing it with a scoped_restore. Tested by the buildbot. gdb/ChangeLog 2018-06-18 Tom Tromey <tom@tromey.com> * objfiles.h (inhibit_section_map_updates): Update. (resume_section_map_updates, resume_section_map_updates_cleanup): Remove. * solib-svr4.c (svr4_handle_solib_event): Update. * objfiles.c (inhibit_section_map_updates): Return scoped_restore_tmpl<int>. (resume_section_map_updates, resume_section_map_updates_cleanup): Remove.
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r--gdb/solib-svr4.c117
1 files changed, 59 insertions, 58 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index d012f08..6f48c68 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1858,7 +1858,7 @@ 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, *usm_chain;
+ struct cleanup *old_chain;
struct value *val = NULL;
CORE_ADDR pc, debug_base, lm = 0;
struct frame_info *frame = get_current_frame ();
@@ -1902,72 +1902,73 @@ svr4_handle_solib_event (void)
so we can guarantee that the dynamic linker's sections are in the
section map. We can therefore inhibit section map updates across
these calls to evaluate_argument and save a lot of time. */
- inhibit_section_map_updates (current_program_space);
- usm_chain = make_cleanup (resume_section_map_updates_cleanup,
- current_program_space);
+ {
+ scoped_restore inhibit_updates
+ = inhibit_section_map_updates (current_program_space);
- TRY
- {
- val = pa->prob->evaluate_argument (1, frame);
- }
- CATCH (ex, RETURN_MASK_ERROR)
- {
- exception_print (gdb_stderr, ex);
- val = NULL;
- }
- END_CATCH
+ TRY
+ {
+ val = pa->prob->evaluate_argument (1, frame);
+ }
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ exception_print (gdb_stderr, ex);
+ val = NULL;
+ }
+ END_CATCH
- if (val == NULL)
- {
- do_cleanups (old_chain);
- return;
- }
+ if (val == NULL)
+ {
+ do_cleanups (old_chain);
+ return;
+ }
- debug_base = value_as_address (val);
- if (debug_base == 0)
- {
- 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;
- }
+ /* 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
- any namespace other than the initial namespace here until
- support for this is added to GDB. */
- if (debug_base != info->debug_base)
- action = DO_NOTHING;
+ /* GDB does not currently support libraries loaded via dlmopen
+ into namespaces other than the initial one. We must ignore
+ any namespace other than the initial namespace here until
+ support for this is added to GDB. */
+ if (debug_base != info->debug_base)
+ action = DO_NOTHING;
- if (action == UPDATE_OR_RELOAD)
- {
- TRY
- {
- val = pa->prob->evaluate_argument (2, frame);
- }
- CATCH (ex, RETURN_MASK_ERROR)
- {
- exception_print (gdb_stderr, ex);
- do_cleanups (old_chain);
- return;
- }
- END_CATCH
+ if (action == UPDATE_OR_RELOAD)
+ {
+ TRY
+ {
+ val = pa->prob->evaluate_argument (2, frame);
+ }
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ exception_print (gdb_stderr, ex);
+ do_cleanups (old_chain);
+ return;
+ }
+ END_CATCH
- if (val != NULL)
- lm = value_as_address (val);
+ if (val != NULL)
+ lm = value_as_address (val);
- if (lm == 0)
- action = FULL_RELOAD;
- }
+ if (lm == 0)
+ action = FULL_RELOAD;
+ }
- /* Resume section map updates. */
- do_cleanups (usm_chain);
+ /* Resume section map updates. Closing the scope is
+ sufficient. */
+ }
if (action == UPDATE_OR_RELOAD)
{