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
This commit is contained in:
Greg Clayton
2011-09-22 04:58:26 +00:00
parent 3d10b95bf7
commit c14ee32db5
59 changed files with 1112 additions and 737 deletions

View File

@@ -77,7 +77,7 @@ ClangUtilityFunction::Install (Stream &error_stream,
// Set up the target and compiler
//
Target *target = exe_ctx.target;
Target *target = exe_ctx.GetTargetPtr();
if (!target)
{
@@ -85,7 +85,7 @@ ClangUtilityFunction::Install (Stream &error_stream,
return false;
}
Process *process = exe_ctx.process;
Process *process = exe_ctx.GetProcessPtr();
if (!process)
{
@@ -101,7 +101,7 @@ ClangUtilityFunction::Install (Stream &error_stream,
m_expr_decl_map.reset(new ClangExpressionDeclMap(keep_result_in_memory));
m_data_allocator.reset(new ProcessDataAllocator(*exe_ctx.process));
m_data_allocator.reset(new ProcessDataAllocator(*process));
if (!m_expr_decl_map->WillParse(exe_ctx))
{
@@ -147,8 +147,8 @@ ClangUtilityFunction::Install (Stream &error_stream,
log->Printf("Data buffer contents:\n%s", dump_string.GetString().c_str());
}
if (exe_ctx.process && m_jit_start_addr != LLDB_INVALID_ADDRESS)
m_jit_process_sp = exe_ctx.process->GetSP();
if (m_jit_start_addr != LLDB_INVALID_ADDRESS)
m_jit_process_sp = process->GetSP();
#if 0
// jingham: look here