aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 702c3f1..a1aeb10 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -145,8 +145,14 @@ get_warning_hook_handler ()
scoped_restore_warning_hook::scoped_restore_warning_hook
(warning_hook_handler new_handler)
- : m_save (make_scoped_restore (&warning_hook, new_handler))
+ : m_save (warning_hook)
{
+ warning_hook = new_handler;
+}
+
+scoped_restore_warning_hook::~scoped_restore_warning_hook ()
+{
+ warning_hook = m_save;
}
/* Print a warning message. The first argument STRING is the warning