Bug 414192 - Debug Expressions view: expression value isn't updated
Summary: Debug Expressions view: expression value isn't updated
Status: ASSIGNED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.2   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-01 06:01 EDT by Artem Pisarenko CLA
Modified: 2020-09-04 15:19 EDT (History)
5 users (show)

See Also:


Attachments
Sample project to debug (1.26 MB, application/octet-stream)
2016-12-01 06:53 EST, Stanislav Perepelitsa CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Artem Pisarenko CLA 2013-08-01 06:01:24 EDT
I'm using latest Eclipse CDT Kepler Release and debuging application via gdb using  Standard GDB Hardware Debugging Launcher.
I found that expression once added isn't updated anymore. Nothing helps: reevaluating, disabling/enabling, changing views, reselection debug session or thread (in Debug view), even deleting and adding same expression again ! It's being updated only after I change it slightly (surround in parentheses).
I've checked gdb console and it shows that gdb always return correct values. But eclipse just doesn't update it in gui showing some old (cached?) value.
Comment 1 Stanislav Perepelitsa CLA 2016-12-01 06:51:39 EST
This bug also took place with GDB-DSF session type.

How to reproduce: 
1. Start Debug attached project
2. Step into twice (pointer now is in dbg_preprocessor_define.cpp)
3. Run to line 112, step over twice.
4. Add 'y' into Expression view => after step 3, y = 14
5. Run to dbg_preprocessor_include() in dbg_preprocessor.cpp and step into
6. Note here: we shadow 'y' by local variable 'int y= 5;'
7. Step over line 21
8. Check value of "y" in gdb console and Memory View also

Observed behavior:
In Variable view bottom, "y" has 2 values at the same time 
(Details:5 and 14)

--- re-play log ------------------------
GDB trace fragment on entering
-> void dbg_preprocessor_include(){

052,993 198-data-evaluate-expression --thread 1 --frame 0 y
053,014 198^done,value="0"

In Expression view:
Name : y
    Details:0
    Default:14
    Decimal:14
    Hex:0xe
    Binary:1110
    Octal:016
----------------------------
after step over;

742,672 (gdb)
742,697 211-data-evaluate-expression --thread 1 --frame 0 y
742,722 211^done,value="5"
----------------------------------
In expression view:

Name : y
    Details:5
    Default:14
    Decimal:14
    Hex:0xe
    Binary:1110
    Octal:016

In both cases |=y | int |  14
displayed in Expression view table.
Comment 2 Stanislav Perepelitsa CLA 2016-12-01 06:53:09 EST
Created attachment 265672 [details]
Sample project to debug
Comment 3 Alvaro Sanchez-Leon CLA 2016-12-09 08:52:22 EST
(In reply to Stanislav Perepelitsa from comment #2)
> Created attachment 265672 [details]
> Sample project to debug

could you please provide a minimal program to make it possible to compile it and reproduce the issue in any OS?