This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rust/22236] New: string slices print too much


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]