// instructions are finished for migrating breakpoints past the
// stack frame setup instructions when we don't have line table information.
- FuncUnwinders (lldb_private::UnwindTable& unwind_table, const lldb::UnwindAssemblySP& assembly_profiler, AddressRange range);
+ FuncUnwinders (lldb_private::UnwindTable& unwind_table, AddressRange range);
~FuncUnwinders ();
InvalidateNonCallSiteUnwindPlan (lldb_private::Thread& Thread);
private:
+
+ lldb::UnwindAssemblySP
+ GetUnwindAssemblyProfiler ();
+
UnwindTable& m_unwind_table;
- lldb::UnwindAssemblySP m_assembly_profiler;
AddressRange m_range;
Mutex m_mutex;
FuncUnwinders::FuncUnwinders
(
UnwindTable& unwind_table,
- const lldb::UnwindAssemblySP& assembly_profiler,
AddressRange range
) :
m_unwind_table(unwind_table),
- m_assembly_profiler(assembly_profiler),
m_range(range),
m_mutex (Mutex::eMutexTypeNormal),
m_unwind_plan_call_site_sp (),
Mutex::Locker locker (m_mutex);
if (m_tried_unwind_at_non_call_site == false && m_unwind_plan_non_call_site_sp.get() == nullptr)
{
- m_tried_unwind_at_non_call_site = true;
- if (m_assembly_profiler)
+ UnwindAssemblySP assembly_profiler_sp (GetUnwindAssemblyProfiler());
+ if (assembly_profiler_sp)
{
m_unwind_plan_non_call_site_sp.reset (new UnwindPlan (lldb::eRegisterKindGeneric));
- if (!m_assembly_profiler->GetNonCallSiteUnwindPlanFromAssembly (m_range, thread, *m_unwind_plan_non_call_site_sp))
+ if (!assembly_profiler_sp->GetNonCallSiteUnwindPlanFromAssembly (m_range, thread, *m_unwind_plan_non_call_site_sp))
m_unwind_plan_non_call_site_sp.reset();
}
}
if (m_tried_unwind_fast == false && m_unwind_plan_fast_sp.get() == nullptr)
{
m_tried_unwind_fast = true;
- if (m_assembly_profiler)
+ UnwindAssemblySP assembly_profiler_sp (GetUnwindAssemblyProfiler());
+ if (assembly_profiler_sp)
{
m_unwind_plan_fast_sp.reset (new UnwindPlan (lldb::eRegisterKindGeneric));
- if (!m_assembly_profiler->GetFastUnwindPlan (m_range, thread, *m_unwind_plan_fast_sp))
+ if (!assembly_profiler_sp->GetFastUnwindPlan (m_range, thread, *m_unwind_plan_fast_sp))
m_unwind_plan_fast_sp.reset();
}
}
if (m_first_non_prologue_insn.IsValid())
return m_first_non_prologue_insn;
ExecutionContext exe_ctx (target.shared_from_this(), false);
- if (m_assembly_profiler)
- m_assembly_profiler->FirstNonPrologueInsn (m_range, exe_ctx, m_first_non_prologue_insn);
+ UnwindAssemblySP assembly_profiler_sp (GetUnwindAssemblyProfiler());
+ if (assembly_profiler_sp)
+ if (assembly_profiler_sp)
+ assembly_profiler_sp->FirstNonPrologueInsn (m_range, exe_ctx, m_first_non_prologue_insn);
return m_first_non_prologue_insn;
}
m_unwind_plan_call_site_sp = arch_default;
}
}
+
+lldb::UnwindAssemblySP
+FuncUnwinders::GetUnwindAssemblyProfiler ()
+{
+ UnwindAssemblySP assembly_profiler_sp;
+ ArchSpec arch;
+ if (m_unwind_table.GetArchitecture (arch))
+ {
+ assembly_profiler_sp = UnwindAssembly::FindPlugin (arch);
+ }
+ return assembly_profiler_sp;
+}
#include "lldb/Symbol/FuncUnwinders.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/DWARFCallFrameInfo.h"
-#include "lldb/Target/UnwindAssembly.h"
// There is one UnwindTable object per ObjectFile.
// It contains a list of Unwind objects -- one per function, populated lazily -- for the ObjectFile.
m_object_file (objfile),
m_unwinds (),
m_initialized (false),
- m_assembly_profiler (nullptr),
m_eh_frame (nullptr)
{
}
}
}
- ArchSpec arch;
- if (m_object_file.GetArchitecture (arch))
- {
- m_assembly_profiler = UnwindAssembly::FindPlugin (arch);
- m_initialized = true;
- }
+ m_initialized = true;
}
UnwindTable::~UnwindTable ()
}
}
- FuncUnwindersSP func_unwinder_sp(new FuncUnwinders(*this, m_assembly_profiler, range));
+ FuncUnwindersSP func_unwinder_sp(new FuncUnwinders(*this, range));
m_unwinds.insert (insert_pos, std::make_pair(range.GetBaseAddress().GetFileAddress(), func_unwinder_sp));
// StreamFile s(stdout, false);
// Dump (s);
}
}
- FuncUnwindersSP func_unwinder_sp(new FuncUnwinders(*this, m_assembly_profiler, range));
+ FuncUnwindersSP func_unwinder_sp(new FuncUnwinders(*this, range));
return func_unwinder_sp;
}
Initialize();
return m_eh_frame;
}
+
+bool
+UnwindTable::GetArchitecture (lldb_private::ArchSpec &arch)
+{
+ return m_object_file.GetArchitecture (arch);
+}