Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@ -0,0 +1,204 @@
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
add_definitions( -DEXPORT_LIBLLDB )
endif()
option(LLDB_BUILD_FRAMEWORK "Build the Darwin LLDB.framework" Off)
if(LLDB_BUILD_FRAMEWORK AND CMAKE_VERSION VERSION_LESS 3.7)
message(FATAL_ERROR "LLDB_BUILD_FRAMEWORK is not supported on CMake < 3.7")
endif()
if (LLDB_BUILD_FRAMEWORK AND NOT APPLE)
message(FATAL_ERROR "LLDB.framework cannot be generated unless targeting Apple platforms.")
endif()
get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
add_lldb_library(liblldb SHARED
SBAddress.cpp
SBAttachInfo.cpp
SBBlock.cpp
SBBreakpoint.cpp
SBBreakpointLocation.cpp
SBBreakpointName.cpp
SBBreakpointOptionCommon.cpp
SBBroadcaster.cpp
SBCommandInterpreter.cpp
SBCommandReturnObject.cpp
SBCommunication.cpp
SBCompileUnit.cpp
SBData.cpp
SBDebugger.cpp
SBDeclaration.cpp
SBError.cpp
SBEvent.cpp
SBExecutionContext.cpp
SBExpressionOptions.cpp
SBFileSpec.cpp
SBFileSpecList.cpp
SBFrame.cpp
SBFunction.cpp
SBHostOS.cpp
SBInstruction.cpp
SBInstructionList.cpp
SBLanguageRuntime.cpp
SBLaunchInfo.cpp
SBLineEntry.cpp
SBListener.cpp
SBMemoryRegionInfo.cpp
SBMemoryRegionInfoList.cpp
SBModule.cpp
SBModuleSpec.cpp
SBPlatform.cpp
SBProcess.cpp
SBProcessInfo.cpp
SBQueue.cpp
SBQueueItem.cpp
SBSection.cpp
SBSourceManager.cpp
SBStream.cpp
SBStringList.cpp
SBStructuredData.cpp
SBSymbol.cpp
SBSymbolContext.cpp
SBSymbolContextList.cpp
SBTarget.cpp
SBThread.cpp
SBThreadCollection.cpp
SBThreadPlan.cpp
SBTrace.cpp
SBTraceOptions.cpp
SBType.cpp
SBTypeCategory.cpp
SBTypeEnumMember.cpp
SBTypeFilter.cpp
SBTypeFormat.cpp
SBTypeNameSpecifier.cpp
SBTypeSummary.cpp
SBTypeSynthetic.cpp
SBValue.cpp
SBValueList.cpp
SBVariablesOptions.cpp
SBWatchpoint.cpp
SBUnixSignals.cpp
SystemInitializerFull.cpp
${LLDB_WRAP_PYTHON}
LINK_LIBS
lldbBase
lldbBreakpoint
lldbCore
lldbDataFormatters
lldbExpression
lldbHost
lldbInitialization
lldbInterpreter
lldbSymbol
lldbTarget
lldbUtility
${LLDB_ALL_PLUGINS}
LINK_COMPONENTS
Support
)
if (LLVM_ENABLE_WERROR)
if (MSVC)
set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
else()
set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
endif()
endif()
set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1)
if (CLANG_CL)
set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING
PROPERTY COMPILE_FLAGS " -Wno-unused-function")
endif()
if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND
NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING
PROPERTY COMPILE_FLAGS " -Wno-sequence-point -Wno-cast-qual")
endif ()
target_link_libraries(liblldb PRIVATE
lldbPluginScriptInterpreterNone
lldbPluginScriptInterpreterPython
)
set_target_properties(liblldb
PROPERTIES
VERSION ${LLDB_VERSION}
)
if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
if (NOT LLDB_EXPORT_ALL_SYMBOLS)
# If we're not exporting all symbols, we'll want to explicitly set
# the exported symbols here. This prevents 'log enable --stack ...'
# from working on some systems but limits the liblldb size.
MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb namespace")
add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb.exports)
else()
# Don't use an explicit export. Instead, tell the linker to
# export all symbols.
MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb and lldb_private namespaces")
add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb-private.exports)
endif()
endif()
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
# Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs,
# so only it needs to explicitly link against ${PYTHON_LIBRARY}
if (MSVC AND NOT LLDB_DISABLE_PYTHON)
target_link_libraries(liblldb PRIVATE ${PYTHON_LIBRARY})
endif()
else()
set_target_properties(liblldb
PROPERTIES
OUTPUT_NAME lldb
)
endif()
if (LLDB_WRAP_PYTHON)
add_dependencies(liblldb swig_wrapper)
endif()
if(LLDB_BUILD_FRAMEWORK)
file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h
${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h)
list(REMOVE_ITEM root_public_headers ${root_private_headers})
foreach(header ${public_headers} ${root_public_headers} ${LLDB_SOURCE_DIR}/include/lldb/Utility/SharingPtr.h)
get_filename_component(basename ${header} NAME)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}
DEPENDS ${header}
COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
endforeach()
add_custom_target(lldb-framework-headers DEPENDS ${framework_headers}
COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders ${LLDB_VERSION})
add_dependencies(liblldb lldb-framework-headers)
set_target_properties(liblldb PROPERTIES
OUTPUT_NAME LLDB
FRAMEWORK On
FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}
PUBLIC_HEADER "${framework_headers}")
if(NOT IOS)
add_custom_command(TARGET liblldb POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Headers
COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/Current
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $<TARGET_FILE_DIR:liblldb>/Resources/Clang
)
else()
add_custom_command(TARGET liblldb POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
)
endif()
endif()

View File

@ -0,0 +1,250 @@
//===-- SBAddress.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/API/SBAddress.h"
#include "lldb/API/SBProcess.h"
#include "lldb/API/SBSection.h"
#include "lldb/API/SBStream.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/Module.h"
#include "lldb/Symbol/LineEntry.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
using namespace lldb;
using namespace lldb_private;
SBAddress::SBAddress() : m_opaque_ap(new Address()) {}
SBAddress::SBAddress(const Address *lldb_object_ptr)
: m_opaque_ap(new Address()) {
if (lldb_object_ptr)
ref() = *lldb_object_ptr;
}
SBAddress::SBAddress(const SBAddress &rhs) : m_opaque_ap(new Address()) {
if (rhs.IsValid())
ref() = rhs.ref();
}
SBAddress::SBAddress(lldb::SBSection section, lldb::addr_t offset)
: m_opaque_ap(new Address(section.GetSP(), offset)) {}
// Create an address by resolving a load address using the supplied target
SBAddress::SBAddress(lldb::addr_t load_addr, lldb::SBTarget &target)
: m_opaque_ap(new Address()) {
SetLoadAddress(load_addr, target);
}
SBAddress::~SBAddress() {}
const SBAddress &SBAddress::operator=(const SBAddress &rhs) {
if (this != &rhs) {
if (rhs.IsValid())
ref() = rhs.ref();
else
m_opaque_ap.reset(new Address());
}
return *this;
}
bool lldb::operator==(const SBAddress &lhs, const SBAddress &rhs) {
if (lhs.IsValid() && rhs.IsValid())
return lhs.ref() == rhs.ref();
return false;
}
bool SBAddress::IsValid() const {
return m_opaque_ap.get() != NULL && m_opaque_ap->IsValid();
}
void SBAddress::Clear() { m_opaque_ap.reset(new Address()); }
void SBAddress::SetAddress(lldb::SBSection section, lldb::addr_t offset) {
Address &addr = ref();
addr.SetSection(section.GetSP());
addr.SetOffset(offset);
}
void SBAddress::SetAddress(const Address *lldb_object_ptr) {
if (lldb_object_ptr)
ref() = *lldb_object_ptr;
else
m_opaque_ap.reset(new Address());
}
lldb::addr_t SBAddress::GetFileAddress() const {
if (m_opaque_ap->IsValid())
return m_opaque_ap->GetFileAddress();
else
return LLDB_INVALID_ADDRESS;
}
lldb::addr_t SBAddress::GetLoadAddress(const SBTarget &target) const {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
lldb::addr_t addr = LLDB_INVALID_ADDRESS;
TargetSP target_sp(target.GetSP());
if (target_sp) {
if (m_opaque_ap->IsValid()) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
addr = m_opaque_ap->GetLoadAddress(target_sp.get());
}
}
if (log) {
if (addr == LLDB_INVALID_ADDRESS)
log->Printf(
"SBAddress::GetLoadAddress (SBTarget(%p)) => LLDB_INVALID_ADDRESS",
static_cast<void *>(target_sp.get()));
else
log->Printf("SBAddress::GetLoadAddress (SBTarget(%p)) => 0x%" PRIx64,
static_cast<void *>(target_sp.get()), addr);
}
return addr;
}
void SBAddress::SetLoadAddress(lldb::addr_t load_addr, lldb::SBTarget &target) {
// Create the address object if we don't already have one
ref();
if (target.IsValid())
*this = target.ResolveLoadAddress(load_addr);
else
m_opaque_ap->Clear();
// Check if we weren't were able to resolve a section offset address.
// If we weren't it is ok, the load address might be a location on the
// stack or heap, so we should just have an address with no section and
// a valid offset
if (!m_opaque_ap->IsValid())
m_opaque_ap->SetOffset(load_addr);
}
bool SBAddress::OffsetAddress(addr_t offset) {
if (m_opaque_ap->IsValid()) {
addr_t addr_offset = m_opaque_ap->GetOffset();
if (addr_offset != LLDB_INVALID_ADDRESS) {
m_opaque_ap->SetOffset(addr_offset + offset);
return true;
}
}
return false;
}
lldb::SBSection SBAddress::GetSection() {
lldb::SBSection sb_section;
if (m_opaque_ap->IsValid())
sb_section.SetSP(m_opaque_ap->GetSection());
return sb_section;
}
lldb::addr_t SBAddress::GetOffset() {
if (m_opaque_ap->IsValid())
return m_opaque_ap->GetOffset();
return 0;
}
Address *SBAddress::operator->() { return m_opaque_ap.get(); }
const Address *SBAddress::operator->() const { return m_opaque_ap.get(); }
Address &SBAddress::ref() {
if (m_opaque_ap.get() == NULL)
m_opaque_ap.reset(new Address());
return *m_opaque_ap;
}
const Address &SBAddress::ref() const {
// This object should already have checked with "IsValid()"
// prior to calling this function. In case you didn't we will assert
// and die to let you know.
assert(m_opaque_ap.get());
return *m_opaque_ap;
}
Address *SBAddress::get() { return m_opaque_ap.get(); }
bool SBAddress::GetDescription(SBStream &description) {
// Call "ref()" on the stream to make sure it creates a backing stream in
// case there isn't one already...
Stream &strm = description.ref();
if (m_opaque_ap->IsValid()) {
m_opaque_ap->Dump(&strm, NULL, Address::DumpStyleResolvedDescription,
Address::DumpStyleModuleWithFileAddress, 4);
StreamString sstrm;
// m_opaque_ap->Dump (&sstrm, NULL,
// Address::DumpStyleResolvedDescription, Address::DumpStyleInvalid,
// 4);
// if (sstrm.GetData())
// strm.Printf (" (%s)", sstrm.GetData());
} else
strm.PutCString("No value");
return true;
}
SBModule SBAddress::GetModule() {
SBModule sb_module;
if (m_opaque_ap->IsValid())
sb_module.SetSP(m_opaque_ap->GetModule());
return sb_module;
}
SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) {
SBSymbolContext sb_sc;
if (m_opaque_ap->IsValid())
m_opaque_ap->CalculateSymbolContext(&sb_sc.ref(), resolve_scope);
return sb_sc;
}
SBCompileUnit SBAddress::GetCompileUnit() {
SBCompileUnit sb_comp_unit;
if (m_opaque_ap->IsValid())
sb_comp_unit.reset(m_opaque_ap->CalculateSymbolContextCompileUnit());
return sb_comp_unit;
}
SBFunction SBAddress::GetFunction() {
SBFunction sb_function;
if (m_opaque_ap->IsValid())
sb_function.reset(m_opaque_ap->CalculateSymbolContextFunction());
return sb_function;
}
SBBlock SBAddress::GetBlock() {
SBBlock sb_block;
if (m_opaque_ap->IsValid())
sb_block.SetPtr(m_opaque_ap->CalculateSymbolContextBlock());
return sb_block;
}
SBSymbol SBAddress::GetSymbol() {
SBSymbol sb_symbol;
if (m_opaque_ap->IsValid())
sb_symbol.reset(m_opaque_ap->CalculateSymbolContextSymbol());
return sb_symbol;
}
SBLineEntry SBAddress::GetLineEntry() {
SBLineEntry sb_line_entry;
if (m_opaque_ap->IsValid()) {
LineEntry line_entry;
if (m_opaque_ap->CalculateSymbolContextLineEntry(line_entry))
sb_line_entry.SetLineEntry(line_entry);
}
return sb_line_entry;
}
AddressClass SBAddress::GetAddressClass() {
if (m_opaque_ap->IsValid())
return m_opaque_ap->GetAddressClass();
return eAddressClassInvalid;
}

