2011-04-26 05:14:26 +08:00
|
|
|
//===-- UnwindAssembly.cpp ------------------------------*- C++ -*-===//
|
2010-09-10 15:49:16 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2010-12-21 05:45:22 +08:00
|
|
|
#include "lldb/lldb-private.h"
|
2010-09-10 15:49:16 +08:00
|
|
|
#include "lldb/Core/PluginManager.h"
|
|
|
|
#include "lldb/Core/PluginInterface.h"
|
2011-04-26 05:14:26 +08:00
|
|
|
#include "lldb/Target/UnwindAssembly.h"
|
2010-09-10 15:49:16 +08:00
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2011-04-26 05:14:26 +08:00
|
|
|
UnwindAssembly*
|
|
|
|
UnwindAssembly::FindPlugin (const ArchSpec &arch)
|
2010-09-10 15:49:16 +08:00
|
|
|
{
|
2011-04-26 05:14:26 +08:00
|
|
|
UnwindAssemblyCreateInstance create_callback;
|
2010-09-10 15:49:16 +08:00
|
|
|
|
|
|
|
for (uint32_t idx = 0;
|
2011-04-26 05:14:26 +08:00
|
|
|
(create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(idx)) != NULL;
|
2010-09-10 15:49:16 +08:00
|
|
|
++idx)
|
|
|
|
{
|
2013-04-19 06:45:39 +08:00
|
|
|
std::unique_ptr<UnwindAssembly> assembly_profiler_ap (create_callback (arch));
|
2010-09-10 15:49:16 +08:00
|
|
|
if (assembly_profiler_ap.get ())
|
|
|
|
return assembly_profiler_ap.release ();
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-04-26 12:39:08 +08:00
|
|
|
UnwindAssembly::UnwindAssembly (const ArchSpec &arch) :
|
|
|
|
m_arch (arch)
|
2010-09-10 15:49:16 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-04-26 05:14:26 +08:00
|
|
|
UnwindAssembly::~UnwindAssembly ()
|
2010-09-10 15:49:16 +08:00
|
|
|
{
|
|
|
|
}
|