[arm] Cleanup: use hex for offsets
[binutils-gdb.git] / gdb / expression.h
index 5c5371e9660d7585f33bd23c65944506c5e278c9..3ba68a2db93eaec6a4014551acf508a6a628acab 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions for expressions stored in reversed prefix form, for GDB.
 
-   Copyright (C) 1986-2021 Free Software Foundation, Inc.
+   Copyright (C) 1986-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -54,9 +54,6 @@ enum exp_opcode : uint8_t
 enum noside
   {
     EVAL_NORMAL,
-    EVAL_SKIP,                 /* Only effect is to increment pos.
-                                  Return type information where
-                                  possible.  */
     EVAL_AVOID_SIDE_EFFECTS    /* Don't modify any variables or
                                   call any functions.  The value
                                   returned will have the correct
@@ -235,8 +232,26 @@ extern expression_up parse_expression (const char *,
 extern expression_up parse_expression_with_language (const char *string,
                                                     enum language lang);
 
-extern struct type *parse_expression_for_completion
-    (const char *, gdb::unique_xmalloc_ptr<char> *, enum type_code *);
+
+class completion_tracker;
+
+/* Base class for expression completion.  An instance of this
+   represents a completion request from the parser.  */
+struct expr_completion_base
+{
+  /* Perform this object's completion.  EXP is the expression in which
+     the completion occurs.  TRACKER is the tracker to update with the
+     results.  Return true if completion was possible (even if no
+     completions were found), false to fall back to ordinary
+     expression completion (i.e., symbol names).  */
+  virtual bool complete (struct expression *exp,
+                        completion_tracker &tracker) = 0;
+
+  virtual ~expr_completion_base () = default;
+};
+
+extern expression_up parse_expression_for_completion
+     (const char *, std::unique_ptr<expr_completion_base> *completer);
 
 class innermost_block_tracker;
 extern expression_up parse_exp_1 (const char **, CORE_ADDR pc,