How to view the contents of a vector of tuples when debugging in LLDB?

1.6k Views Asked by At

I'm using Visual Studio Code and the LLDB Debugger (CodeLLDB vadimcn.vscode-lldb) for programming in Rust. When using Vec<u64> I can see all values in a list (until a limit of > 10000):

All entries of Vec

When using a vector of tuples (Vec<(u64, u64)>), I can't see inside the vector.

enter image description here

When digging a bit deeper, I only find a pointer which points to the first entry in the vector. I'm not able to get to another position in my vector.

How do I get the content of the whole vector? Maybe with some watch expression?

I'm using Rust 1.44.1

1

There are 1 best solutions below

0
Arjun On BEST ANSWER

This issue has been addressed in the latest version of CodeLLDB v1.7.0

rust : 1.60.0 (7737e0b5c 2022-04-04)
vscode: v1.67.0\

Code used

use std::vec;

fn main() {
    let my_vec_of_tuples: Vec<(u64, u64)> = vec![(1, 2), (3, 4)];
    println!("you guessed : {:?}", my_vec_of_tuples);
}

code lldb debug view

my_vec_of_tuples: (2) vec![(1, 2), (3, 4)]
my_vec_of_tuples[0]: (1, 2)

Know it's not recommended to post images as part of answers but it's more appropriate here and required to answer the image.

enter image description here