rust_slice_type_p was not recognizing &str as a slice type, so indexing
into (or making a slice of) a slice was not working.
2017-10-02 Tom Tromey <tom@tromey.com>
* rust-lang.c (rust_slice_type_p): Recognize &str as a slice type.
2017-10-02 Tom Tromey <tom@tromey.com>
* gdb.rust/simple.exp: Test index of slice.
+2017-10-02 Tom Tromey <tom@tromey.com>
+
+ * rust-lang.c (rust_slice_type_p): Recognize &str as a slice type.
+
2017-10-02 Tom Tromey <tom@tromey.com>
* rust-lang.h (rust_slice_type): Add "extern".
{
return (TYPE_CODE (type) == TYPE_CODE_STRUCT
&& TYPE_TAG_NAME (type) != NULL
- && strncmp (TYPE_TAG_NAME (type), "&[", 2) == 0);
+ && (strncmp (TYPE_TAG_NAME (type), "&[", 2) == 0
+ || strcmp (TYPE_TAG_NAME (type), "&str") == 0));
}
/* Return true if TYPE is a range type, otherwise false. */
+2017-10-02 Tom Tromey <tom@tromey.com>
+
+ * gdb.rust/simple.exp: Test index of slice.
+
2017-09-27 Tom Tromey <tom@tromey.com>
* gdb.base/macscp.exp: Add __VA_OPT__ tests.
gdb_test "print *(&c as *const i32)" " = 0"
gdb_test "print *(&c as *mut i32)" " = 0"
+gdb_test "print/c f\[0\]" " = 104 'h'"
+
gdb_test "print j" " = simple::Unit"
gdb_test "ptype j" " = struct simple::Unit"
gdb_test "print j2" " = simple::Unit"