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

* Re: [RFA] (dump_raw_expression): Print note if non-NULL.
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2009-03-18  1:32 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> Ok to check in?
Doug> 2009-03-17  Doug Evans  <dje@google.com>
Doug> 	* expprint.c (dump_raw_expression): Print note if non-NULL.

Looks good to me, please go ahead.

Doug> -  fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %ld bytes each.\n",
Doug> +  if (note)
Doug> +    fprintf_filtered (stream, ", %s:", note);
Doug> +  fprintf_filtered (stream, "\n\tLanguage %s, %d elements, %ld bytes each.\n",

I notice that this removes a single quote (see the old fprintf_filtered).
But, I can't see why we would want that anyway.

Tom


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

* Re: [RFA] (dump_raw_expression): Print note if non-NULL.
  2009-03-18  1:32 ` Tom Tromey
@ 2009-03-18  2:51   ` Doug Evans
  0 siblings, 0 replies; 3+ messages in thread
From: Doug Evans @ 2009-03-18  2:51 UTC (permalink / raw)
  To: tromey; +Cc: gdb-patches

On Tue, Mar 17, 2009 at 6:23 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> Ok to check in?
> Doug> 2009-03-17  Doug Evans  <dje@google.com>
> Doug>   * expprint.c (dump_raw_expression): Print note if non-NULL.
>
> Looks good to me, please go ahead.
>
> Doug> -  fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %ld bytes each.\n",
> Doug> +  if (note)
> Doug> +    fprintf_filtered (stream, ", %s:", note);
> Doug> +  fprintf_filtered (stream, "\n\tLanguage %s, %d elements, %ld bytes each.\n",
>
> I notice that this removes a single quote (see the old fprintf_filtered).
> But, I can't see why we would want that anyway.

The single quote is a left over from an earlier version.


^ 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