Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Leszek Swirski via gdb-patches" <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Leszek Swirski <leszeks@google.com>
Subject: [PATCH] MI: Allow non-raw varobj evaluation
Date: Wed, 24 Jan 2018 17:32:00 -0000	[thread overview]
Message-ID: <20180124173223.213808-1-leszeks@google.com> (raw)

Make the MI variable object expression evaluation, with the
-var-evaluate-expression command, recursively call pretty printers, to
match the output of normal expression printing.

This is gated behind the -enable-pretty-printing command.

gdb/ChangeLog:

	* varobj.c (varobj_formatted_print_options): Allow recursive
	pretty printing if pretty printing is enabled.
---
 gdb/ChangeLog | 5 +++++
 gdb/varobj.c  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 17a5a84b0c..7c53cf07b6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-24  Leszek Swirski  <leszeks@google.com>
+
+	* varobj.c (varobj_formatted_print_options): Allow recursive
+	pretty printing if pretty printing is enabled.
+
 2018-01-24  Leszek Swirski  <leszeks@google.com>
 
 	* c-exp.y (lex_one_token, classify_name, yylex): Don't classify
diff --git a/gdb/varobj.c b/gdb/varobj.c
index b6a2d8f369..f23243f3b7 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -2274,7 +2274,7 @@ varobj_formatted_print_options (struct value_print_options *opts,
 {
   get_formatted_print_options (opts, format_code[(int) format]);
   opts->deref_ref = 0;
-  opts->raw = 1;
+  opts->raw = !pretty_printing;
 }
 
 std::string
-- 
2.16.0.rc1.238.g530d649a79-goog


             reply	other threads:[~2018-01-24 17:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 17:32 Leszek Swirski via gdb-patches [this message]
2018-01-25  2:53 ` Simon Marchi
2018-01-25 11:11   ` Leszek Swirski via gdb-patches
2018-02-02  4:27     ` Simon Marchi
2018-02-02  9:01       ` Leszek Swirski via gdb-patches
2018-02-02 19:05         ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180124173223.213808-1-leszeks@google.com \
    --to=gdb-patches@sourceware.org \
    --cc=leszeks@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox