aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-08 07:27:57 -0700
committerTom Tromey <tom@tromey.com>2021-03-08 07:28:26 -0700
commitcc6bd32eeac6b31b036a172b6841d699e05b285f (patch)
tree150f9d662a6c0c7e57f32270a741a8800491ec11
parent42fecb6183f4cce4e85473b8c43d90ec0ea562e7 (diff)
downloadgdb-cc6bd32eeac6b31b036a172b6841d699e05b285f.zip
gdb-cc6bd32eeac6b31b036a172b6841d699e05b285f.tar.gz
gdb-cc6bd32eeac6b31b036a172b6841d699e05b285f.tar.bz2
Introduce ada_qual_operation
This adds class ada_qual_operation, which implements UNOP_QUAL. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * ada-lang.c (ada_qual_operation::evaluate): New method. * ada-exp.h (class ada_qual_operation): New.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ada-exp.h16
-rw-r--r--gdb/ada-lang.c9
3 files changed, 30 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 816f5a8..337813d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2021-03-08 Tom Tromey <tom@tromey.com>
+ * ada-lang.c (ada_qual_operation::evaluate): New method.
+ * ada-exp.h (class ada_qual_operation): New.
+
+2021-03-08 Tom Tromey <tom@tromey.com>
+
* ada-lang.c (ada_string_operation::evaluate): New method.
* ada-exp.h (class ada_string_operation): New.
diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h
index 88ed0c5..9a8c8df 100644
--- a/gdb/ada-exp.h
+++ b/gdb/ada-exp.h
@@ -55,6 +55,22 @@ public:
enum noside noside) override;
};
+/* The Ada TYPE'(EXP) construct. */
+class ada_qual_operation
+ : public tuple_holding_operation<operation_up, struct type *>
+{
+public:
+
+ using tuple_holding_operation::tuple_holding_operation;
+
+ value *evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside) override;
+
+ enum exp_opcode opcode () const override
+ { return UNOP_QUAL; }
+};
+
} /* namespace expr */
#endif /* ADA_EXP_H */
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 0666302..409ffb9 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -10427,6 +10427,15 @@ ada_string_operation::evaluate (struct type *expect_type,
return result;
}
+value *
+ada_qual_operation::evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside)
+{
+ struct type *type = std::get<1> (m_storage);
+ return std::get<0> (m_storage)->evaluate (type, exp, noside);
+}
+
}
/* Implement the evaluate_exp routine in the exp_descriptor structure