Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] memory monitor on pointer variable

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Harish Dewan
> Sent: Tuesday, January 24, 2012 2:21 AM
> To: CDT General developers list.
> Subject: Re: [cdt-dev] memory monitor on pointer variable
> 
> Hi,
> 
> >>Currently, when you add a memory monitor as an expression, 
> in the memory view,
> >>DSF stores the value of that expression and the label (the 
> expression itself).  That memory 
> >> address is fixed and is not updated.  
> 
> Because of this problem is, even if the variable is renamed 
> and again relaunched what it does is, it tries to create 
> memory monitor with same expression and address (which was 
> saved earlier by DSF), even if the variable does not exist.

Yeah, that is not clear at all to the user.
Could you open a bug about the bug?

> >>I think there is room for improvement there, at least for 
> the user-friendliness part.
> 
> Will it be a good idea to have a toolbar action or pop up 
> menu say "Refresh Memory Block" which will re-evaluate the 
> expression and if there is any change in the address then we 
> can update the user interface.
> If so I can try to contribute a patch for it.

With the example of renaming a variable, I'm not sure if this
approach would work, as the refresh would fail to find the
old expression.

How about two modes for monitors:
1- "fixed", where an expression is converted to its value 
at the time and kept fixed (as happens now), except that
we would show the absolute address instead of the expression.
2- "variable", were an expression is kept as the expression
string and updated each time its value changes.

I hope other will chime in with more input...

Thanks

Marc


> 
> 
> Thanks
> Harish Dewan
> Tensilica India
> 
> 
> 
> On Mon, Jan 23, 2012 at 9:32 PM, Marc Khouzam 
> <marc.khouzam@xxxxxxxxxxxx> wrote:
> 
> 
> 		Hi,
> 	 
> 	Currently, when you add a memory monitor as an 
> expression, in the memory view,
> 	DSF stores the value of that expression and the label 
> (the expression itself).  That memory
> 	address is fixed and is not updated.  In fact, if you 
> re-launch, your 'my_ptr' monitor
> 	will still show the memory address that you were 
> showing in the previous launch,
> 	even if the expression 'my_ptr' is currently completely 
> different.
> 	 
> 	I don't like this myself, but I wonder if there isn't a 
> reason behind it.
> 	For example, maybe the user expects a memory monitor to 
> be fixed so as
> 	to look at the same memory all the time.  (If that is 
> the case, maybe we
> 	should show the absolute addres instead of the 
> expression as the monitor).
> 	 
> 	I'm curious to know if more experienced people have an 
> explanation.
> 	Could be a behavior based on the platform even...
> 	 
> 	I think there is room for improvement there, at least 
> for the user-friendliness part.
> 	 
> 	Marc
> 	 
> 	 
> 	
> 	 
> 
> ________________________________
> 
> 		From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Harish Dewan
> 		Sent: Monday, January 23, 2012 7:06 AM
> 		To: cdt-dev@xxxxxxxxxxx
> 		Subject: [cdt-dev] memory monitor on pointer variable
> 		
> 		
> 		Hi All,
> 		I have a question regarding memory view.
> 		Put memory monitor on pointer variable , it 
> does not updates its memory address when we step,
> 		consider a simple program,
> 		
> 		int main()
> 		 {
> 		
> 		int i=100,*my_ptr,x=5,a=3,b=4,c=5,d=6;
> 		
> 		my_ptr=&i;
> 		my_ptr=&x;
> 		my_ptr=&a;
> 		
> 		return 0;
> 		}
> 		
> 		if I add memory monitor on 'my_ptr'  ,  say 
> address while I planted memory monitor my_ptr was at address 
> 0xe8e8e8e8
> 		now when I step, address of 'my_ptr' changes 
> but in memory view it does not updates.
> 		But if I add another memory monitor at 'my_ptr' 
> it will show correct address.
> 		
> 		so is this the desired behavior or is it a bug.
> 		
> 		
> 		Thanks
> 		Harish Dewan
> 		Tensilica India
> 		
> 		
> 
> 
> 	_______________________________________________
> 	cdt-dev mailing list
> 	cdt-dev@xxxxxxxxxxx
> 	https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 	
> 	
> 
> 
> 

Back to the top