View File

@ -0,0 +1,167 @@
//===-- SBAttachInfo.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/API/SBAttachInfo.h"
#include "lldb/API/SBFileSpec.h"
#include "lldb/API/SBListener.h"
#include "lldb/Target/Process.h"
using namespace lldb;
using namespace lldb_private;
SBAttachInfo::SBAttachInfo() : m_opaque_sp(new ProcessAttachInfo()) {}
SBAttachInfo::SBAttachInfo(lldb::pid_t pid)
: m_opaque_sp(new ProcessAttachInfo()) {
m_opaque_sp->SetProcessID(pid);
}
SBAttachInfo::SBAttachInfo(const char *path, bool wait_for)
: m_opaque_sp(new ProcessAttachInfo()) {
if (path && path[0])
m_opaque_sp->GetExecutableFile().SetFile(path, false);
m_opaque_sp->SetWaitForLaunch(wait_for);
}
SBAttachInfo::SBAttachInfo(const char *path, bool wait_for, bool async)
: m_opaque_sp(new ProcessAttachInfo()) {
if (path && path[0])
m_opaque_sp->GetExecutableFile().SetFile(path, false);
m_opaque_sp->SetWaitForLaunch(wait_for);
m_opaque_sp->SetAsync(async);
}
SBAttachInfo::SBAttachInfo(const SBAttachInfo &rhs)
: m_opaque_sp(new ProcessAttachInfo()) {
*m_opaque_sp = *rhs.m_opaque_sp;
}
SBAttachInfo::~SBAttachInfo() {}
lldb_private::ProcessAttachInfo &SBAttachInfo::ref() { return *m_opaque_sp; }
SBAttachInfo &SBAttachInfo::operator=(const SBAttachInfo &rhs) {
if (this != &rhs)
*m_opaque_sp = *rhs.m_opaque_sp;
return *this;
}
lldb::pid_t SBAttachInfo::GetProcessID() { return m_opaque_sp->GetProcessID(); }
void SBAttachInfo::SetProcessID(lldb::pid_t pid) {
m_opaque_sp->SetProcessID(pid);
}
uint32_t SBAttachInfo::GetResumeCount() {
return m_opaque_sp->GetResumeCount();
}
void SBAttachInfo::SetResumeCount(uint32_t c) {
m_opaque_sp->SetResumeCount(c);
}
const char *SBAttachInfo::GetProcessPluginName() {
return m_opaque_sp->GetProcessPluginName();
}
void SBAttachInfo::SetProcessPluginName(const char *plugin_name) {
return m_opaque_sp->SetProcessPluginName(plugin_name);
}
void SBAttachInfo::SetExecutable(const char *path) {
if (path && path[0])
m_opaque_sp->GetExecutableFile().SetFile(path, false);
else
m_opaque_sp->GetExecutableFile().Clear();
}
void SBAttachInfo::SetExecutable(SBFileSpec exe_file) {
if (exe_file.IsValid())
m_opaque_sp->GetExecutableFile() = exe_file.ref();
else
m_opaque_sp->GetExecutableFile().Clear();
}
bool SBAttachInfo::GetWaitForLaunch() {
return m_opaque_sp->GetWaitForLaunch();
}
void SBAttachInfo::SetWaitForLaunch(bool b) {
m_opaque_sp->SetWaitForLaunch(b);
}
void SBAttachInfo::SetWaitForLaunch(bool b, bool async) {
m_opaque_sp->SetWaitForLaunch(b);
m_opaque_sp->SetAsync(async);
}
bool SBAttachInfo::GetIgnoreExisting() {
return m_opaque_sp->GetIgnoreExisting();
}
void SBAttachInfo::SetIgnoreExisting(bool b) {
m_opaque_sp->SetIgnoreExisting(b);
}
uint32_t SBAttachInfo::GetUserID() { return m_opaque_sp->GetUserID(); }
uint32_t SBAttachInfo::GetGroupID() { return m_opaque_sp->GetGroupID(); }
bool SBAttachInfo::UserIDIsValid() { return m_opaque_sp->UserIDIsValid(); }
bool SBAttachInfo::GroupIDIsValid() { return m_opaque_sp->GroupIDIsValid(); }
void SBAttachInfo::SetUserID(uint32_t uid) { m_opaque_sp->SetUserID(uid); }
void SBAttachInfo::SetGroupID(uint32_t gid) { m_opaque_sp->SetGroupID(gid); }
uint32_t SBAttachInfo::GetEffectiveUserID() {
return m_opaque_sp->GetEffectiveUserID();
}
uint32_t SBAttachInfo::GetEffectiveGroupID() {
return m_opaque_sp->GetEffectiveGroupID();
}
bool SBAttachInfo::EffectiveUserIDIsValid() {
return m_opaque_sp->EffectiveUserIDIsValid();
}
bool SBAttachInfo::EffectiveGroupIDIsValid() {
return m_opaque_sp->EffectiveGroupIDIsValid();
}
void SBAttachInfo::SetEffectiveUserID(uint32_t uid) {
m_opaque_sp->SetEffectiveUserID(uid);
}
void SBAttachInfo::SetEffectiveGroupID(uint32_t gid) {
m_opaque_sp->SetEffectiveGroupID(gid);
}
lldb::pid_t SBAttachInfo::GetParentProcessID() {
return m_opaque_sp->GetParentProcessID();
}
void SBAttachInfo::SetParentProcessID(lldb::pid_t pid) {
m_opaque_sp->SetParentProcessID(pid);
}
bool SBAttachInfo::ParentProcessIDIsValid() {
return m_opaque_sp->ParentProcessIDIsValid();
}
SBListener SBAttachInfo::GetListener() {
return SBListener(m_opaque_sp->GetListener());
}
void SBAttachInfo::SetListener(SBListener &listener) {
m_opaque_sp->SetListener(listener.GetSP());
}

View File

@ -0,0 +1,297 @@
//===-- SBBlock.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/API/SBBlock.h"
#include "lldb/API/SBAddress.h"
#include "lldb/API/SBFileSpec.h"
#include "lldb/API/SBFrame.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBValue.h"
#include "lldb/Core/AddressRange.h"
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/Symbol/Block.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/Log.h"
using namespace lldb;
using namespace lldb_private;
SBBlock::SBBlock() : m_opaque_ptr(NULL) {}
SBBlock::SBBlock(lldb_private::Block *lldb_object_ptr)
: m_opaque_ptr(lldb_object_ptr) {}
SBBlock::SBBlock(const SBBlock &rhs) : m_opaque_ptr(rhs.m_opaque_ptr) {}
const SBBlock &SBBlock::operator=(const SBBlock &rhs) {
m_opaque_ptr = rhs.m_opaque_ptr;
return *this;
}
SBBlock::~SBBlock() { m_opaque_ptr = NULL; }
bool SBBlock::IsValid() const { return m_opaque_ptr != NULL; }
bool SBBlock::IsInlined() const {
if (m_opaque_ptr)
return m_opaque_ptr->GetInlinedFunctionInfo() != NULL;
return false;
}
const char *SBBlock::GetInlinedName() const {
if (m_opaque_ptr) {
const InlineFunctionInfo *inlined_info =
m_opaque_ptr->GetInlinedFunctionInfo();
if (inlined_info) {
Function *function = m_opaque_ptr->CalculateSymbolContextFunction();
LanguageType language;
if (function)
language = function->GetLanguage();
else
language = lldb::eLanguageTypeUnknown;
return inlined_info->GetName(language).AsCString(NULL);
}
}
return NULL;
}
SBFileSpec SBBlock::GetInlinedCallSiteFile() const {
SBFileSpec sb_file;
if (m_opaque_ptr) {
const InlineFunctionInfo *inlined_info =
m_opaque_ptr->GetInlinedFunctionInfo();
if (inlined_info)
sb_file.SetFileSpec(inlined_info->GetCallSite().GetFile());
}
return sb_file;
}
uint32_t SBBlock::GetInlinedCallSiteLine() const {
if (m_opaque_ptr) {
const InlineFunctionInfo *inlined_info =
m_opaque_ptr->GetInlinedFunctionInfo();
if (inlined_info)
return inlined_info->GetCallSite().GetLine();
}
return 0;
}
uint32_t SBBlock::GetInlinedCallSiteColumn() const {
if (m_opaque_ptr) {
const InlineFunctionInfo *inlined_info =
m_opaque_ptr->GetInlinedFunctionInfo();
if (inlined_info)
return inlined_info->GetCallSite().GetColumn();
}
return 0;
}
void SBBlock::AppendVariables(bool can_create, bool get_parent_variables,
lldb_private::VariableList *var_list) {
if (IsValid()) {
bool show_inline = true;
m_opaque_ptr->AppendVariables(can_create, get_parent_variables, show_inline,
[](Variable *) { return true; }, var_list);
}
}
SBBlock SBBlock::GetParent() {
SBBlock sb_block;
if (m_opaque_ptr)
sb_block.m_opaque_ptr = m_opaque_ptr->GetParent();
return sb_block;
}
lldb::SBBlock SBBlock::GetContainingInlinedBlock() {
SBBlock sb_block;
if (m_opaque_ptr)
sb_block.m_opaque_ptr = m_opaque_ptr->GetContainingInlinedBlock();
return sb_block;
}
SBBlock SBBlock::GetSibling() {
SBBlock sb_block;
if (m_opaque_ptr)
sb_block.m_opaque_ptr = m_opaque_ptr->GetSibling();
return sb_block;
}
SBBlock SBBlock::GetFirstChild() {
SBBlock sb_block;
if (m_opaque_ptr)
sb_block.m_opaque_ptr = m_opaque_ptr->GetFirstChild();
return sb_block;
}
lldb_private::Block *SBBlock::GetPtr() { return m_opaque_ptr; }
void SBBlock::SetPtr(lldb_private::Block *block) { m_opaque_ptr = block; }
bool SBBlock::GetDescription(SBStream &description) {
Stream &strm = description.ref();
if (m_opaque_ptr) {
lldb::user_id_t id = m_opaque_ptr->GetID();
strm.Printf("Block: {id: %" PRIu64 "} ", id);
if (IsInlined()) {
strm.Printf(" (inlined, '%s') ", GetInlinedName());
}
lldb_private::SymbolContext sc;
m_opaque_ptr->CalculateSymbolContext(&sc);
if (sc.function) {
m_opaque_ptr->DumpAddressRanges(
&strm,
sc.function->GetAddressRange().GetBaseAddress().GetFileAddress());
}
} else
strm.PutCString("No value");
return true;
}
uint32_t SBBlock::GetNumRanges() {
if (m_opaque_ptr)
return m_opaque_ptr->GetNumRanges();
return 0;
}
lldb::SBAddress SBBlock::GetRangeStartAddress(uint32_t idx) {
lldb::SBAddress sb_addr;
if (m_opaque_ptr) {
AddressRange range;
if (m_opaque_ptr->GetRangeAtIndex(idx, range)) {
sb_addr.ref() = range.GetBaseAddress();
}
}
return sb_addr;
}
lldb::SBAddress SBBlock::GetRangeEndAddress(uint32_t idx) {
lldb::SBAddress sb_addr;
if (m_opaque_ptr) {
AddressRange range;
if (m_opaque_ptr->GetRangeAtIndex(idx, range)) {
sb_addr.ref() = range.GetBaseAddress();
sb_addr.ref().Slide(range.GetByteSize());
}
}
return sb_addr;
}
uint32_t SBBlock::GetRangeIndexForBlockAddress(lldb::SBAddress block_addr) {
if (m_opaque_ptr && block_addr.IsValid()) {
return m_opaque_ptr->GetRangeIndexContainingAddress(block_addr.ref());
}
return UINT32_MAX;
}
lldb::SBValueList SBBlock::GetVariables(lldb::SBFrame &frame, bool arguments,
bool locals, bool statics,
lldb::DynamicValueType use_dynamic) {
Block *block = GetPtr();
SBValueList value_list;
if (block) {
StackFrameSP frame_sp(frame.GetFrameSP());
VariableListSP variable_list_sp(block->GetBlockVariableList(true));
if (variable_list_sp) {
const size_t num_variables = variable_list_sp->GetSize();
if (num_variables) {
for (size_t i = 0; i < num_variables; ++i) {
VariableSP variable_sp(variable_list_sp->GetVariableAtIndex(i));
if (variable_sp) {
bool add_variable = false;
switch (variable_sp->GetScope()) {
case eValueTypeVariableGlobal:
case eValueTypeVariableStatic:
case eValueTypeVariableThreadLocal:
add_variable = statics;
break;
case eValueTypeVariableArgument:
add_variable = arguments;
break;
case eValueTypeVariableLocal:
add_variable = locals;
break;
default:
break;
}
if (add_variable) {
if (frame_sp) {
lldb::ValueObjectSP valobj_sp(
frame_sp->GetValueObjectForFrameVariable(variable_sp,
eNoDynamicValues));
SBValue value_sb;
value_sb.SetSP(valobj_sp, use_dynamic);
value_list.Append(value_sb);
}
}
}
}
}
}
}
return value_list;
}
lldb::SBValueList SBBlock::GetVariables(lldb::SBTarget &target, bool arguments,
bool locals, bool statics) {
Block *block = GetPtr();
SBValueList value_list;
if (block) {
TargetSP target_sp(target.GetSP());
VariableListSP variable_list_sp(block->GetBlockVariableList(true));
if (variable_list_sp) {
const size_t num_variables = variable_list_sp->GetSize();
if (num_variables) {
for (size_t i = 0; i < num_variables; ++i) {
VariableSP variable_sp(variable_list_sp->GetVariableAtIndex(i));
if (variable_sp) {
bool add_variable = false;
switch (variable_sp->GetScope()) {
case eValueTypeVariableGlobal:
case eValueTypeVariableStatic:
case eValueTypeVariableThreadLocal:
add_variable = statics;
break;
case eValueTypeVariableArgument:
add_variable = arguments;
break;
case eValueTypeVariableLocal:
add_variable = locals;
break;
default:
break;
}
if (add_variable) {
if (target_sp)
value_list.Append(
ValueObjectVariable::Create(target_sp.get(), variable_sp));
}
}
}
}
}
}
return value_list;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,383 @@
//===-- SBBreakpointLocation.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/API/SBBreakpointLocation.h"
#include "lldb/API/SBAddress.h"
#include "lldb/API/SBDebugger.h"
#include "lldb/API/SBDefines.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBStringList.h"
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/StreamFile.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/ScriptInterpreter.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/ThreadSpec.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include "lldb/lldb-defines.h"
#include "lldb/lldb-types.h"
using namespace lldb;
using namespace lldb_private;
SBBreakpointLocation::SBBreakpointLocation() {}
SBBreakpointLocation::SBBreakpointLocation(
const lldb::BreakpointLocationSP &break_loc_sp)
: m_opaque_wp(break_loc_sp) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log) {
SBStream sstr;
GetDescription(sstr, lldb::eDescriptionLevelBrief);
LLDB_LOG(log, "location = {0} ({1})", break_loc_sp.get(), sstr.GetData());
}
}
SBBreakpointLocation::SBBreakpointLocation(const SBBreakpointLocation &rhs)
: m_opaque_wp(rhs.m_opaque_wp) {}
const SBBreakpointLocation &SBBreakpointLocation::
operator=(const SBBreakpointLocation &rhs) {
m_opaque_wp = rhs.m_opaque_wp;
return *this;
}
SBBreakpointLocation::~SBBreakpointLocation() {}
BreakpointLocationSP SBBreakpointLocation::GetSP() const {
return m_opaque_wp.lock();
}
bool SBBreakpointLocation::IsValid() const { return bool(GetSP()); }
SBAddress SBBreakpointLocation::GetAddress() {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp)
return SBAddress(&loc_sp->GetAddress());
else
return SBAddress();
}
addr_t SBBreakpointLocation::GetLoadAddress() {
addr_t ret_addr = LLDB_INVALID_ADDRESS;
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
ret_addr = loc_sp->GetLoadAddress();
}
return ret_addr;
}
void SBBreakpointLocation::SetEnabled(bool enabled) {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
loc_sp->SetEnabled(enabled);
}
}
bool SBBreakpointLocation::IsEnabled() {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->IsEnabled();
} else
return false;
}
uint32_t SBBreakpointLocation::GetHitCount() {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetHitCount();
} else
return 0;
}
uint32_t SBBreakpointLocation::GetIgnoreCount() {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetIgnoreCount();
} else
return 0;
}
void SBBreakpointLocation::SetIgnoreCount(uint32_t n) {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
loc_sp->SetIgnoreCount(n);
}
}
void SBBreakpointLocation::SetCondition(const char *condition) {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
loc_sp->SetCondition(condition);
}
}
const char *SBBreakpointLocation::GetCondition() {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetConditionText();
}
return NULL;
}
void SBBreakpointLocation::SetAutoContinue(bool auto_continue) {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
loc_sp->SetAutoContinue(auto_continue);
}
}
bool SBBreakpointLocation::GetAutoContinue() {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->IsAutoContinue();
}
return false;
}
void SBBreakpointLocation::SetScriptCallbackFunction(
const char *callback_function_name) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointLocationSP loc_sp = GetSP();
LLDB_LOG(log, "location = {0}, callback = {1}", loc_sp.get(),
callback_function_name);
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
BreakpointOptions *bp_options = loc_sp->GetLocationOptions();
loc_sp->GetBreakpoint()
.GetTarget()
.GetDebugger()
.GetCommandInterpreter()
.GetScriptInterpreter()
->SetBreakpointCommandCallbackFunction(bp_options,
callback_function_name);
}
}
SBError
SBBreakpointLocation::SetScriptCallbackBody(const char *callback_body_text) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointLocationSP loc_sp = GetSP();
LLDB_LOG(log, "location = {0}: callback body:\n{1}", loc_sp.get(),
callback_body_text);
SBError sb_error;
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
BreakpointOptions *bp_options = loc_sp->GetLocationOptions();
Status error =
loc_sp->GetBreakpoint()
.GetTarget()
.GetDebugger()
.GetCommandInterpreter()
.GetScriptInterpreter()
->SetBreakpointCommandCallback(bp_options, callback_body_text);
sb_error.SetError(error);
} else
sb_error.SetErrorString("invalid breakpoint");
return sb_error;
}
void SBBreakpointLocation::SetCommandLineCommands(SBStringList &commands) {
BreakpointLocationSP loc_sp = GetSP();
if (!loc_sp)
return;
if (commands.GetSize() == 0)
return;
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
std::unique_ptr<BreakpointOptions::CommandData> cmd_data_up(
new BreakpointOptions::CommandData(*commands, eScriptLanguageNone));
loc_sp->GetLocationOptions()->SetCommandDataCallback(cmd_data_up);
}
bool SBBreakpointLocation::GetCommandLineCommands(SBStringList &commands) {
BreakpointLocationSP loc_sp = GetSP();
if (!loc_sp)
return false;
StringList command_list;
bool has_commands =
loc_sp->GetLocationOptions()->GetCommandLineCallbacks(command_list);
if (has_commands)
commands.AppendList(command_list);
return has_commands;
}
void SBBreakpointLocation::SetThreadID(tid_t thread_id) {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
loc_sp->SetThreadID(thread_id);
}
}
tid_t SBBreakpointLocation::GetThreadID() {
tid_t tid = LLDB_INVALID_THREAD_ID;
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetThreadID();
}
return tid;
}
void SBBreakpointLocation::SetThreadIndex(uint32_t index) {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
loc_sp->SetThreadIndex(index);
}
}
uint32_t SBBreakpointLocation::GetThreadIndex() const {
uint32_t thread_idx = UINT32_MAX;
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetThreadIndex();
}
return thread_idx;
}
void SBBreakpointLocation::SetThreadName(const char *thread_name) {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
loc_sp->SetThreadName(thread_name);
}
}
const char *SBBreakpointLocation::GetThreadName() const {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetThreadName();
}
return NULL;
}
void SBBreakpointLocation::SetQueueName(const char *queue_name) {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
loc_sp->SetQueueName(queue_name);
}
}
const char *SBBreakpointLocation::GetQueueName() const {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
loc_sp->GetQueueName();
}
return NULL;
}
bool SBBreakpointLocation::IsResolved() {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->IsResolved();
}
return false;
}
void SBBreakpointLocation::SetLocation(
const lldb::BreakpointLocationSP &break_loc_sp) {
// Uninstall the callbacks?
m_opaque_wp = break_loc_sp;
}
bool SBBreakpointLocation::GetDescription(SBStream &description,
DescriptionLevel level) {
Stream &strm = description.ref();
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
loc_sp->GetDescription(&strm, level);
strm.EOL();
} else
strm.PutCString("No value");
return true;
}
break_id_t SBBreakpointLocation::GetID() {
BreakpointLocationSP loc_sp = GetSP();
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetID();
} else
return LLDB_INVALID_BREAK_ID;
}
SBBreakpoint SBBreakpointLocation::GetBreakpoint() {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointLocationSP loc_sp = GetSP();
SBBreakpoint sb_bp;
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
sb_bp = loc_sp->GetBreakpoint().shared_from_this();
}
if (log) {
SBStream sstr;
sb_bp.GetDescription(sstr);
LLDB_LOG(log, "location = {0}, breakpoint = {1} ({2})", loc_sp.get(),
sb_bp.GetSP().get(), sstr.GetData());
}
return sb_bp;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,85 @@
//===-- SBBreakpointName.cpp ----------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/API/SBBreakpointName.h"
#include "lldb/API/SBBreakpointLocation.h"
#include "lldb/API/SBDebugger.h"
#include "lldb/API/SBEvent.h"
#include "lldb/API/SBProcess.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBStringList.h"
#include "lldb/API/SBThread.h"
#include "lldb/Breakpoint/BreakpointName.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/StreamFile.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/ScriptInterpreter.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadSpec.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include "lldb/lldb-enumerations.h"
#include "SBBreakpointOptionCommon.h"
#include "llvm/ADT/STLExtras.h"
using namespace lldb;
using namespace lldb_private;
SBBreakpointCallbackBaton::SBBreakpointCallbackBaton(SBBreakpointHitCallback
callback,
void *baton)
: TypedBaton(llvm::make_unique<CallbackData>()) {
getItem()->callback = callback;
getItem()->callback_baton = baton;
}
bool SBBreakpointCallbackBaton::PrivateBreakpointHitCallback(void *baton,
StoppointCallbackContext *ctx,
lldb::user_id_t break_id,
lldb::user_id_t break_loc_id)
{
ExecutionContext exe_ctx(ctx->exe_ctx_ref);
BreakpointSP bp_sp(
exe_ctx.GetTargetRef().GetBreakpointList().FindBreakpointByID(break_id));
if (baton && bp_sp) {
CallbackData *data = (CallbackData *)baton;
lldb_private::Breakpoint *bp = bp_sp.get();
if (bp && data->callback) {
Process *process = exe_ctx.GetProcessPtr();
if (process) {
SBProcess sb_process(process->shared_from_this());
SBThread sb_thread;
SBBreakpointLocation sb_location;
assert(bp_sp);
sb_location.SetLocation(bp_sp->FindLocationByID(break_loc_id));
Thread *thread = exe_ctx.GetThreadPtr();
if (thread)
sb_thread.SetThread(thread->shared_from_this());
return data->callback(data->callback_baton, sb_process, sb_thread,
sb_location);
}
}
}
return true; // Return true if we should stop at this breakpoint
}
SBBreakpointCallbackBaton::~SBBreakpointCallbackBaton() = default;

