Files
llvm/lldb/source/Core/DynamicLoader.cpp
Jim Ingham 2995077d8a Add "target.process.stop-on-shared-library-events" setting, and make it work.
Add the ability to give breakpoints a "kind" string, and have the StopInfoBreakpoint
print that in the brief description if set.  Also print the kind - if set - in the breakpoint
listing.
Give kinds to a bunch of the internal breakpoints.
We were deleting the Mac OS X dynamic loader breakpoint as though the id we had stored away was
a breakpoint site ID, but in fact it was a breakpoint id, so we never actually deleted it.  Fixed that.

llvm-svn: 173555
2013-01-26 02:19:28 +00:00

76 lines
2.3 KiB
C++

//===-- DynamicLoader.cpp ---------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "lldb/lldb-private.h"
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/Process.h"
#include "lldb/Core/PluginManager.h"
using namespace lldb;
using namespace lldb_private;
DynamicLoader*
DynamicLoader::FindPlugin (Process *process, const char *plugin_name)
{
DynamicLoaderCreateInstance create_callback = NULL;
if (plugin_name)
{
create_callback = PluginManager::GetDynamicLoaderCreateCallbackForPluginName (plugin_name);
if (create_callback)
{
std::auto_ptr<DynamicLoader> instance_ap(create_callback(process, true));
if (instance_ap.get())
return instance_ap.release();
}
}
else
{
for (uint32_t idx = 0; (create_callback = PluginManager::GetDynamicLoaderCreateCallbackAtIndex(idx)) != NULL; ++idx)
{
std::auto_ptr<DynamicLoader> instance_ap(create_callback(process, false));
if (instance_ap.get())
return instance_ap.release();
}
}
return NULL;
}
//----------------------------------------------------------------------
// DynamicLoader constructor
//----------------------------------------------------------------------
DynamicLoader::DynamicLoader(Process *process) :
m_process (process)
{
}
//----------------------------------------------------------------------
// Destructor
//----------------------------------------------------------------------
DynamicLoader::~DynamicLoader()
{
}
//----------------------------------------------------------------------
// Accessosors to the global setting as to whether to stop at image
// (shared library) loading/unloading.
//----------------------------------------------------------------------
bool
DynamicLoader::GetStopWhenImagesChange () const
{
return m_process->GetStopOnSharedLibraryEvents();
}
void
DynamicLoader::SetStopWhenImagesChange (bool stop)
{
m_process->SetStopOnSharedLibraryEvents (stop);
}