Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 847
kaiser Avatar asked Jan 19 '26 02:01

kaiser


1 Answers

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

like image 163
Arjun Avatar answered Jan 22 '26 03:01

Arjun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!