View File

@ -0,0 +1,37 @@
//===-- SBBreakpointOptionCommon.h ------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_SBBreakpointOptionCommons_h_
#define LLDB_SBBreakpointOptionCommons_h_
#include "lldb/API/SBDefines.h"
#include "lldb/Utility/Baton.h"
namespace lldb
{
struct CallbackData {
SBBreakpointHitCallback callback;
void *callback_baton;
};
class SBBreakpointCallbackBaton : public lldb_private::TypedBaton<CallbackData> {
public:
SBBreakpointCallbackBaton(SBBreakpointHitCallback callback,
void *baton);
~SBBreakpointCallbackBaton();
static bool PrivateBreakpointHitCallback(void *baton,
lldb_private::StoppointCallbackContext *ctx,
lldb::user_id_t break_id,
lldb::user_id_t break_loc_id);
};
} // namespace lldb
#endif // LLDB_SBBreakpointOptionCommons_h_

View File

@ -0,0 +1,151 @@
//===-- SBBroadcaster.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/Core/Broadcaster.h"
#include "lldb/Utility/Log.h"
#include "lldb/API/SBBroadcaster.h"
#include "lldb/API/SBEvent.h"
#include "lldb/API/SBListener.h"
using namespace lldb;
using namespace lldb_private;
SBBroadcaster::SBBroadcaster() : m_opaque_sp(), m_opaque_ptr(NULL) {}
SBBroadcaster::SBBroadcaster(const char *name)
: m_opaque_sp(new Broadcaster(NULL, name)), m_opaque_ptr(NULL) {
m_opaque_ptr = m_opaque_sp.get();
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
LLDB_LOGV(log, "(name=\"{0}\") => SBBroadcaster({1})", name, m_opaque_ptr);
}
SBBroadcaster::SBBroadcaster(lldb_private::Broadcaster *broadcaster, bool owns)
: m_opaque_sp(owns ? broadcaster : NULL), m_opaque_ptr(broadcaster) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
LLDB_LOGV(log, "(broadcaster={0}, owns={1}) => SBBroadcaster({2})",
broadcaster, owns, m_opaque_ptr);
}
SBBroadcaster::SBBroadcaster(const SBBroadcaster &rhs)
: m_opaque_sp(rhs.m_opaque_sp), m_opaque_ptr(rhs.m_opaque_ptr) {}
const SBBroadcaster &SBBroadcaster::operator=(const SBBroadcaster &rhs) {
if (this != &rhs) {
m_opaque_sp = rhs.m_opaque_sp;
m_opaque_ptr = rhs.m_opaque_ptr;
}
return *this;
}
SBBroadcaster::~SBBroadcaster() { reset(NULL, false); }
void SBBroadcaster::BroadcastEventByType(uint32_t event_type, bool unique) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log)
log->Printf("SBBroadcaster(%p)::BroadcastEventByType (event_type=0x%8.8x, "
"unique=%i)",
static_cast<void *>(m_opaque_ptr), event_type, unique);
if (m_opaque_ptr == NULL)
return;
if (unique)
m_opaque_ptr->BroadcastEventIfUnique(event_type);
else
m_opaque_ptr->BroadcastEvent(event_type);
}
void SBBroadcaster::BroadcastEvent(const SBEvent &event, bool unique) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log)
log->Printf(
"SBBroadcaster(%p)::BroadcastEventByType (SBEvent(%p), unique=%i)",
static_cast<void *>(m_opaque_ptr), static_cast<void *>(event.get()),
unique);
if (m_opaque_ptr == NULL)
return;
EventSP event_sp = event.GetSP();
if (unique)
m_opaque_ptr->BroadcastEventIfUnique(event_sp);
else
m_opaque_ptr->BroadcastEvent(event_sp);
}
void SBBroadcaster::AddInitialEventsToListener(const SBListener &listener,
uint32_t requested_events) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log)
log->Printf("SBBroadcaster(%p)::AddInitialEventsToListener "
"(SBListener(%p), event_mask=0x%8.8x)",
static_cast<void *>(m_opaque_ptr),
static_cast<void *>(listener.get()), requested_events);
if (m_opaque_ptr)
m_opaque_ptr->AddInitialEventsToListener(listener.m_opaque_sp,
requested_events);
}
uint32_t SBBroadcaster::AddListener(const SBListener &listener,
uint32_t event_mask) {
if (m_opaque_ptr)
return m_opaque_ptr->AddListener(listener.m_opaque_sp, event_mask);
return 0;
}
const char *SBBroadcaster::GetName() const {
if (m_opaque_ptr)
return m_opaque_ptr->GetBroadcasterName().GetCString();
return NULL;
}
bool SBBroadcaster::EventTypeHasListeners(uint32_t event_type) {
if (m_opaque_ptr)
return m_opaque_ptr->EventTypeHasListeners(event_type);
return false;
}
bool SBBroadcaster::RemoveListener(const SBListener &listener,
uint32_t event_mask) {
if (m_opaque_ptr)
return m_opaque_ptr->RemoveListener(listener.m_opaque_sp, event_mask);
return false;
}
Broadcaster *SBBroadcaster::get() const { return m_opaque_ptr; }
void SBBroadcaster::reset(Broadcaster *broadcaster, bool owns) {
if (owns)
m_opaque_sp.reset(broadcaster);
else
m_opaque_sp.reset();
m_opaque_ptr = broadcaster;
}
bool SBBroadcaster::IsValid() const { return m_opaque_ptr != NULL; }
void SBBroadcaster::Clear() {
m_opaque_sp.reset();
m_opaque_ptr = NULL;
}
bool SBBroadcaster::operator==(const SBBroadcaster &rhs) const {
return m_opaque_ptr == rhs.m_opaque_ptr;
}
bool SBBroadcaster::operator!=(const SBBroadcaster &rhs) const {
return m_opaque_ptr != rhs.m_opaque_ptr;
}
bool SBBroadcaster::operator<(const SBBroadcaster &rhs) const {
return m_opaque_ptr < rhs.m_opaque_ptr;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,281 @@
//===-- SBCommandReturnObject.cpp -------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/API/SBCommandReturnObject.h"
#include "lldb/API/SBError.h"
#include "lldb/API/SBStream.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Status.h"
using namespace lldb;
using namespace lldb_private;
SBCommandReturnObject::SBCommandReturnObject()
: m_opaque_ap(new CommandReturnObject()) {}
SBCommandReturnObject::SBCommandReturnObject(const SBCommandReturnObject &rhs)
: m_opaque_ap() {
if (rhs.m_opaque_ap)
m_opaque_ap.reset(new CommandReturnObject(*rhs.m_opaque_ap));
}
SBCommandReturnObject::SBCommandReturnObject(CommandReturnObject *ptr)
: m_opaque_ap(ptr) {}
SBCommandReturnObject::~SBCommandReturnObject() = default;
CommandReturnObject *SBCommandReturnObject::Release() {
return m_opaque_ap.release();
}
const SBCommandReturnObject &SBCommandReturnObject::
operator=(const SBCommandReturnObject &rhs) {
if (this != &rhs) {
if (rhs.m_opaque_ap)
m_opaque_ap.reset(new CommandReturnObject(*rhs.m_opaque_ap));
else
m_opaque_ap.reset();
}
return *this;
}
bool SBCommandReturnObject::IsValid() const {
return m_opaque_ap.get() != nullptr;
}
const char *SBCommandReturnObject::GetOutput() {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (m_opaque_ap) {
llvm::StringRef output = m_opaque_ap->GetOutputData();
ConstString result(output.empty() ? llvm::StringRef("") : output);
if (log)
log->Printf("SBCommandReturnObject(%p)::GetOutput () => \"%s\"",
static_cast<void *>(m_opaque_ap.get()), result.AsCString());
return result.AsCString();
}
if (log)
log->Printf("SBCommandReturnObject(%p)::GetOutput () => nullptr",
static_cast<void *>(m_opaque_ap.get()));
return nullptr;
}
const char *SBCommandReturnObject::GetError() {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (m_opaque_ap) {
llvm::StringRef output = m_opaque_ap->GetErrorData();
ConstString result(output.empty() ? llvm::StringRef("") : output);
if (log)
log->Printf("SBCommandReturnObject(%p)::GetError () => \"%s\"",
static_cast<void *>(m_opaque_ap.get()), result.AsCString());
return result.AsCString();
}
if (log)
log->Printf("SBCommandReturnObject(%p)::GetError () => nullptr",
static_cast<void *>(m_opaque_ap.get()));
return nullptr;
}
size_t SBCommandReturnObject::GetOutputSize() {
return (m_opaque_ap ? m_opaque_ap->GetOutputData().size() : 0);
}
size_t SBCommandReturnObject::GetErrorSize() {
return (m_opaque_ap ? m_opaque_ap->GetErrorData().size() : 0);
}
size_t SBCommandReturnObject::PutOutput(FILE *fh) {
if (fh) {
size_t num_bytes = GetOutputSize();
if (num_bytes)
return ::fprintf(fh, "%s", GetOutput());
}
return 0;
}
size_t SBCommandReturnObject::PutError(FILE *fh) {
if (fh) {
size_t num_bytes = GetErrorSize();
if (num_bytes)
return ::fprintf(fh, "%s", GetError());
}
return 0;
}
void SBCommandReturnObject::Clear() {
if (m_opaque_ap)
m_opaque_ap->Clear();
}
lldb::ReturnStatus SBCommandReturnObject::GetStatus() {
return (m_opaque_ap ? m_opaque_ap->GetStatus() : lldb::eReturnStatusInvalid);
}
void SBCommandReturnObject::SetStatus(lldb::ReturnStatus status) {
if (m_opaque_ap)
m_opaque_ap->SetStatus(status);
}
bool SBCommandReturnObject::Succeeded() {
return (m_opaque_ap ? m_opaque_ap->Succeeded() : false);
}
bool SBCommandReturnObject::HasResult() {
return (m_opaque_ap ? m_opaque_ap->HasResult() : false);
}
void SBCommandReturnObject::AppendMessage(const char *message) {
if (m_opaque_ap)
m_opaque_ap->AppendMessage(message);
}
void SBCommandReturnObject::AppendWarning(const char *message) {
if (m_opaque_ap)
m_opaque_ap->AppendWarning(message);
}
CommandReturnObject *SBCommandReturnObject::operator->() const {
return m_opaque_ap.get();
}
CommandReturnObject *SBCommandReturnObject::get() const {
return m_opaque_ap.get();
}
CommandReturnObject &SBCommandReturnObject::operator*() const {
assert(m_opaque_ap.get());
return *(m_opaque_ap.get());
}
CommandReturnObject &SBCommandReturnObject::ref() const {
assert(m_opaque_ap.get());
return *(m_opaque_ap.get());
}
void SBCommandReturnObject::SetLLDBObjectPtr(CommandReturnObject *ptr) {
if (m_opaque_ap)
m_opaque_ap.reset(ptr);
}
bool SBCommandReturnObject::GetDescription(SBStream &description) {
Stream &strm = description.ref();
if (m_opaque_ap) {
description.Printf("Error: ");
lldb::ReturnStatus status = m_opaque_ap->GetStatus();
if (status == lldb::eReturnStatusStarted)
strm.PutCString("Started");
else if (status == lldb::eReturnStatusInvalid)
strm.PutCString("Invalid");
else if (m_opaque_ap->Succeeded())
strm.PutCString("Success");
else
strm.PutCString("Fail");
if (GetOutputSize() > 0)
strm.Printf("\nOutput Message:\n%s", GetOutput());
if (GetErrorSize() > 0)
strm.Printf("\nError Message:\n%s", GetError());
} else
strm.PutCString("No value");
return true;
}
void SBCommandReturnObject::SetImmediateOutputFile(FILE *fh) {
SetImmediateOutputFile(fh, false);
}
void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh) {
SetImmediateErrorFile(fh, false);
}
void SBCommandReturnObject::SetImmediateOutputFile(FILE *fh,
bool transfer_ownership) {
if (m_opaque_ap)
m_opaque_ap->SetImmediateOutputFile(fh, transfer_ownership);
}
void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh,
bool transfer_ownership) {
if (m_opaque_ap)
m_opaque_ap->SetImmediateErrorFile(fh, transfer_ownership);
}
void SBCommandReturnObject::PutCString(const char *string, int len) {
if (m_opaque_ap) {
if (len == 0 || string == nullptr || *string == 0) {
return;
} else if (len > 0) {
std::string buffer(string, len);
m_opaque_ap->AppendMessage(buffer.c_str());
} else
m_opaque_ap->AppendMessage(string);
}
}
const char *SBCommandReturnObject::GetOutput(bool only_if_no_immediate) {
if (!m_opaque_ap)
return nullptr;
if (!only_if_no_immediate ||
m_opaque_ap->GetImmediateOutputStream().get() == nullptr)
return GetOutput();
return nullptr;
}
const char *SBCommandReturnObject::GetError(bool only_if_no_immediate) {
if (!m_opaque_ap)
return nullptr;
if (!only_if_no_immediate ||
m_opaque_ap->GetImmediateErrorStream().get() == nullptr)
return GetError();
return nullptr;
}
size_t SBCommandReturnObject::Printf(const char *format, ...) {
if (m_opaque_ap) {
va_list args;
va_start(args, format);
size_t result = m_opaque_ap->GetOutputStream().PrintfVarArg(format, args);
va_end(args);
return result;
}
return 0;
}
void SBCommandReturnObject::SetError(lldb::SBError &error,
const char *fallback_error_cstr) {
if (m_opaque_ap) {
if (error.IsValid())
m_opaque_ap->SetError(error.ref(), fallback_error_cstr);
else if (fallback_error_cstr)
m_opaque_ap->SetError(Status(), fallback_error_cstr);
}
}
void SBCommandReturnObject::SetError(const char *error_cstr) {
if (m_opaque_ap && error_cstr)
m_opaque_ap->SetError(error_cstr);
}

