Fix &str printing in Rust
authorTom Tromey <tom@tromey.com>
Mon, 2 Oct 2017 19:55:42 +0000 (13:55 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 2 Oct 2017 20:06:48 +0000 (14:06 -0600)
commit45320ffa0450b27e232d933d2a1c6a09d94ac18b
tree82e528f5a61c63c6b01d67694039d754c7fad440
parentb3e3859bc577db5b79bb3d39048fd46c0a0420ef
Fix &str printing in Rust

Printing a string slice ("&str") in Rust would print until the
terminating \0; but that is incorrect because a slice has a length.
This fixes &str printing, and arranges to preserve the type name when
slicing a slice, so that printing a slice of an "&str" works as well.

This is PR rust/22236.

2017-10-02  Tom Tromey  <tom@tromey.com>

PR rust/22236:
* rust-lang.c (rust_val_print_str): New function.
(val_print_struct): Call it.
(rust_subscript): Preserve name of slice type.

2017-10-02  Tom Tromey  <tom@tromey.com>

PR rust/22236:
* gdb.rust/simple.rs (main): New variable "fslice".
* gdb.rust/simple.exp: Add slice tests.  Update string tests.
gdb/ChangeLog
gdb/rust-lang.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.rust/simple.exp
gdb/testsuite/gdb.rust/simple.rs
This page took 0.042021 seconds and 4 git commands to generate.