diff options
author | emaste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
commit | 8037fa4ee916fa20b3c63cbf531f4ee7e1c76138 (patch) | |
tree | 3c2e41c3be19b7fc7666ed45a5f91ec3b6e35f2a /source/Expression/IRExecutionUnit.cpp | |
parent | d61b076ede88b56f3372a55e7d1eac6a9d717120 (diff) | |
download | FreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.zip FreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.tar.gz |
Import LLDB as of upstream SVN 241361 (git 612c075f)
Diffstat (limited to 'source/Expression/IRExecutionUnit.cpp')
-rw-r--r-- | source/Expression/IRExecutionUnit.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/source/Expression/IRExecutionUnit.cpp b/source/Expression/IRExecutionUnit.cpp index 9ca9e25..7232685 100644 --- a/source/Expression/IRExecutionUnit.cpp +++ b/source/Expression/IRExecutionUnit.cpp @@ -11,6 +11,8 @@ #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/Support/SourceMgr.h" +#include "llvm/Support/raw_ostream.h" + #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Debugger.h" @@ -18,9 +20,11 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" +#include "lldb/Symbol/SymbolContext.h" #include "lldb/Expression/IRExecutionUnit.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Target.h" +#include "lldb/Target/ObjCLanguageRuntime.h" using namespace lldb_private; @@ -584,7 +588,7 @@ IRExecutionUnit::MemoryManager::allocateCodeSection(uintptr_t Size, if (log) { log->Printf("IRExecutionUnit::allocateCodeSection(Size=0x%" PRIx64 ", Alignment=%u, SectionID=%u) = %p", - (uint64_t)Size, Alignment, SectionID, return_value); + (uint64_t)Size, Alignment, SectionID, (void *)return_value); } return return_value; @@ -601,8 +605,11 @@ IRExecutionUnit::MemoryManager::allocateDataSection(uintptr_t Size, uint8_t *return_value = m_default_mm_ap->allocateDataSection(Size, Alignment, SectionID, SectionName, IsReadOnly); + uint32_t permissions = lldb::ePermissionsReadable; + if (!IsReadOnly) + permissions |= lldb::ePermissionsWritable; m_parent.m_records.push_back(AllocationRecord((uintptr_t)return_value, - lldb::ePermissionsReadable | (IsReadOnly ? 0 : lldb::ePermissionsWritable), + permissions, GetSectionTypeFromSectionName (SectionName, AllocationKind::Data), Size, Alignment, @@ -611,7 +618,7 @@ IRExecutionUnit::MemoryManager::allocateDataSection(uintptr_t Size, if (log) { log->Printf("IRExecutionUnit::allocateDataSection(Size=0x%" PRIx64 ", Alignment=%u, SectionID=%u) = %p", - (uint64_t)Size, Alignment, SectionID, return_value); + (uint64_t)Size, Alignment, SectionID, (void *)return_value); } return return_value; @@ -669,20 +676,10 @@ IRExecutionUnit::MemoryManager::getSymbolAddress(const std::string &Name) SymbolContext sym_ctx; sc_list.GetContextAtIndex(i, sym_ctx); - if (sym_ctx.symbol->GetType() == lldb::eSymbolTypeUndefined) - continue; - - const Address *sym_address = &sym_ctx.symbol->GetAddress(); - - if (!sym_address || !sym_address->IsValid()) - continue; - symbol_load_addr = sym_ctx.symbol->ResolveCallableAddress(*target_sp); - + if (symbol_load_addr == LLDB_INVALID_ADDRESS) - { symbol_load_addr = sym_ctx.symbol->GetAddress().GetLoadAddress(target_sp.get()); - } } if (symbol_load_addr == LLDB_INVALID_ADDRESS && process_sp && name_cs) |