View File

@ -0,0 +1,255 @@
//===-- SBCommunication.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/API/SBCommunication.h"
#include "lldb/API/SBBroadcaster.h"
#include "lldb/Core/Communication.h"
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/Host.h"
#include "lldb/Utility/Log.h"
using namespace lldb;
using namespace lldb_private;
SBCommunication::SBCommunication() : m_opaque(NULL), m_opaque_owned(false) {}
SBCommunication::SBCommunication(const char *broadcaster_name)
: m_opaque(new Communication(broadcaster_name)), m_opaque_owned(true) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log)
log->Printf("SBCommunication::SBCommunication (broadcaster_name=\"%s\") => "
"SBCommunication(%p)",
broadcaster_name, static_cast<void *>(m_opaque));
}
SBCommunication::~SBCommunication() {
if (m_opaque && m_opaque_owned)
delete m_opaque;
m_opaque = NULL;
m_opaque_owned = false;
}
bool SBCommunication::IsValid() const { return m_opaque != NULL; }
bool SBCommunication::GetCloseOnEOF() {
if (m_opaque)
return m_opaque->GetCloseOnEOF();
return false;
}
void SBCommunication::SetCloseOnEOF(bool b) {
if (m_opaque)
m_opaque->SetCloseOnEOF(b);
}
ConnectionStatus SBCommunication::Connect(const char *url) {
if (m_opaque) {
if (!m_opaque->HasConnection())
m_opaque->SetConnection(Host::CreateDefaultConnection(url).release());
return m_opaque->Connect(url, NULL);
}
return eConnectionStatusNoConnection;
}
ConnectionStatus SBCommunication::AdoptFileDesriptor(int fd, bool owns_fd) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ConnectionStatus status = eConnectionStatusNoConnection;
if (m_opaque) {
if (m_opaque->HasConnection()) {
if (m_opaque->IsConnected())
m_opaque->Disconnect();
}
m_opaque->SetConnection(new ConnectionFileDescriptor(fd, owns_fd));
if (m_opaque->IsConnected())
status = eConnectionStatusSuccess;
else
status = eConnectionStatusLostConnection;
}
if (log)
log->Printf(
"SBCommunication(%p)::AdoptFileDescriptor (fd=%d, ownd_fd=%i) => %s",
static_cast<void *>(m_opaque), fd, owns_fd,
Communication::ConnectionStatusAsCString(status));
return status;
}
ConnectionStatus SBCommunication::Disconnect() {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ConnectionStatus status = eConnectionStatusNoConnection;
if (m_opaque)
status = m_opaque->Disconnect();
if (log)
log->Printf("SBCommunication(%p)::Disconnect () => %s",
static_cast<void *>(m_opaque),
Communication::ConnectionStatusAsCString(status));
return status;
}
bool SBCommunication::IsConnected() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool result = false;
if (m_opaque)
result = m_opaque->IsConnected();
if (log)
log->Printf("SBCommunication(%p)::IsConnected () => %i",
static_cast<void *>(m_opaque), result);
return false;
}
size_t SBCommunication::Read(void *dst, size_t dst_len, uint32_t timeout_usec,
ConnectionStatus &status) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log)
log->Printf("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64
", timeout_usec=%u, &status)...",
static_cast<void *>(m_opaque), static_cast<void *>(dst),
static_cast<uint64_t>(dst_len), timeout_usec);
size_t bytes_read = 0;
Timeout<std::micro> timeout = timeout_usec == UINT32_MAX
? Timeout<std::micro>(llvm::None)
: std::chrono::microseconds(timeout_usec);
if (m_opaque)
bytes_read = m_opaque->Read(dst, dst_len, timeout, status, NULL);
else
status = eConnectionStatusNoConnection;
if (log)
log->Printf("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64
", timeout_usec=%u, &status=%s) => %" PRIu64,
static_cast<void *>(m_opaque), static_cast<void *>(dst),
static_cast<uint64_t>(dst_len), timeout_usec,
Communication::ConnectionStatusAsCString(status),
static_cast<uint64_t>(bytes_read));
return bytes_read;
}
size_t SBCommunication::Write(const void *src, size_t src_len,
ConnectionStatus &status) {
size_t bytes_written = 0;
if (m_opaque)
bytes_written = m_opaque->Write(src, src_len, status, NULL);
else
status = eConnectionStatusNoConnection;
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log)
log->Printf("SBCommunication(%p)::Write (src=%p, src_len=%" PRIu64
", &status=%s) => %" PRIu64,
static_cast<void *>(m_opaque), static_cast<const void *>(src),
static_cast<uint64_t>(src_len),
Communication::ConnectionStatusAsCString(status),
static_cast<uint64_t>(bytes_written));
return 0;
}
bool SBCommunication::ReadThreadStart() {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool success = false;
if (m_opaque)
success = m_opaque->StartReadThread();
if (log)
log->Printf("SBCommunication(%p)::ReadThreadStart () => %i",
static_cast<void *>(m_opaque), success);
return success;
}
bool SBCommunication::ReadThreadStop() {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log)
log->Printf("SBCommunication(%p)::ReadThreadStop ()...",
static_cast<void *>(m_opaque));
bool success = false;
if (m_opaque)
success = m_opaque->StopReadThread();
if (log)
log->Printf("SBCommunication(%p)::ReadThreadStop () => %i",
static_cast<void *>(m_opaque), success);
return success;
}
bool SBCommunication::ReadThreadIsRunning() {
bool result = false;
if (m_opaque)
result = m_opaque->ReadThreadIsRunning();
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log)
log->Printf("SBCommunication(%p)::ReadThreadIsRunning () => %i",
static_cast<void *>(m_opaque), result);
return result;
}
bool SBCommunication::SetReadThreadBytesReceivedCallback(
ReadThreadBytesReceived callback, void *callback_baton) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool result = false;
if (m_opaque) {
m_opaque->SetReadThreadBytesReceivedCallback(callback, callback_baton);
result = true;
}
if (log)
log->Printf("SBCommunication(%p)::SetReadThreadBytesReceivedCallback "
"(callback=%p, baton=%p) => %i",
static_cast<void *>(m_opaque),
reinterpret_cast<void *>(reinterpret_cast<intptr_t>(callback)),
static_cast<void *>(callback_baton), result);
return result;
}
SBBroadcaster SBCommunication::GetBroadcaster() {
SBBroadcaster broadcaster(m_opaque, false);
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log)
log->Printf("SBCommunication(%p)::GetBroadcaster () => SBBroadcaster (%p)",
static_cast<void *>(m_opaque),
static_cast<void *>(broadcaster.get()));
return broadcaster;
}
const char *SBCommunication::GetBroadcasterClass() {
return Communication::GetStaticBroadcasterClass().AsCString();
}
//
// void
// SBCommunication::CreateIfNeeded ()
//{
// if (m_opaque == NULL)
// {
// static uint32_t g_broadcaster_num;
// char broadcaster_name[256];
// ::snprintf (name, broadcaster_name, "%p SBCommunication", this);
// m_opaque = new Communication (broadcaster_name);
// m_opaque_owned = true;
// }
// assert (m_opaque);
//}
//
//

