summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBFrame.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-01-06 22:15:06 +0000
committerGreg Clayton <gclayton@apple.com>2011-01-06 22:15:06 +0000
commit5ccbd294b25d2666c42b28c7031c8e0eff197f25 (patch)
tree12e30d9acc1bdacd6c8d60f1e2bbb305c29683f3 /lldb/source/API/SBFrame.cpp
parent842a9bac486c5be187472044d2a8d7f93e140df3 (diff)
downloadbcm5719-llvm-5ccbd294b25d2666c42b28c7031c8e0eff197f25.tar.gz
bcm5719-llvm-5ccbd294b25d2666c42b28c7031c8e0eff197f25.zip
Fixed issues with RegisterContext classes and the subclasses. There was
an issue with the way the UnwindLLDB was handing out RegisterContexts: it was making shared pointers to register contexts and then handing out just the pointers (which would get put into shared pointers in the thread and stack frame classes) and cause double free issues. MallocScribble helped to find these issues after I did some other cleanup. To help avoid any RegisterContext issue in the future, all code that deals with them now returns shared pointers to the register contexts so we don't end up with multiple deletions. Also now that the RegisterContext class doesn't require a stack frame, we patched a memory leak where a StackFrame object was being created and leaked. Made the RegisterContext class not have a pointer to a StackFrame object as one register context class can be used for N inlined stack frames so there is not a 1 - 1 mapping. Updates the ExecutionContextScope part of the RegisterContext class to never return a stack frame to indicate this when it is asked to recreate the execution context. Now register contexts point to the concrete frame using a concrete frame index. Concrete frames are all of the frames that are actually formed on the stack of a thread. These concrete frames can be turned into one or more user visible frames due to inlining. Each inlined stack frame has the exact same register context (shared via shared pointers) as any parent inlined stack frames all the way up to the concrete frame itself. So now the stack frames and the register contexts should behave much better. llvm-svn: 122976
Diffstat (limited to 'lldb/source/API/SBFrame.cpp')
-rw-r--r--lldb/source/API/SBFrame.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp
index 6c1cf09a693..1f20e10e24f 100644
--- a/lldb/source/API/SBFrame.cpp
+++ b/lldb/source/API/SBFrame.cpp
@@ -426,7 +426,7 @@ SBFrame::FindValue (const char *name, ValueType value_type)
case eValueTypeRegister: // stack frame register value
{
- RegisterContext *reg_ctx = m_opaque_sp->GetRegisterContext();
+ RegisterContextSP reg_ctx (m_opaque_sp->GetRegisterContext());
if (reg_ctx)
{
const uint32_t num_regs = reg_ctx->GetRegisterCount();
@@ -446,7 +446,7 @@ SBFrame::FindValue (const char *name, ValueType value_type)
case eValueTypeRegisterSet: // A collection of stack frame register values
{
- RegisterContext *reg_ctx = m_opaque_sp->GetRegisterContext();
+ RegisterContextSP reg_ctx (m_opaque_sp->GetRegisterContext());
if (reg_ctx)
{
const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
@@ -640,7 +640,7 @@ SBFrame::GetRegisters ()
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetThread().GetProcess().GetTarget().GetAPIMutex());
- RegisterContext *reg_ctx = m_opaque_sp->GetRegisterContext();
+ RegisterContextSP reg_ctx (m_opaque_sp->GetRegisterContext());
if (reg_ctx)
{
const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
OpenPOWER on IntegriCloud