aboutsummaryrefslogtreecommitdiff
path: root/gdb/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/parse.c')
-rw-r--r--gdb/parse.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gdb/parse.c b/gdb/parse.c
index 51e7d65..b3cd91d 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -1158,13 +1158,20 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc,
return result;
}
-/* Parse STRING as an expression, and complain if this fails
- to use up all of the contents of STRING. */
+/* Parse STRING as an expression, and complain if this fails to use up
+ all of the contents of STRING. TRACKER, if non-null, will be
+ updated by the parser. VOID_CONTEXT_P should be true to indicate
+ that the expression may be expected to return a value with void
+ type. Parsers are free to ignore this, or to use it to help with
+ overload resolution decisions. */
expression_up
-parse_expression (const char *string, innermost_block_tracker *tracker)
+parse_expression (const char *string, innermost_block_tracker *tracker,
+ bool void_context_p)
{
- expression_up exp = parse_exp_1 (&string, 0, 0, 0, tracker);
+ expression_up exp = parse_exp_in_context (&string, 0, nullptr, 0,
+ void_context_p, nullptr,
+ tracker, nullptr);
if (*string)
error (_("Junk after end of expression."));
return exp;