Bug 233504 - [registers] Changing register causes derefernce error message
Summary: [registers] Changing register causes derefernce error message
Status: ASSIGNED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 0 DD 1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-22 13:37 EDT by Randy Rohrbach CLA
Modified: 2020-09-04 15:18 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Rohrbach CLA 2008-05-22 13:37:43 EDT
When changing a general purpose register ( $eax in this case ) an error

"Attempt to take address of value not located in memory."

is issued in the console window. The value is changed correctly but there should not really be an error.

This seems to come from the lower level service which uses variable creation to accomplish the modification.

224,812 131-var-create - * $eax
224,827 131^done,name="var1",numchild="0",type="int"
224,827 132-var-evaluate-expression var1
224,858 132^done,value="11"
224,858 133-var-assign var1 12
224,874 133^done,value="12"
224,874 134-data-evaluate-expression &($eax)
224,874 135-data-list-register-values x 0
224,890 &"Attempt to take address of value not located in memory.\n"

224,890 134^error,msg="Attempt to take address of value not located in memory."

It does not make sense to try and take the address of a general purpose register.

Randy
Comment 1 Marc Khouzam CLA 2008-05-22 13:51:34 EDT
(In reply to comment #0)

> 224,812 131-var-create - * $eax
> 224,827 131^done,name="var1",numchild="0",type="int"
> 224,827 132-var-evaluate-expression var1
> 224,858 132^done,value="11"
> 224,858 133-var-assign var1 12
> 224,874 133^done,value="12"
> 224,874 134-data-evaluate-expression &($eax)
> 224,874 135-data-list-register-values x 0
> 224,890 &"Attempt to take address of value not located in memory.\n"
> 
> 224,890 134^error,msg="Attempt to take address of value not located in memory."
> 
> It does not make sense to try and take the address of a general purpose
> register.

When changing the value of an expression, an ExpressionChangeEvent is sent.  The Memory service triggers off that and requests the address of the expression, to know where the memory changed.

I assume the Memory view does not show registers, and therefore, that there is no point in the memory service triggering on the change of a register.  I guess a simple solution is for the memory service to check if the expression starts with a $ and if it does, to ignore it. 
Comment 2 Marc Khouzam CLA 2008-05-22 13:52:55 EDT
(In reply to comment #1)
> I guess
> a simple solution is for the memory service to check if the expression starts
> with a $ and if it does, to ignore it. 

Or maybe it is even better for the ExpressionService to check this and return a handleFailure?