]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove dump_prefix_expression
authorTom Tromey <tromey@adacore.com>
Tue, 1 Nov 2022 19:24:32 +0000 (13:24 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 14 Nov 2022 17:19:08 +0000 (10:19 -0700)
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
gdb/expression.h
gdb/parse.c
gdb/stap-probe.c

index 8534d2ac443a6aca134df47cab0c4a7898aea79d..914177a122e29750447f8f3f487b313bc63e6e75 100644 (file)
@@ -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);
 
index 3ba68a2db93eaec6a4014551acf508a6a628acab..a56b1856cda30683dbe38a0570569435285ba426 100644 (file)
@@ -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
index aa12f6fe012d04f5171871e9fe3911f1fe16066e..bfd9de09a10dd633d12c1365188cb364b7da8322 100644 (file)
@@ -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);
index 7e3d26bc849525031eed7c5105c70a1b5e7f48f4..6f91d87846acc0da5286b0464400478cb21f8051 100644 (file)
@@ -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));