Bug 426203 - Optimized-out variable triggers "Multiple errors reported" but the errors are the same
Summary: Optimized-out variable triggers "Multiple errors reported" but the errors are...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-20 21:46 EST by Marc-André Laperle CLA
Modified: 2020-09-04 15:17 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Laperle CLA 2014-01-20 21:46:20 EST
GDB 7.6.50.20131218-cvs-ubuntu

struct Test {
    int a;
};

int main() {
    Test * t;
    return 0;
}

1. Compile the sample code with -O0 -g3
2. Start debugging
3. Add 't' to the Expressions view or hover on the variable
4. In the value columns, there is this message:

Error: Multiple errors reported.\ Failed to execute MI command: -var-create - * t Error message from debugger back end: value has been optimized out\ Unable to create variable object	

But in the GDB traces, it's the same message twice:

234,810 49-var-create --thread 1 --frame 0 - * t+0
234,812 49^error,msg="value has been optimized out"
234,812 (gdb) 
234,815 50-var-create --thread 1 --frame 0 - * t+0
234,816 50^error,msg="value has been optimized out"
234,816 (gdb) 

It would be more helpful if it just said "value has been optimized out" in the Value column.