aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-11-01 13:24:32 -0600
committerTom Tromey <tromey@adacore.com>2022-11-14 10:19:08 -0700
commit197073104337f2d2ce8353334b4125e61b8217c5 (patch)
treee989eeb687d69808278aa3a1f69ba0a550571bd6 /gdb
parent1f7b42d52a8cb690c259eaa4975a608e82d7267a (diff)
downloadgdb-197073104337f2d2ce8353334b4125e61b8217c5.zip
gdb-197073104337f2d2ce8353334b4125e61b8217c5.tar.gz
gdb-197073104337f2d2ce8353334b4125e61b8217c5.tar.bz2
Remove dump_prefix_expression
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/expprint.c6
-rw-r--r--gdb/expression.h8
-rw-r--r--gdb/parse.c2
-rw-r--r--gdb/stap-probe.c2
4 files changed, 8 insertions, 10 deletions
diff --git a/gdb/expprint.c b/gdb/expprint.c
index 8534d2a..914177a 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 3ba68a2..a56b185 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 aa12f6f..bfd9de0 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 7e3d26b..6f91d87 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));