Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] (dump_raw_expression): Print note if non-NULL.
@ 2009-03-17 22:05 Doug Evans
  2009-03-18  1:32 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2009-03-17 22:05 UTC (permalink / raw)
  To: gdb-patches

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",


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-18  2:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-17 22:05 [RFA] (dump_raw_expression): Print note if non-NULL Doug Evans
2009-03-18  1:32 ` Tom Tromey
2009-03-18  2:51   ` Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox