Skip to content

gdb BTreeMap pretty printer is incorrect #55771

Closed
@tromey

Description

@tromey

As noted here, the BTreeMap pretty-printer for gdb only works for a small number of elements.

For example, this works:

use std::collections::BTreeMap;

pub fn main() {
    let mut btree_map = BTreeMap::new();
    for i in 0..10 {
        btree_map.insert(i, i * 2);
    }
    let x = 72;
}

However, if you change the 10 to 15, it will stop working:

(gdb) p btree_map 
$1 = BTreeMap<i32, i32>(len: 15) = {
  [6] = 12,
  [0] = 32767,
  [1431906992] = 0,
  [21845] = 11,
  [1431907048] = 22,
  [21845] = 21845,
  [4] = -12448,
  [0] = 32767,
  [1431907004] = -11872,
  [21845] = 32767,
  [4] = 1431680491,
  [12] = 0,
  [32767] = 1431906880,
  [0] = 21845,
  [11] = 1431906992
}

Metadata

Metadata

Assignees

Labels

A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions