}
}
+ /* Print the slice type here. This was gdb's historical behavior
+ (from before unsized types were generically handled) and helps
+ make it clear that the user is seeing a slice, not an array.
+ Only arrays must be handled as the other cases are handled by
+ value_print_inner. */
+ if (type->code () == TYPE_CODE_ARRAY)
+ {
+ type_print (orig_type, "", stream, -1);
+ gdb_printf (stream, " ");
+ }
+
value_print_inner (val, stream, recurse, options);
}
global hex
# Just accept any array here.
- set result " = \\\[.*\\\]"
+ set result " = &\\\[.*\\\] \\\[.*\\\]"
gdb_test "print $svar" $result
gdb_test "print &${base}\[${range}\]" $result
gdb_test "ptype us" " = .*V<\\\[u8\\\]>.*"
if {[rust_at_least 1.61]} {
- gdb_test "print us2" " = \\\[1, 2, 3\\\]"
+ gdb_test "print us2" " = .*u8.* \\\[1, 2, 3\\\]"
gdb_test "ptype us2" "type = .*"
}