diff options
author | Greg Clayton <gclayton@apple.com> | 2011-09-22 04:58:26 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-09-22 04:58:26 +0000 |
commit | c14ee32db561671a16759c8307d5391646cb87c4 (patch) | |
tree | 33eea53e3b30461a2452c79eca2e668aa9537500 /lldb/source/Core/ValueObjectVariable.cpp | |
parent | 3d10b95bf7f72dd7abbb1bb6a8412708a579d315 (diff) | |
download | bcm5719-llvm-c14ee32db561671a16759c8307d5391646cb87c4.tar.gz bcm5719-llvm-c14ee32db561671a16759c8307d5391646cb87c4.zip |
Converted the lldb_private::Process over to use the intrusive
shared pointers.
Changed the ExecutionContext over to use shared pointers for
the target, process, thread and frame since these objects can
easily go away at any time and any object that was holding onto
an ExecutionContext was running the risk of using a bad object.
Now that the shared pointers for target, process, thread and
frame are just a single pointer (they all use the instrusive
shared pointers) the execution context is much safer and still
the same size.
Made the shared pointers in the the ExecutionContext class protected
and made accessors for all of the various ways to get at the pointers,
references, and shared pointers.
llvm-svn: 140298
Diffstat (limited to 'lldb/source/Core/ValueObjectVariable.cpp')
-rw-r--r-- | lldb/source/Core/ValueObjectVariable.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp index 5717406ba20..bc5dd261278 100644 --- a/lldb/source/Core/ValueObjectVariable.cpp +++ b/lldb/source/Core/ValueObjectVariable.cpp @@ -126,10 +126,11 @@ ValueObjectVariable::UpdateValue () lldb::addr_t loclist_base_load_addr = LLDB_INVALID_ADDRESS; ExecutionContext exe_ctx (GetExecutionContextScope()); - if (exe_ctx.target) + Target *target = exe_ctx.GetTargetPtr(); + if (target) { - m_data.SetByteOrder(exe_ctx.target->GetArchitecture().GetByteOrder()); - m_data.SetAddressByteSize(exe_ctx.target->GetArchitecture().GetAddressByteSize()); + m_data.SetByteOrder(target->GetArchitecture().GetByteOrder()); + m_data.SetAddressByteSize(target->GetArchitecture().GetAddressByteSize()); } if (expr.IsLocationList()) @@ -137,7 +138,7 @@ ValueObjectVariable::UpdateValue () SymbolContext sc; variable->CalculateSymbolContext (&sc); if (sc.function) - loclist_base_load_addr = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (exe_ctx.target); + loclist_base_load_addr = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (target); } Value old_value(m_value); if (expr.Evaluate (&exe_ctx, GetClangAST(), NULL, NULL, NULL, loclist_base_load_addr, NULL, m_value, &m_error)) @@ -187,7 +188,8 @@ ValueObjectVariable::UpdateValue () // Make sure this type has a value before we try and read it // If we have a file address, convert it to a load address if we can. - if (value_type == Value::eValueTypeFileAddress && exe_ctx.process && exe_ctx.process->IsAlive()) + Process *process = exe_ctx.GetProcessPtr(); + if (value_type == Value::eValueTypeFileAddress && process && process->IsAlive()) { lldb::addr_t file_addr = m_value.GetScalar().ULongLong(LLDB_INVALID_ADDRESS); if (file_addr != LLDB_INVALID_ADDRESS) @@ -200,7 +202,7 @@ ValueObjectVariable::UpdateValue () if (objfile) { Address so_addr(file_addr, objfile->GetSectionList()); - lldb::addr_t load_addr = so_addr.GetLoadAddress (exe_ctx.target); + lldb::addr_t load_addr = so_addr.GetLoadAddress (target); if (load_addr != LLDB_INVALID_ADDRESS) { m_value.SetValueType(Value::eValueTypeLoadAddress); |