Skip to content
Commit c0e8a85e authored by Greg Clayton's avatar Greg Clayton
Browse files

Modified Value.cpp to share the code that gets the values as bytes...

Modified Value.cpp to share the code that gets the values as bytes (Value::GetValueAsData()) so now Value::ResolveValue() doesn't do its own thing by reading memory directly.

Also modified the Value class so that you can evaluate expressions without a process, yet with some sections loaded in the target. This allows casting pointers that are in data sections to types and being able to evaluate expressions in the data. For example:

(lldb) target create a.out
(lldb) target modules load --file a.out --slide 0
... find address of something in data ...
(lldb) script
expr_opts = lldb.SBExpressionOptions()
v = lldb.target.EvaluateExpression('(foo *)0x1230000', expr_opts)
print v
vv = lldb.value(v)
print v.pt.x

Above we were able to cast a pointer to an address which was in a.out's data
section and print out entire structures and navigate to the child ivars of the expression.

llvm-svn: 172227
parent a40a805f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment