GNOME Bugzilla – Bug 386594
Display doesn't update variables content
Last modified: 2009-05-26 19:01:51 UTC
I have a function that takes a pointer to a class as argument. Within this function, I call a method that modifies the content of member variables. So, when stepping through this code, the value of the member being updated should change. It's done internally but the display (the "value" field of the "Variables" tab) doesn't reflect it - the display is not updated.
If I understand correctly, What don't get updated (when you step in the function) is the members of the class _pointed_ to by the pointer declared in the current scope. On the other hand, if you have a local instance of a class (not a pointer to an instance), the members of that instance get updated. Don't they ?
Indeed, that's exactly what I meant. Sorry for my confusing explanation.
Hello, Changeset #362 should fix your problem. Closing the bug for now. Cheers, Dodji.
I have still this bug on Nemiver 0.6.3. My variables content are often not updated in the "Variables" tab. I will attach a file on the next message to explain the bug that I have.
Created attachment 123758 [details] Fictive C source file I attach a fictive C source file to illustrate the bug. On a next message, I will attach a screen shot. Here's how to reproduce the bug: 1) Compile this source and open the executable with Nemiver: gcc -g exemple.c -o exemple && nemiver exemple 2) For all this demonstration, I use the Step ("Execute next line, stepping into the next function, if any") action. 3) We start on line 11 (Nemiver puts automatically a breakpoint at this line). Actual situation: tab array isn't initialized (see the dot number 1 on the next attached image). That's ok. 4) Do Step. We're now on the line 12. The tab array should be initialized, but its content isn't updated in the "Variables" tab (see the dot 2 on the next image). For comparison, on Eclipse, at this line 12, we correctly see the good tab content. 5) Do Step until the line 18. We see for the first time the updated tab content. 6) Do Step until the line 20. tab[0] should has the value -1, but it's not updated in the "Variables" tab. Click right on ptr and select "Dereference the pointer". The displayed value of *ptr is still 17, but it should be -1 (see the dot 3 on the next image). 7) Do Step until enter another time on the rechMax function. Do Step until the line 29. Dereference the p local variable and the t function argument. We see *p = 17 and *t = 17. We should see -1 instead of 17. 8) Finish the execution of the rechMax function and Step until the line 20. tab[3] should has the value -1, but it doesn't. We see tab[3] = 14. *ptr should have the value -1, but we see 17 (see the dot 4 in the next image). 9) Etc.
Created attachment 123759 [details] Fictive C source file The line numbers aren't good in the previous source attached. I change the file.
Created attachment 123760 [details] The screen shot of the variables content
Created attachment 127768 [details] "Dereferenced Variables" not updated Unfortunately, this bug makes Nemiver almost unusable. I'll give another example with this code: int main (void) { int a = 5; int *p = &a; a = 5; *p = 0; return 0; } The line *p = 0; doesn't update "Dereferenced Variables" in the "Variable" tab.
Okay, I am looking at this bug at the moment. Thanks for all the input you gave. That's very much appreciated.
Hello Jean-Philippe, I wanted to let you know that I am working on this issue. It's taking time, but things are going forward :) Actually I am adding the support of a GDB feature that is named "Variable Objects". When that feature is complete, I believe this bug should go away. I have created bug #573678 to track the progress of that feature. I am setting that bug as a dependency for this one. Stay tuned.
(In reply to comment #10) > I wanted to let you know that I am working on this issue. It's taking time, but > things are going forward :) Thanks a lot for giving news about this report. > Stay tuned. Yes! :-)
(In reply to comment #11) > Thanks a lot for giving news about this report. No problem. I really appreciated that you file a so detailed bug report about the issue. Also that issue has been bugging me for a while, and I made several attempts at fixing it :) For now, in the varobjs-support branch, I think the problem about dereferenced variables not being updated is now resolved. Also variable dereferencing is done in a more elegant way, as you just have to unfold the node of the pointer to have it dereferenced. No more need to right click, click a dereference menu item etc... I still need time to test/debug the branch before merging it into master. Thanks again for your time.
Okay this bug should be fixed now, as the content of the varobjs-support branch got merged into the master branch. It should be available in the next release of Nemiver.