diff options
author | Tom Tromey <tom@tromey.com> | 2016-04-26 19:38:08 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2016-05-17 12:02:00 -0600 |
commit | c44af4ebc000f606d16b42224cba2cfe80391d5c (patch) | |
tree | 73839883edc5c0bd6f744024802b30f0bdd7b0e3 /gdb/std-operator.def | |
parent | 00272ec4b0cc22c1b9d60d39ce7bf5b2d5512582 (diff) | |
download | gdb-c44af4ebc000f606d16b42224cba2cfe80391d5c.zip gdb-c44af4ebc000f606d16b42224cba2cfe80391d5c.tar.gz gdb-c44af4ebc000f606d16b42224cba2cfe80391d5c.tar.bz2 |
Add support for the Rust language
This patch adds support for the Rust language.
2016-05-17 Tom Tromey <tom@tromey.com>
Manish Goregaokar <manishsmail@gmail.com>
* symtab.c (symbol_find_demangled_name): Handle Rust.
* symfile.c (init_filename_language_table): Treat ".rs" as Rust.
* std-operator.def (STRUCTOP_ANONYMOUS, OP_RUST_ARRAY): New
constants.
* rust-lang.h: New file.
* rust-lang.c: New file.
* rust-exp.y: New file.
* dwarf2read.c (read_file_scope): Add Rust producer sniffing.
(dwarf2_compute_name, read_func_scope, read_structure_type)
(read_base_type, read_subrange_type, set_cu_language)
(new_symbol_full, determine_prefix): Handle Rust.
* defs.h (enum language) <language_rust>: New constant.
* Makefile.in (SFILES): Add rust-exp.y, rust-lang.c.
(COMMON_OBS): Add rust-exp.o, rust-lang.o.
2016-05-17 Tom Tromey <tom@tromey.com>
* gdb.base/default.exp (set language): Add rust.
Diffstat (limited to 'gdb/std-operator.def')
-rw-r--r-- | gdb/std-operator.def | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/std-operator.def b/gdb/std-operator.def index 505d96b..08f0d5b 100644 --- a/gdb/std-operator.def +++ b/gdb/std-operator.def @@ -266,6 +266,9 @@ OP (OP_M2_STRING) /* Modula-2 string constants */ OP (STRUCTOP_STRUCT) OP (STRUCTOP_PTR) +/* Anonymous field access, e.g. "foo.3". Used in Rust. */ +OP (STRUCTOP_ANONYMOUS) + /* C++: OP_THIS is just a placeholder for the class instance variable. It just comes in a tight (OP_THIS, OP_THIS) pair. */ OP (OP_THIS) @@ -312,3 +315,7 @@ OP (OP_DECLTYPE) /* The typeid operator. This has one expression argument. */ OP (OP_TYPEID) + +/* This is used for the Rust [expr; N] form of array construction. It + takes two expression arguments. */ +OP (OP_RUST_ARRAY) |