diff mbox

[01/55] Use scoped_value_mark in value_print

Message ID 20191208182958.10181-2-tom@tromey.com
State New
Headers show

Commit Message

Tom Tromey Dec. 8, 2019, 6:29 p.m. UTC
From: Tom Tromey <tromey@adacore.com>

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
2019-12-08  Tom Tromey  <tom@tromey.com>

	* valprint.c (value_print): Use scoped_value_mark.

Change-Id: I7aad76b8387b87bd46a920f7865725e677a74934
---
 gdb/ChangeLog  | 4 ++++
 gdb/valprint.c | 2 ++
 2 files changed, 6 insertions(+)
diff mbox

Patch

diff --git a/gdb/valprint.c b/gdb/valprint.c
index 1e3071b4322..5bc860f13f1 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1201,6 +1201,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;