Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 163509

Summary: Variables View is not updated after changing value
Product: z_Archived Reporter: Toshihiro Izumi <euthanasia_waltz>
Component: PDTAssignee: moshe <moshe>
Status: CLOSED FIXED QA Contact: Yossi Luson <yossi.l>
Severity: normal    
Priority: P2 Keywords: plan
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
screenshots none

Description Toshihiro Izumi CLA 2006-11-06 00:48:30 EST
There is a case that Variables View is not updated after changing value.
Comment 1 Toshihiro Izumi CLA 2006-11-06 00:49:09 EST
Created attachment 53274 [details]
screenshots
Comment 2 Michael Schreiber CLA 2007-02-09 11:33:48 EST
Some more details and samplecode:
#b# is a breakpoint

	class cTest{
		var $myName;
		var $mySurname;
		
		public function cTest($name,$surname){
			$this->myName = $name;
			$this->mySurname = $surname;
		}
	}
#b#	$TC = new cTest("M","S");

Problem:
Run to brakpoint
step into constructor and watch $this->myName and $this->mySurname
Both seem to remain "null". Switch to another tab(Expressions for example) and back to Variables, the values now displayed are correct.
Comment 3 moshe CLA 2007-02-15 10:57:15 EST
replace the follopwing methods in PHPVariable:

    public IValue getValue() throws DebugException { 
        // fix bug 163509 - Variables View is not updated after changing value.
    	// we sync the variables from the monitor which refreshes the VariablesView with
    	// the ExpressionManager cached variables with updated values. 
    	if (!global) {
    		((PHPDebugTarget)getDebugTarget()).getExpressionManager().update(variable, 2);
	        pValue.updateValue(variable.getValue());
        }
        hasChanged = false;
        return pValue;
    }

	public int hashCode() {
		int valueHash = 0;
		valueHash = pValue.hashCode();
		return getDebugTarget().hashCode() + valueHash+ variable.getFullName().hashCode();
	}
Comment 4 Shalom Gibly CLA 2007-02-18 09:10:06 EST
Applied the patch.
Thanks Moshe!
Comment 5 Gadi Goldbarg CLA 2007-02-19 06:22:20 EST
Yosi.l: fixed - should test on latest build
Comment 6 Gadi Goldbarg CLA 2007-02-20 16:38:52 EST
fixed
Comment 7 Shalom Gibly CLA 2007-06-20 04:02:57 EDT
Reopening this bug since the solution might cause communication problems when 
dealing with large variables trees and slow connection.
Comment 8 Shalom Gibly CLA 2007-06-20 04:04:53 EDT
Please retest. 
I removed the previous fix and it appears that the Eclipse 3.3 Europa does not 
have this refresh issue.
Comment 9 Gadi Goldbarg CLA 2007-06-24 10:22:08 EDT
closing this bug after verifing it on a multie vlaues file