Use scoped_value_mark in value_print
authorTom Tromey <tromey@adacore.com>
Fri, 13 Mar 2020 23:39:52 +0000 (17:39 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 14 Mar 2020 00:03:39 +0000 (18:03 -0600)
Switching the low-level printing to use the value API means we will be
using more temporary values.  This adds a scoped_value_mark to
value_print, so that these intermediates are destroyed in a timely
way.

gdb/ChangeLog
2020-03-13  Tom Tromey  <tom@tromey.com>

* valprint.c (value_print): Use scoped_value_mark.

gdb/ChangeLog
gdb/valprint.c

index d83ce81f9d4e150960bfbba453d2d8df7bedb0bb..13f186e03b440aabe0c4f19bbf8f826a8d8f94b8 100644 (file)
@@ -1,3 +1,7 @@
+2020-03-13  Tom Tromey  <tom@tromey.com>
+
+       * valprint.c (value_print): Use scoped_value_mark.
+
 2020-03-13  Tom de Vries  <tdevries@suse.de>
 
        PR symtab/25646
index 8adbb3df45714be5aa23cb842506cb6aa800dbd5..4383915de73443b1287e04c4b57a91c04d44d1bf 100644 (file)
@@ -1227,6 +1227,8 @@ void
 value_print (struct value *val, struct ui_file *stream,
             const struct value_print_options *options)
 {
+  scoped_value_mark free_values;
+
   if (!value_check_printable (val, stream, options))
     return;
 
This page took 0.028431 seconds and 4 git commands to generate.