View File

@ -0,0 +1,223 @@
//===-- SBCompileUnit.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/API/SBCompileUnit.h"
#include "lldb/API/SBLineEntry.h"
#include "lldb/API/SBStream.h"
#include "lldb/Core/Module.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/LineEntry.h"
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/Type.h"
#include "lldb/Utility/Log.h"
using namespace lldb;
using namespace lldb_private;
SBCompileUnit::SBCompileUnit() : m_opaque_ptr(NULL) {}
SBCompileUnit::SBCompileUnit(lldb_private::CompileUnit *lldb_object_ptr)
: m_opaque_ptr(lldb_object_ptr) {}
SBCompileUnit::SBCompileUnit(const SBCompileUnit &rhs)
: m_opaque_ptr(rhs.m_opaque_ptr) {}
const SBCompileUnit &SBCompileUnit::operator=(const SBCompileUnit &rhs) {
m_opaque_ptr = rhs.m_opaque_ptr;
return *this;
}
SBCompileUnit::~SBCompileUnit() { m_opaque_ptr = NULL; }
SBFileSpec SBCompileUnit::GetFileSpec() const {
SBFileSpec file_spec;
if (m_opaque_ptr)
file_spec.SetFileSpec(*m_opaque_ptr);
return file_spec;
}
uint32_t SBCompileUnit::GetNumLineEntries() const {
if (m_opaque_ptr) {
LineTable *line_table = m_opaque_ptr->GetLineTable();
if (line_table)
return line_table->GetSize();
}
return 0;
}
SBLineEntry SBCompileUnit::GetLineEntryAtIndex(uint32_t idx) const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBLineEntry sb_line_entry;
if (m_opaque_ptr) {
LineTable *line_table = m_opaque_ptr->GetLineTable();
if (line_table) {
LineEntry line_entry;
if (line_table->GetLineEntryAtIndex(idx, line_entry))
sb_line_entry.SetLineEntry(line_entry);
}
}
if (log) {
SBStream sstr;
sb_line_entry.GetDescription(sstr);
log->Printf("SBCompileUnit(%p)::GetLineEntryAtIndex (idx=%u) => "
"SBLineEntry(%p): '%s'",
static_cast<void *>(m_opaque_ptr), idx,
static_cast<void *>(sb_line_entry.get()), sstr.GetData());
}
return sb_line_entry;
}
uint32_t SBCompileUnit::FindLineEntryIndex(uint32_t start_idx, uint32_t line,
SBFileSpec *inline_file_spec) const {
const bool exact = true;
return FindLineEntryIndex(start_idx, line, inline_file_spec, exact);
}
uint32_t SBCompileUnit::FindLineEntryIndex(uint32_t start_idx, uint32_t line,
SBFileSpec *inline_file_spec,
bool exact) const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint32_t index = UINT32_MAX;
if (m_opaque_ptr) {
FileSpec file_spec;
if (inline_file_spec && inline_file_spec->IsValid())
file_spec = inline_file_spec->ref();
else
file_spec = *m_opaque_ptr;
index = m_opaque_ptr->FindLineEntry(
start_idx, line, inline_file_spec ? inline_file_spec->get() : NULL,
exact, NULL);
}
if (log) {
SBStream sstr;
if (index == UINT32_MAX) {
log->Printf("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, "
"line=%u, SBFileSpec(%p)) => NOT FOUND",
static_cast<void *>(m_opaque_ptr), start_idx, line,
inline_file_spec
? static_cast<const void *>(inline_file_spec->get())
: NULL);
} else {
log->Printf("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, "
"line=%u, SBFileSpec(%p)) => %u",
static_cast<void *>(m_opaque_ptr), start_idx, line,
inline_file_spec
? static_cast<const void *>(inline_file_spec->get())
: NULL,
index);
}
}
return index;
}
uint32_t SBCompileUnit::GetNumSupportFiles() const {
if (m_opaque_ptr) {
FileSpecList &support_files = m_opaque_ptr->GetSupportFiles();
return support_files.GetSize();
}
return 0;
}
lldb::SBTypeList SBCompileUnit::GetTypes(uint32_t type_mask) {
SBTypeList sb_type_list;
if (m_opaque_ptr) {
ModuleSP module_sp(m_opaque_ptr->GetModule());
if (module_sp) {
SymbolVendor *vendor = module_sp->GetSymbolVendor();
if (vendor) {
TypeList type_list;
vendor->GetTypes(m_opaque_ptr, type_mask, type_list);
sb_type_list.m_opaque_ap->Append(type_list);
}
}
}
return sb_type_list;
}
SBFileSpec SBCompileUnit::GetSupportFileAtIndex(uint32_t idx) const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBFileSpec sb_file_spec;
if (m_opaque_ptr) {
FileSpecList &support_files = m_opaque_ptr->GetSupportFiles();
FileSpec file_spec = support_files.GetFileSpecAtIndex(idx);
sb_file_spec.SetFileSpec(file_spec);
}
if (log) {
SBStream sstr;
sb_file_spec.GetDescription(sstr);
log->Printf("SBCompileUnit(%p)::GetGetFileSpecAtIndex (idx=%u) => "
"SBFileSpec(%p): '%s'",
static_cast<void *>(m_opaque_ptr), idx,
static_cast<const void *>(sb_file_spec.get()), sstr.GetData());
}
return sb_file_spec;
}
uint32_t SBCompileUnit::FindSupportFileIndex(uint32_t start_idx,
const SBFileSpec &sb_file,
bool full) {
if (m_opaque_ptr) {
FileSpecList &support_files = m_opaque_ptr->GetSupportFiles();
return support_files.FindFileIndex(start_idx, sb_file.ref(), full);
}
return 0;
}
lldb::LanguageType SBCompileUnit::GetLanguage() {
if (m_opaque_ptr)
return m_opaque_ptr->GetLanguage();
return lldb::eLanguageTypeUnknown;
}
bool SBCompileUnit::IsValid() const { return m_opaque_ptr != NULL; }
bool SBCompileUnit::operator==(const SBCompileUnit &rhs) const {
return m_opaque_ptr == rhs.m_opaque_ptr;
}
bool SBCompileUnit::operator!=(const SBCompileUnit &rhs) const {
return m_opaque_ptr != rhs.m_opaque_ptr;
}
const lldb_private::CompileUnit *SBCompileUnit::operator->() const {
return m_opaque_ptr;
}
const lldb_private::CompileUnit &SBCompileUnit::operator*() const {
return *m_opaque_ptr;
}
lldb_private::CompileUnit *SBCompileUnit::get() { return m_opaque_ptr; }
void SBCompileUnit::reset(lldb_private::CompileUnit *lldb_object_ptr) {
m_opaque_ptr = lldb_object_ptr;
}
bool SBCompileUnit::GetDescription(SBStream &description) {
Stream &strm = description.ref();
if (m_opaque_ptr) {
m_opaque_ptr->Dump(&strm, false);
} else
strm.PutCString("No value");
return true;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,153 @@
//===-- SBDeclaration.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/API/SBDeclaration.h"
#include "lldb/API/SBStream.h"
#include "lldb/Host/PosixApi.h"
#include "lldb/Symbol/Declaration.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include <limits.h>
using namespace lldb;
using namespace lldb_private;
SBDeclaration::SBDeclaration() : m_opaque_ap() {}
SBDeclaration::SBDeclaration(const SBDeclaration &rhs) : m_opaque_ap() {
if (rhs.IsValid())
ref() = rhs.ref();
}
SBDeclaration::SBDeclaration(const lldb_private::Declaration *lldb_object_ptr)
: m_opaque_ap() {
if (lldb_object_ptr)
ref() = *lldb_object_ptr;
}
const SBDeclaration &SBDeclaration::operator=(const SBDeclaration &rhs) {
if (this != &rhs) {
if (rhs.IsValid())
ref() = rhs.ref();
else
m_opaque_ap.reset();
}
return *this;
}
void SBDeclaration::SetDeclaration(
const lldb_private::Declaration &lldb_object_ref) {
ref() = lldb_object_ref;
}
SBDeclaration::~SBDeclaration() {}
bool SBDeclaration::IsValid() const {
return m_opaque_ap.get() && m_opaque_ap->IsValid();
}
SBFileSpec SBDeclaration::GetFileSpec() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBFileSpec sb_file_spec;
if (m_opaque_ap.get() && m_opaque_ap->GetFile())
sb_file_spec.SetFileSpec(m_opaque_ap->GetFile());
if (log) {
SBStream sstr;
sb_file_spec.GetDescription(sstr);
log->Printf("SBLineEntry(%p)::GetFileSpec () => SBFileSpec(%p): %s",
static_cast<void *>(m_opaque_ap.get()),
static_cast<const void *>(sb_file_spec.get()), sstr.GetData());
}
return sb_file_spec;
}
uint32_t SBDeclaration::GetLine() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint32_t line = 0;
if (m_opaque_ap.get())
line = m_opaque_ap->GetLine();
if (log)
log->Printf("SBLineEntry(%p)::GetLine () => %u",
static_cast<void *>(m_opaque_ap.get()), line);
return line;
}
uint32_t SBDeclaration::GetColumn() const {
if (m_opaque_ap.get())
return m_opaque_ap->GetColumn();
return 0;
}
void SBDeclaration::SetFileSpec(lldb::SBFileSpec filespec) {
if (filespec.IsValid())
ref().SetFile(filespec.ref());
else
ref().SetFile(FileSpec());
}
void SBDeclaration::SetLine(uint32_t line) { ref().SetLine(line); }
void SBDeclaration::SetColumn(uint32_t column) { ref().SetColumn(column); }
bool SBDeclaration::operator==(const SBDeclaration &rhs) const {
lldb_private::Declaration *lhs_ptr = m_opaque_ap.get();
lldb_private::Declaration *rhs_ptr = rhs.m_opaque_ap.get();
if (lhs_ptr && rhs_ptr)
return lldb_private::Declaration::Compare(*lhs_ptr, *rhs_ptr) == 0;
return lhs_ptr == rhs_ptr;
}
bool SBDeclaration::operator!=(const SBDeclaration &rhs) const {
lldb_private::Declaration *lhs_ptr = m_opaque_ap.get();
lldb_private::Declaration *rhs_ptr = rhs.m_opaque_ap.get();
if (lhs_ptr && rhs_ptr)
return lldb_private::Declaration::Compare(*lhs_ptr, *rhs_ptr) != 0;
return lhs_ptr != rhs_ptr;
}
const lldb_private::Declaration *SBDeclaration::operator->() const {
return m_opaque_ap.get();
}
lldb_private::Declaration &SBDeclaration::ref() {
if (m_opaque_ap.get() == NULL)
m_opaque_ap.reset(new lldb_private::Declaration());
return *m_opaque_ap;
}
const lldb_private::Declaration &SBDeclaration::ref() const {
return *m_opaque_ap;
}
bool SBDeclaration::GetDescription(SBStream &description) {
Stream &strm = description.ref();
if (m_opaque_ap.get()) {
char file_path[PATH_MAX * 2];
m_opaque_ap->GetFile().GetPath(file_path, sizeof(file_path));
strm.Printf("%s:%u", file_path, GetLine());
if (GetColumn() > 0)
strm.Printf(":%u", GetColumn());
} else
strm.PutCString("No value");
return true;
}
lldb_private::Declaration *SBDeclaration::get() { return m_opaque_ap.get(); }

