diff options
author | Tom Tromey <tromey@adacore.com> | 2023-08-04 13:46:44 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-09-05 11:02:34 -0600 |
commit | 49ed499c44d9368d2b954697f362452d1447eecf (patch) | |
tree | 67b1d92ea6c00f7ca114e180ffdc54af8933810a /gdb/rust-lang.h | |
parent | e1a482ad96a2105c9d3a972de06b510379c14d7e (diff) | |
download | gdb-49ed499c44d9368d2b954697f362452d1447eecf.zip gdb-49ed499c44d9368d2b954697f362452d1447eecf.tar.gz gdb-49ed499c44d9368d2b954697f362452d1447eecf.tar.bz2 |
Refactor Rust code for slice-to-array operation
This patch exposes rust_slice_type_p and introduces
rust_slice_to_array, in preparation for subsequent patches that will
need these.
Diffstat (limited to 'gdb/rust-lang.h')
-rw-r--r-- | gdb/rust-lang.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/rust-lang.h b/gdb/rust-lang.h index 85c93a9..2c7ccb9 100644 --- a/gdb/rust-lang.h +++ b/gdb/rust-lang.h @@ -34,6 +34,9 @@ extern bool rust_tuple_type_p (struct type *type); /* Return true if TYPE is a tuple struct type; otherwise false. */ extern bool rust_tuple_struct_type_p (struct type *type); +/* Return true if TYPE is a slice type, otherwise false. */ +extern bool rust_slice_type_p (const struct type *type); + /* Given a block, find the name of the block's crate. Returns an empty stringif no crate name can be found. */ extern std::string rust_crate_for_block (const struct block *block); @@ -50,6 +53,10 @@ extern const char *rust_last_path_segment (const char *path); extern struct type *rust_slice_type (const char *name, struct type *elt_type, struct type *usize_type); +/* Return a new array that holds the contents of the given slice, + VAL. */ +extern struct value *rust_slice_to_array (struct value *val); + /* Class representing the Rust language. */ class rust_language : public language_defn |