public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Remove dump_prefix_expression
@ 2022-11-01 19:25 Tom Tromey
  2022-11-14 17:19 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2022-11-01 19:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

Since the expression rewrite, dump_prefix_expression has been
misnamed.  This patch cleans this up by removing the function, turning
it into a method on struct expression.
---
 gdb/expprint.c   | 6 ------
 gdb/expression.h | 8 ++++++--
 gdb/parse.c      | 2 +-
 gdb/stap-probe.c | 2 +-
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/gdb/expprint.c b/gdb/expprint.c
index 8534d2ac443..914177a122e 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -59,12 +59,6 @@ op_name (enum exp_opcode opcode)
     }
 }
 
-void
-dump_prefix_expression (struct expression *exp, struct ui_file *stream)
-{
-  exp->op->dump (stream, 0);
-}
-
 /* Meant to be used in debug sessions, so don't export it in a header file.  */
 extern void ATTRIBUTE_USED debug_exp (struct expression *exp);
 
diff --git a/gdb/expression.h b/gdb/expression.h
index 3ba68a2db93..a56b1856cda 100644
--- a/gdb/expression.h
+++ b/gdb/expression.h
@@ -208,6 +208,12 @@ struct expression
     return op->opcode ();
   }
 
+  /* Dump the expression to STREAM.  */
+  void dump (struct ui_file *stream)
+  {
+    op->dump (stream, 0);
+  }
+
   /* Evaluate the expression.  EXPECT_TYPE is the context type of the
      expression; normally this should be nullptr.  NOSIDE controls how
      evaluation is performed.  */
@@ -277,8 +283,6 @@ extern struct value *evaluate_subexp_do_call (expression *exp,
 
 extern const char *op_name (enum exp_opcode opcode);
 
-extern void dump_prefix_expression (struct expression *, struct ui_file *);
-
 /* In an OP_RANGE expression, either bound could be empty, indicating
    that its value is by default that of the corresponding bound of the
    array or string.  Also, the upper end of the range can be exclusive
diff --git a/gdb/parse.c b/gdb/parse.c
index aa12f6fe012..bfd9de09a10 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -527,7 +527,7 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc,
   result->op->set_outermost ();
 
   if (expressiondebug)
-    dump_prefix_expression (result.get (), gdb_stdlog);
+    result->dump (gdb_stdlog);
 
   if (completer != nullptr)
     *completer = std::move (ps.m_completion_state);
diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
index 7e3d26bc849..6f91d87846a 100644
--- a/gdb/stap-probe.c
+++ b/gdb/stap-probe.c
@@ -1328,7 +1328,7 @@ stap_probe::parse_arguments (struct gdbarch *gdbarch)
       expression_up expr = stap_parse_argument (&cur, atype, gdbarch);
 
       if (stap_expression_debug)
-	dump_prefix_expression (expr.get (), gdb_stdlog);
+	expr->dump (gdb_stdlog);
 
       m_parsed_args.emplace_back (bitness, atype, std::move (expr));
 
-- 
2.34.3


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

* Re: [PATCH] Remove dump_prefix_expression
  2022-11-01 19:25 [PATCH] Remove dump_prefix_expression Tom Tromey
@ 2022-11-14 17:19 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2022-11-14 17:19 UTC (permalink / raw)
  To: Tom Tromey via Gdb-patches; +Cc: Tom Tromey

>>>>> "Tom" == Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> Since the expression rewrite, dump_prefix_expression has been
Tom> misnamed.  This patch cleans this up by removing the function, turning
Tom> it into a method on struct expression.

I'm checking this in now.

Tom

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

end of thread, other threads:[~2022-11-14 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-01 19:25 [PATCH] Remove dump_prefix_expression Tom Tromey
2022-11-14 17:19 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).