View File

@ -0,0 +1,173 @@
//===-- SBError.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/API/SBError.h"
#include "lldb/API/SBStream.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Status.h"
#include <stdarg.h>
using namespace lldb;
using namespace lldb_private;
SBError::SBError() : m_opaque_ap() {}
SBError::SBError(const SBError &rhs) : m_opaque_ap() {
if (rhs.IsValid())
m_opaque_ap.reset(new Status(*rhs));
}
SBError::~SBError() {}
const SBError &SBError::operator=(const SBError &rhs) {
if (rhs.IsValid()) {
if (m_opaque_ap.get())
*m_opaque_ap = *rhs;
else
m_opaque_ap.reset(new Status(*rhs));
} else
m_opaque_ap.reset();
return *this;
}
const char *SBError::GetCString() const {
if (m_opaque_ap.get())
return m_opaque_ap->AsCString();
return NULL;
}
void SBError::Clear() {
if (m_opaque_ap.get())
m_opaque_ap->Clear();
}
bool SBError::Fail() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool ret_value = false;
if (m_opaque_ap.get())
ret_value = m_opaque_ap->Fail();
if (log)
log->Printf("SBError(%p)::Fail () => %i",
static_cast<void *>(m_opaque_ap.get()), ret_value);
return ret_value;
}
bool SBError::Success() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool ret_value = true;
if (m_opaque_ap.get())
ret_value = m_opaque_ap->Success();
if (log)
log->Printf("SBError(%p)::Success () => %i",
static_cast<void *>(m_opaque_ap.get()), ret_value);
return ret_value;
}
uint32_t SBError::GetError() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint32_t err = 0;
if (m_opaque_ap.get())
err = m_opaque_ap->GetError();
if (log)
log->Printf("SBError(%p)::GetError () => 0x%8.8x",
static_cast<void *>(m_opaque_ap.get()), err);
return err;
}
ErrorType SBError::GetType() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ErrorType err_type = eErrorTypeInvalid;
if (m_opaque_ap.get())
err_type = m_opaque_ap->GetType();
if (log)
log->Printf("SBError(%p)::GetType () => %i",
static_cast<void *>(m_opaque_ap.get()), err_type);
return err_type;
}
void SBError::SetError(uint32_t err, ErrorType type) {
CreateIfNeeded();
m_opaque_ap->SetError(err, type);
}
void SBError::SetError(const Status &lldb_error) {
CreateIfNeeded();
*m_opaque_ap = lldb_error;
}
void SBError::SetErrorToErrno() {
CreateIfNeeded();
m_opaque_ap->SetErrorToErrno();
}
void SBError::SetErrorToGenericError() {
CreateIfNeeded();
m_opaque_ap->SetErrorToErrno();
}
void SBError::SetErrorString(const char *err_str) {
CreateIfNeeded();
m_opaque_ap->SetErrorString(err_str);
}
int SBError::SetErrorStringWithFormat(const char *format, ...) {
CreateIfNeeded();
va_list args;
va_start(args, format);
int num_chars = m_opaque_ap->SetErrorStringWithVarArg(format, args);
va_end(args);
return num_chars;
}
bool SBError::IsValid() const { return m_opaque_ap.get() != NULL; }
void SBError::CreateIfNeeded() {
if (m_opaque_ap.get() == NULL)
m_opaque_ap.reset(new Status());
}
lldb_private::Status *SBError::operator->() { return m_opaque_ap.get(); }
lldb_private::Status *SBError::get() { return m_opaque_ap.get(); }
lldb_private::Status &SBError::ref() {
CreateIfNeeded();
return *m_opaque_ap;
}
const lldb_private::Status &SBError::operator*() const {
// Be sure to call "IsValid()" before calling this function or it will crash
return *m_opaque_ap;
}
bool SBError::GetDescription(SBStream &description) {
if (m_opaque_ap.get()) {
if (m_opaque_ap->Success())
description.Printf("success");
else {
const char *err_string = GetCString();
description.Printf("error: %s", (err_string != NULL ? err_string : ""));
}
} else
description.Printf("error: <NULL>");
return true;
}

