This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug rust/22236] New: string slices print too much
- From: "tromey at sourceware dot org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 02 Oct 2017 16:50:10 +0000
- Subject: [Bug rust/22236] New: string slices print too much
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=22236
Bug ID: 22236
Summary: string slices print too much
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: rust
Assignee: unassigned at sourceware dot org
Reporter: tromey at sourceware dot org
Target Milestone: ---
Consider this program:
fn main() {
let c = "a/b";
let d = &c[..1];
println!("done");
}
Set a breakpoint on the println and run.
Then print "d":
(gdb) p d
$2 = &str {
data_ptr: 0x100044280 <str> "a/b\000",
length: 1
}
Since length is 1 I would expect this to just print "a".
--
You are receiving this mail because:
You are on the CC list for the bug.