code-debug icon indicating copy to clipboard operation
code-debug copied to clipboard

Rust variables cut off

Open Schmeckinger opened this issue 7 years ago • 2 comments

An example of a rust variable in gdb is x = core::option::Option<i32>::Some(7). The regex const variableRegex = /^[a-zA-Z_\-][a-zA-Z0-9_\-]*/; cuts this variable to core. For it to work correctly you would have to add :<>() to the second group in the regex.

I don't know if this would mess things up somewhere else, but in this example it works once you add these chars to the regex.

fn main() {
    let x: Option<i32> = Some(7);
    println!("{:?}", x);
}

gdb version 8.2

Schmeckinger avatar Oct 17 '18 14:10 Schmeckinger

do you mean the variable name is cut off?

WebFreak001 avatar Oct 17 '18 19:10 WebFreak001

No the value is cut off.

It says:

x: <unkown>
    <value>: core

Instead of:

x: <unkown>
    <value>: core::option::Option<i32>::Some(7)

Or:

x: <unkown>
    <value>: Some(7)

If you hover the variable name it works fine and says core::option::Option<i32>.

Schmeckinger avatar Oct 17 '18 22:10 Schmeckinger