View File

@ -0,0 +1,187 @@
//===-- SBEvent.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/API/SBEvent.h"
#include "lldb/API/SBBroadcaster.h"
#include "lldb/API/SBStream.h"
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Core/Event.h"
#include "lldb/Core/StreamFile.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Target/Process.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/Stream.h"
using namespace lldb;
using namespace lldb_private;
SBEvent::SBEvent() : m_event_sp(), m_opaque_ptr(NULL) {}
SBEvent::SBEvent(uint32_t event_type, const char *cstr, uint32_t cstr_len)
: m_event_sp(new Event(event_type, new EventDataBytes(cstr, cstr_len))),
m_opaque_ptr(m_event_sp.get()) {}
SBEvent::SBEvent(EventSP &event_sp)
: m_event_sp(event_sp), m_opaque_ptr(event_sp.get()) {}
SBEvent::SBEvent(Event *event_ptr) : m_event_sp(), m_opaque_ptr(event_ptr) {}
SBEvent::SBEvent(const SBEvent &rhs)
: m_event_sp(rhs.m_event_sp), m_opaque_ptr(rhs.m_opaque_ptr) {}
const SBEvent &SBEvent::operator=(const SBEvent &rhs) {
if (this != &rhs) {
m_event_sp = rhs.m_event_sp;
m_opaque_ptr = rhs.m_opaque_ptr;
}
return *this;
}
SBEvent::~SBEvent() {}
const char *SBEvent::GetDataFlavor() {
Event *lldb_event = get();
if (lldb_event) {
EventData *event_data = lldb_event->GetData();
if (event_data)
return lldb_event->GetData()->GetFlavor().AsCString();
}
return NULL;
}
uint32_t SBEvent::GetType() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const Event *lldb_event = get();
uint32_t event_type = 0;
if (lldb_event)
event_type = lldb_event->GetType();
if (log) {
StreamString sstr;
if (lldb_event && lldb_event->GetBroadcaster() &&
lldb_event->GetBroadcaster()->GetEventNames(sstr, event_type, true))
log->Printf("SBEvent(%p)::GetType () => 0x%8.8x (%s)",
static_cast<void *>(get()), event_type, sstr.GetData());
else
log->Printf("SBEvent(%p)::GetType () => 0x%8.8x",
static_cast<void *>(get()), event_type);
}
return event_type;
}
SBBroadcaster SBEvent::GetBroadcaster() const {
SBBroadcaster broadcaster;
const Event *lldb_event = get();
if (lldb_event)
broadcaster.reset(lldb_event->GetBroadcaster(), false);
return broadcaster;
}
const char *SBEvent::GetBroadcasterClass() const {
const Event *lldb_event = get();
if (lldb_event)
return lldb_event->GetBroadcaster()->GetBroadcasterClass().AsCString();
else
return "unknown class";
}
bool SBEvent::BroadcasterMatchesPtr(const SBBroadcaster *broadcaster) {
if (broadcaster)
return BroadcasterMatchesRef(*broadcaster);
return false;
}
bool SBEvent::BroadcasterMatchesRef(const SBBroadcaster &broadcaster) {
Event *lldb_event = get();
bool success = false;
if (lldb_event)
success = lldb_event->BroadcasterIs(broadcaster.get());
// For logging, this gets a little chatty so only enable this when verbose
// logging is on
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
LLDB_LOGV(log, "({0}) (SBBroadcaster({1}): {2}) => {3}", get(),
broadcaster.get(), broadcaster.GetName(), success);
return success;
}
void SBEvent::Clear() {
Event *lldb_event = get();
if (lldb_event)
lldb_event->Clear();
}
EventSP &SBEvent::GetSP() const { return m_event_sp; }
Event *SBEvent::get() const {
// There is a dangerous accessor call GetSharedPtr which can be used, so if
// we have anything valid in m_event_sp, we must use that since if it gets
// used by a function that puts something in there, then it won't update
// m_opaque_ptr...
if (m_event_sp)
m_opaque_ptr = m_event_sp.get();
return m_opaque_ptr;
}
void SBEvent::reset(EventSP &event_sp) {
m_event_sp = event_sp;
m_opaque_ptr = m_event_sp.get();
}
void SBEvent::reset(Event *event_ptr) {
m_opaque_ptr = event_ptr;
m_event_sp.reset();
}
bool SBEvent::IsValid() const {
// Do NOT use m_opaque_ptr directly!!! Must use the SBEvent::get()
// accessor. See comments in SBEvent::get()....
return SBEvent::get() != NULL;
}
const char *SBEvent::GetCStringFromEvent(const SBEvent &event) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log)
log->Printf("SBEvent(%p)::GetCStringFromEvent () => \"%s\"",
static_cast<void *>(event.get()),
reinterpret_cast<const char *>(
EventDataBytes::GetBytesFromEvent(event.get())));
return reinterpret_cast<const char *>(
EventDataBytes::GetBytesFromEvent(event.get()));
}
bool SBEvent::GetDescription(SBStream &description) {
Stream &strm = description.ref();
if (get()) {
m_opaque_ptr->Dump(&strm);
} else
strm.PutCString("No value");
return true;
}
bool SBEvent::GetDescription(SBStream &description) const {
Stream &strm = description.ref();
if (get()) {
m_opaque_ptr->Dump(&strm);
} else
strm.PutCString("No value");
return true;
}

View File

@ -0,0 +1,102 @@
//===-- SBExecutionContext.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/API/SBExecutionContext.h"
#include "lldb/API/SBFrame.h"
#include "lldb/API/SBProcess.h"
#include "lldb/API/SBTarget.h"
#include "lldb/API/SBThread.h"
#include "lldb/Target/ExecutionContext.h"
using namespace lldb;
using namespace lldb_private;
SBExecutionContext::SBExecutionContext() : m_exe_ctx_sp() {}
SBExecutionContext::SBExecutionContext(const lldb::SBExecutionContext &rhs)
: m_exe_ctx_sp(rhs.m_exe_ctx_sp) {}
SBExecutionContext::SBExecutionContext(
lldb::ExecutionContextRefSP exe_ctx_ref_sp)
: m_exe_ctx_sp(exe_ctx_ref_sp) {}
SBExecutionContext::SBExecutionContext(const lldb::SBTarget &target)
: m_exe_ctx_sp(new ExecutionContextRef()) {
m_exe_ctx_sp->SetTargetSP(target.GetSP());
}
SBExecutionContext::SBExecutionContext(const lldb::SBProcess &process)
: m_exe_ctx_sp(new ExecutionContextRef()) {
m_exe_ctx_sp->SetProcessSP(process.GetSP());
}
SBExecutionContext::SBExecutionContext(lldb::SBThread thread)
: m_exe_ctx_sp(new ExecutionContextRef()) {
m_exe_ctx_sp->SetThreadPtr(thread.get());
}
SBExecutionContext::SBExecutionContext(const lldb::SBFrame &frame)
: m_exe_ctx_sp(new ExecutionContextRef()) {
m_exe_ctx_sp->SetFrameSP(frame.GetFrameSP());
}
SBExecutionContext::~SBExecutionContext() {}
const SBExecutionContext &SBExecutionContext::
operator=(const lldb::SBExecutionContext &rhs) {
m_exe_ctx_sp = rhs.m_exe_ctx_sp;
return *this;
}
ExecutionContextRef *SBExecutionContext::get() const {
return m_exe_ctx_sp.get();
}
SBTarget SBExecutionContext::GetTarget() const {
SBTarget sb_target;
if (m_exe_ctx_sp) {
TargetSP target_sp(m_exe_ctx_sp->GetTargetSP());
if (target_sp)
sb_target.SetSP(target_sp);
}
return sb_target;
}
SBProcess SBExecutionContext::GetProcess() const {
SBProcess sb_process;
if (m_exe_ctx_sp) {
ProcessSP process_sp(m_exe_ctx_sp->GetProcessSP());
if (process_sp)
sb_process.SetSP(process_sp);
}
return sb_process;
}
SBThread SBExecutionContext::GetThread() const {
SBThread sb_thread;
if (m_exe_ctx_sp) {
ThreadSP thread_sp(m_exe_ctx_sp->GetThreadSP());
if (thread_sp)
sb_thread.SetThread(thread_sp);
}
return sb_thread;
}
SBFrame SBExecutionContext::GetFrame() const {
SBFrame sb_frame;
if (m_exe_ctx_sp) {
StackFrameSP frame_sp(m_exe_ctx_sp->GetFrameSP());
if (frame_sp)
sb_frame.SetFrameSP(frame_sp);
}
return sb_frame;
}

Some files were not shown because too many files have changed in this diff Show More