Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: dje@google.com (Doug Evans)
To: gdb-patches@sourceware.org
Subject: [RFA] (dump_raw_expression): Print note if non-NULL.
Date: Tue, 17 Mar 2009 22:05:00 -0000	[thread overview]
Message-ID: <20090317220433.BDAD01C7301@localhost> (raw)

Hi.

I found this while researching a bug.
The parameter "note" is unused in dump_raw_expression.

The other way to go, obviously, is to remove the parameter.
I like the fact that parse_exp_in_context() prints before/after
versions of the expression, and I like the inclusion of
the explanatory "before conversion to prefix form" text.
But I also don't want to put this text in dump_raw_expression itself.
So I kept the parameter.

parse.c:
  if (expressiondebug)
    dump_raw_expression (expout, gdb_stdlog,
			 "before conversion to prefix form");

  subexp = prefixify_expression (expout);
  if (out_subexp)
    *out_subexp = subexp;

  current_language->la_post_parser (&expout, void_context_p);

  if (expressiondebug)
    dump_prefix_expression (expout, gdb_stdlog);


Ok to check in?

2009-03-17  Doug Evans  <dje@google.com>

	* expprint.c (dump_raw_expression): Print note if non-NULL.

Index: expprint.c
===================================================================
RCS file: /cvs/src/src/gdb/expprint.c,v
retrieving revision 1.35
diff -u -p -u -p -r1.35 expprint.c
--- expprint.c	3 Jan 2009 05:57:51 -0000	1.35
+++ expprint.c	17 Mar 2009 21:52:30 -0000
@@ -802,6 +802,9 @@ op_name_standard (enum exp_opcode opcode
     }
 }
 
+/* Print a raw dump of expression EXP to STREAM.
+   NOTE, if non-NULL, is printed as extra explanatory text.  */
+
 void
 dump_raw_expression (struct expression *exp, struct ui_file *stream,
 		     char *note)
@@ -813,7 +816,9 @@ dump_raw_expression (struct expression *
 
   fprintf_filtered (stream, "Dump of expression @ ");
   gdb_print_host_address (exp, stream);
-  fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %ld bytes each.\n",
+  if (note)
+    fprintf_filtered (stream, ", %s:", note);
+  fprintf_filtered (stream, "\n\tLanguage %s, %d elements, %ld bytes each.\n",
 		    exp->language_defn->la_name, exp->nelts,
 		    (long) sizeof (union exp_element));
   fprintf_filtered (stream, "\t%5s  %20s  %16s  %s\n", "Index", "Opcode",


             reply	other threads:[~2009-03-17 22:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17 22:05 Doug Evans [this message]
2009-03-18  1:32 ` Tom Tromey
2009-03-18  2:51   ` Doug Evans

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=20090317220433.BDAD01C7301@localhost \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /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