This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] (dump_raw_expression): Print note if non-NULL.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]