[llvm-branch-commits] [lldb] r179698 - Make it compile in VS2010.
Carlo Kok
ck at remobjects.com
Wed Apr 17 11:03:23 PDT 2013
Author: carlokok
Date: Wed Apr 17 13:03:22 2013
New Revision: 179698
URL: http://llvm.org/viewvc/llvm-project?rev=179698&view=rev
Log:
Make it compile in VS2010.
Modified:
lldb/branches/windows/include/lldb/Expression/IRExecutionUnit.h
lldb/branches/windows/source/API/SBValueList.cpp
lldb/branches/windows/source/Breakpoint/BreakpointResolverName.cpp
lldb/branches/windows/source/Core/ValueObject.cpp
lldb/branches/windows/source/DataFormatters/NSDictionary.cpp
lldb/branches/windows/source/Expression/IRExecutionUnit.cpp
lldb/branches/windows/source/Expression/IRForTarget.cpp
lldb/branches/windows/source/Expression/IRMemoryMap.cpp
lldb/branches/windows/source/Expression/Materializer.cpp
lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
Modified: lldb/branches/windows/include/lldb/Expression/IRExecutionUnit.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Expression/IRExecutionUnit.h?rev=179698&r1=179697&r2=179698&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Expression/IRExecutionUnit.h (original)
+++ lldb/branches/windows/include/lldb/Expression/IRExecutionUnit.h Wed Apr 17 13:03:22 2013
@@ -12,7 +12,9 @@
// C Includes
// C++ Includes
+#ifndef _WIN32
#include <atomic>
+#endif
#include <string>
#include <vector>
#include <map>
@@ -498,7 +500,11 @@ private:
llvm::SmallVector<JittedFunction, 1> m_jitted_functions; ///< A vector of all functions that have been JITted into machine code
const ConstString m_name;
+#if _WIN32
+ unsigned int m_did_jit;
+#else
std::atomic<bool> m_did_jit;
+#endif
lldb::addr_t m_function_load_addr;
lldb::addr_t m_function_end_load_addr;
Modified: lldb/branches/windows/source/API/SBValueList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBValueList.cpp?rev=179698&r1=179697&r2=179698&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBValueList.cpp (original)
+++ lldb/branches/windows/source/API/SBValueList.cpp Wed Apr 17 13:03:22 2013
@@ -57,8 +57,8 @@ namespace {
void
Append (const ValueListImpl& list)
{
- for (auto val : list.m_values)
- Append (val);
+ for (auto val = list.m_values.begin(); val != list.m_values.end(); val ++)
+ Append (*val);
}
lldb::SBValue
@@ -72,10 +72,10 @@ namespace {
lldb::SBValue
FindValueByUID (lldb::user_id_t uid)
{
- for (auto val : m_values)
+ for (auto val = m_values.begin(); val != m_values.end(); val++)
{
- if (val.IsValid() && val.GetID() == uid)
- return val;
+ if (val->IsValid() && val->GetID() == uid)
+ return *val;
}
return lldb::SBValue();
}
Modified: lldb/branches/windows/source/Breakpoint/BreakpointResolverName.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/BreakpointResolverName.cpp?rev=179698&r1=179697&r2=179698&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/BreakpointResolverName.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/BreakpointResolverName.cpp Wed Apr 17 13:03:22 2013
@@ -78,9 +78,9 @@ BreakpointResolverName::BreakpointResolv
m_match_type (Breakpoint::Exact),
m_skip_prologue (skip_prologue)
{
- for (const std::string& name : names)
+ for (auto name = names.begin(); name != names.end(); name ++)
{
- AddNameLookup (ConstString (name.c_str(), name.size()), name_type_mask);
+ AddNameLookup (ConstString (name->c_str(), name->size()), name_type_mask);
}
}
@@ -129,11 +129,11 @@ BreakpointResolverName::AddNameLookup (c
{
std::vector<ConstString> objc_names;
objc_method.GetFullNames(objc_names, true);
- for (ConstString objc_name : objc_names)
+ for (auto objc_name = objc_names.begin(); objc_name != objc_names.end(); objc_name++)
{
LookupInfo lookup;
lookup.name = name;
- lookup.lookup_name = objc_name;
+ lookup.lookup_name = *objc_name;
lookup.name_type_mask = eFunctionNameTypeFull;
lookup.match_name_after_lookup = false;
m_lookups.push_back (lookup);
@@ -214,12 +214,12 @@ BreakpointResolverName::SearchCallback
case Breakpoint::Exact:
if (context.module_sp)
{
- for (const LookupInfo &lookup : m_lookups)
+ for (auto lookup = m_lookups.begin(); lookup != m_lookups.end(); lookup++)
{
const size_t start_func_idx = func_list.GetSize();
- context.module_sp->FindFunctions (lookup.lookup_name,
+ context.module_sp->FindFunctions (lookup->lookup_name,
NULL,
- lookup.name_type_mask,
+ lookup->name_type_mask,
include_symbols,
include_inlines,
append,
@@ -227,16 +227,16 @@ BreakpointResolverName::SearchCallback
const size_t end_func_idx = func_list.GetSize();
if (start_func_idx < end_func_idx)
- lookup.Prune (func_list, start_func_idx);
+ lookup->Prune (func_list, start_func_idx);
// If the search filter specifies a Compilation Unit, then we don't need to bother to look in plain
// symbols, since all the ones from a set compilation unit will have been found above already.
else if (!filter_by_cu)
{
const size_t start_symbol_idx = sym_list.GetSize();
- context.module_sp->FindFunctionSymbols (lookup.lookup_name, lookup.name_type_mask, sym_list);
+ context.module_sp->FindFunctionSymbols (lookup->lookup_name, lookup->name_type_mask, sym_list);
const size_t end_symbol_idx = sym_list.GetSize();
if (start_symbol_idx < end_symbol_idx)
- lookup.Prune (func_list, start_symbol_idx);
+ lookup->Prune (func_list, start_symbol_idx);
}
}
}
Modified: lldb/branches/windows/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ValueObject.cpp?rev=179698&r1=179697&r2=179698&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ValueObject.cpp (original)
+++ lldb/branches/windows/source/Core/ValueObject.cpp Wed Apr 17 13:03:22 2013
@@ -571,13 +571,13 @@ ValueObject::GetChildAtIndexPath (const
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
- for (size_t idx : idxs)
+ for (auto idx = idxs.begin(); idx != idxs.end(); idx++)
{
- root = root->GetChildAtIndex(idx, true);
+ root = root->GetChildAtIndex(*idx, true);
if (!root)
{
if (index_of_error)
- *index_of_error = idx;
+ *index_of_error = *idx;
return root;
}
}
@@ -591,13 +591,13 @@ ValueObject::GetChildAtIndexPath (const
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
- for (std::pair<size_t, bool> idx : idxs)
+ for (auto idx = idxs.begin(); idx != idxs.end(); idx++)
{
- root = root->GetChildAtIndex(idx.first, idx.second);
+ root = root->GetChildAtIndex(idx->first, idx->second);
if (!root)
{
if (index_of_error)
- *index_of_error = idx.first;
+ *index_of_error = idx->first;
return root;
}
}
Modified: lldb/branches/windows/source/DataFormatters/NSDictionary.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/DataFormatters/NSDictionary.cpp?rev=179698&r1=179697&r2=179698&view=diff
==============================================================================
--- lldb/branches/windows/source/DataFormatters/NSDictionary.cpp (original)
+++ lldb/branches/windows/source/DataFormatters/NSDictionary.cpp Wed Apr 17 13:03:22 2013
@@ -46,9 +46,9 @@ GetLLDBNSPairType (TargetSP target_sp)
clang_type_t opaque_type = NULL;
- for (clang::NamedDecl *named_decl : result)
+ for (auto named_decl = result.begin(); named_decl != result.end(); named_decl ++)
{
- if (const clang::CXXRecordDecl *record_decl = llvm::dyn_cast<clang::CXXRecordDecl>(named_decl))
+ if (const clang::CXXRecordDecl *record_decl = llvm::dyn_cast<clang::CXXRecordDecl>(*named_decl))
{
opaque_type = clang::QualType(record_decl->getTypeForDecl(), 0).getAsOpaquePtr();
break;
Modified: lldb/branches/windows/source/Expression/IRExecutionUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/IRExecutionUnit.cpp?rev=179698&r1=179697&r2=179698&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/IRExecutionUnit.cpp (original)
+++ lldb/branches/windows/source/Expression/IRExecutionUnit.cpp Wed Apr 17 13:03:22 2013
@@ -111,12 +111,12 @@ IRExecutionUnit::DisassembleFunction (St
lldb::addr_t func_local_addr = LLDB_INVALID_ADDRESS;
lldb::addr_t func_remote_addr = LLDB_INVALID_ADDRESS;
- for (JittedFunction &function : m_jitted_functions)
+ for (auto function = m_jitted_functions.begin(); function != m_jitted_functions.end(); function++)
{
- if (strstr(function.m_name.c_str(), m_name.AsCString()))
+ if (strstr(function->m_name.c_str(), m_name.AsCString()))
{
- func_local_addr = function.m_local_addr;
- func_remote_addr = function.m_remote_addr;
+ func_local_addr = function->m_local_addr;
+ func_remote_addr = function->m_remote_addr;
}
}
@@ -248,7 +248,16 @@ IRExecutionUnit::GetRunnableInfo(Error &
error.SetErrorString("Couldn't write the JIT compiled code into the process because the process is invalid");
return;
}
-
+
+#if _WIN32
+ if (InterlockedExchange(&m_did_jit, 1))
+ {
+ func_addr = m_function_load_addr;
+ func_end = m_function_end_load_addr;
+
+ return;
+ };
+#else
if (m_did_jit)
{
func_addr = m_function_load_addr;
@@ -258,6 +267,7 @@ IRExecutionUnit::GetRunnableInfo(Error &
};
m_did_jit = true;
+#endif
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
@@ -309,8 +319,8 @@ IRExecutionUnit::GetRunnableInfo(Error &
llvm::StringRef mCPU;
llvm::SmallVector<std::string, 0> mAttrs;
- for (std::string &feature : m_cpu_features)
- mAttrs.push_back(feature);
+ for (auto feature = m_cpu_features.begin(); feature != m_cpu_features.end(); feature++)
+ mAttrs.push_back(*feature);
llvm::TargetMachine *target_machine = builder.selectTarget(triple,
mArch,
@@ -362,15 +372,15 @@ IRExecutionUnit::GetRunnableInfo(Error &
ReportAllocations(*m_execution_engine_ap);
WriteData(process_sp);
- for (JittedFunction &jitted_function : m_jitted_functions)
+ for (auto jitted_function = m_jitted_functions.begin(); jitted_function != m_jitted_functions.end(); jitted_function++)
{
- jitted_function.m_remote_addr = GetRemoteAddressForLocal (jitted_function.m_local_addr);
+ jitted_function->m_remote_addr = GetRemoteAddressForLocal (jitted_function->m_local_addr);
- if (!jitted_function.m_name.compare(m_name.AsCString()))
+ if (!jitted_function->m_name.compare(m_name.AsCString()))
{
- AddrRange func_range = GetRemoteRangeForLocal(jitted_function.m_local_addr);
+ AddrRange func_range = GetRemoteRangeForLocal(jitted_function->m_local_addr);
m_function_end_load_addr = func_range.first + func_range.second;
- m_function_load_addr = jitted_function.m_remote_addr;
+ m_function_load_addr = jitted_function->m_remote_addr;
}
}
@@ -581,16 +591,16 @@ IRExecutionUnit::MemoryManager::dealloca
lldb::addr_t
IRExecutionUnit::GetRemoteAddressForLocal (lldb::addr_t local_address)
{
- for (AllocationRecord &record : m_records)
+ for (auto record = m_records.begin(); record != m_records.end(); record++)
{
- if (local_address >= record.m_host_address &&
- local_address < record.m_host_address + record.m_size)
+ if (local_address >= record->m_host_address &&
+ local_address < record->m_host_address + record->m_size)
{
- if (record.m_process_address == LLDB_INVALID_ADDRESS)
+ if (record->m_process_address == LLDB_INVALID_ADDRESS)
return LLDB_INVALID_ADDRESS;
}
- return record.m_process_address + (local_address - record.m_host_address);
+ return record->m_process_address + (local_address - record->m_host_address);
}
return LLDB_INVALID_ADDRESS;
@@ -599,15 +609,15 @@ IRExecutionUnit::GetRemoteAddressForLoca
IRExecutionUnit::AddrRange
IRExecutionUnit::GetRemoteRangeForLocal (lldb::addr_t local_address)
{
- for (AllocationRecord &record : m_records)
+ for (auto record = m_records.begin(); record != m_records.end(); record++)
{
- if (local_address >= record.m_host_address &&
- local_address < record.m_host_address + record.m_size)
+ if (local_address >= record->m_host_address &&
+ local_address < record->m_host_address + record->m_size)
{
- if (record.m_process_address == LLDB_INVALID_ADDRESS)
+ if (record->m_process_address == LLDB_INVALID_ADDRESS)
return AddrRange(0, 0);
- return AddrRange(record.m_process_address, record.m_size);
+ return AddrRange(record->m_process_address, record->m_size);
}
}
@@ -621,15 +631,15 @@ IRExecutionUnit::CommitAllocations (lldb
lldb_private::Error err;
- for (AllocationRecord &record : m_records)
+ for (auto record = m_records.begin(); record != m_records.end(); record ++)
{
- if (record.m_process_address != LLDB_INVALID_ADDRESS)
+ if (record->m_process_address != LLDB_INVALID_ADDRESS)
continue;
- record.m_process_address = Malloc(record.m_size,
- record.m_alignment,
- record.m_permissions,
+ record->m_process_address = Malloc(record->m_size,
+ record->m_alignment,
+ record->m_permissions,
eAllocationPolicyProcessOnly,
err);
@@ -642,12 +652,12 @@ IRExecutionUnit::CommitAllocations (lldb
if (!ret)
{
- for (AllocationRecord &record : m_records)
+ for (auto record = m_records.begin(); record != m_records.end(); record ++)
{
- if (record.m_process_address != LLDB_INVALID_ADDRESS)
+ if (record->m_process_address != LLDB_INVALID_ADDRESS)
{
- Free(record.m_process_address, err);
- record.m_process_address = LLDB_INVALID_ADDRESS;
+ Free(record->m_process_address, err);
+ record->m_process_address = LLDB_INVALID_ADDRESS;
}
}
}
@@ -658,15 +668,15 @@ IRExecutionUnit::CommitAllocations (lldb
void
IRExecutionUnit::ReportAllocations (llvm::ExecutionEngine &engine)
{
- for (AllocationRecord &record : m_records)
+ for (auto record = m_records.begin(); record != m_records.end(); record++)
{
- if (record.m_process_address == LLDB_INVALID_ADDRESS)
+ if (record->m_process_address == LLDB_INVALID_ADDRESS)
continue;
- if (record.m_section_id == eSectionIDInvalid)
+ if (record->m_section_id == eSectionIDInvalid)
continue;
- engine.mapSectionAddress((void*)record.m_host_address, record.m_process_address);
+ engine.mapSectionAddress((void*)record->m_host_address, record->m_process_address);
}
// Trigger re-application of relocations.
@@ -676,14 +686,14 @@ IRExecutionUnit::ReportAllocations (llvm
bool
IRExecutionUnit::WriteData (lldb::ProcessSP &process_sp)
{
- for (AllocationRecord &record : m_records)
+ for (auto record = m_records.begin(); record != m_records.end(); record++)
{
- if (record.m_process_address == LLDB_INVALID_ADDRESS)
+ if (record->m_process_address == LLDB_INVALID_ADDRESS)
return false;
lldb_private::Error err;
- WriteMemory (record.m_process_address, (uint8_t*)record.m_host_address, record.m_size, err);
+ WriteMemory (record->m_process_address, (uint8_t*)record->m_host_address, record->m_size, err);
}
return true;
Modified: lldb/branches/windows/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/IRForTarget.cpp?rev=179698&r1=179697&r2=179698&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/IRForTarget.cpp (original)
+++ lldb/branches/windows/source/Expression/IRForTarget.cpp Wed Apr 17 13:03:22 2013
@@ -1831,13 +1831,13 @@ IRForTarget::HandleObjCClass(Value *clas
Constant *class_addr = ConstantInt::get(intptr_ty, (uint64_t)class_ptr);
- for (LoadInst *load_instruction : load_instructions)
+ for (auto load_instruction = load_instructions.begin(); load_instruction != load_instructions.end(); load_instruction++)
{
- Constant *class_bitcast = ConstantExpr::getIntToPtr(class_addr, load_instruction->getType());
+ Constant *class_bitcast = ConstantExpr::getIntToPtr(class_addr, (*load_instruction)->getType());
- load_instruction->replaceAllUsesWith(class_bitcast);
+ (*load_instruction)->replaceAllUsesWith(class_bitcast);
- load_instruction->eraseFromParent();
+ (*load_instruction)->eraseFromParent();
}
return true;
Modified: lldb/branches/windows/source/Expression/IRMemoryMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/IRMemoryMap.cpp?rev=179698&r1=179697&r2=179698&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/IRMemoryMap.cpp (original)
+++ lldb/branches/windows/source/Expression/IRMemoryMap.cpp Wed Apr 17 13:03:22 2013
@@ -31,17 +31,17 @@ IRMemoryMap::~IRMemoryMap ()
if (process_sp)
{
- for (AllocationMap::value_type &allocation : m_allocations)
+ for (auto allocation = m_allocations.begin(); allocation != m_allocations.end(); allocation ++)
{
- if (allocation.second.m_policy == eAllocationPolicyMirror ||
- allocation.second.m_policy == eAllocationPolicyHostOnly)
- process_sp->DeallocateMemory(allocation.second.m_process_alloc);
+ if (allocation->second.m_policy == eAllocationPolicyMirror ||
+ allocation->second.m_policy == eAllocationPolicyHostOnly)
+ process_sp->DeallocateMemory(allocation->second.m_process_alloc);
if (lldb_private::Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS))
{
log->Printf("IRMemoryMap::~IRMemoryMap deallocated [0x%llx..0x%llx)",
- (uint64_t)allocation.second.m_process_start,
- (uint64_t)allocation.second.m_process_start + (uint64_t)allocation.second.m_size);
+ (uint64_t)allocation->second.m_process_start,
+ (uint64_t)allocation->second.m_process_start + (uint64_t)allocation->second.m_size);
}
}
}
@@ -55,13 +55,13 @@ IRMemoryMap::FindSpace (size_t size)
lldb::addr_t remote_address = 0x1000; // skip first page of memory
- for (AllocationMap::value_type &allocation : m_allocations)
+ for (auto allocation = m_allocations.begin(); allocation != m_allocations.end(); allocation++)
{
- if (remote_address < allocation.second.m_process_start &&
- remote_address + size <= allocation.second.m_process_start)
+ if (remote_address < allocation->second.m_process_start &&
+ remote_address + size <= allocation->second.m_process_start)
return remote_address;
- remote_address = allocation.second.m_process_start = allocation.second.m_size;
+ remote_address = allocation->second.m_process_start = allocation->second.m_size;
}
if (remote_address + size < remote_address)
@@ -73,9 +73,9 @@ IRMemoryMap::FindSpace (size_t size)
bool
IRMemoryMap::ContainsHostOnlyAllocations ()
{
- for (AllocationMap::value_type &allocation : m_allocations)
+ for (auto allocation = m_allocations.begin(); allocation != m_allocations.end(); allocation ++)
{
- if (allocation.second.m_policy == eAllocationPolicyHostOnly)
+ if (allocation->second.m_policy == eAllocationPolicyHostOnly)
return true;
}
Modified: lldb/branches/windows/source/Expression/Materializer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/Materializer.cpp?rev=179698&r1=179697&r2=179698&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/Materializer.cpp (original)
+++ lldb/branches/windows/source/Expression/Materializer.cpp Wed Apr 17 13:03:22 2013
@@ -995,9 +995,9 @@ Materializer::Materialize (lldb::StackFr
error.SetErrorString("Couldn't dematerialize: target doesn't exist");
}
- for (EntityUP &entity_up : m_entities)
+ for (auto entity_up = m_entities.begin(); entity_up != m_entities.end(); entity_up++)
{
- entity_up->Materialize(frame_sp, map, process_address, error);
+ (*entity_up)->Materialize(frame_sp, map, process_address, error);
if (!error.Success())
return Dematerializer (*this, frame_sp, map, LLDB_INVALID_ADDRESS);
@@ -1006,8 +1006,8 @@ Materializer::Materialize (lldb::StackFr
if (Log *log =lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS))
{
log->Printf("Materializer::Materialize (frame_sp = %p, process_address = 0x%llx) materialized:", frame_sp.get(), process_address);
- for (EntityUP &entity_up : m_entities)
- entity_up->DumpToLog(map, process_address, log);
+ for (auto entity_up = m_entities.begin(); entity_up != m_entities.end(); entity_up++)
+ (*entity_up)->DumpToLog(map, process_address, log);
}
m_needs_dematerialize.Lock();
@@ -1032,13 +1032,13 @@ Materializer::Dematerializer::Dematerial
if (Log *log =lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS))
{
log->Printf("Materializer::Dematerialize (frame_sp = %p, process_address = 0x%llx) about to dematerialize:", frame_sp.get(), m_process_address);
- for (EntityUP &entity_up : m_materializer.m_entities)
- entity_up->DumpToLog(m_map, m_process_address, log);
+ for (auto entity_up = m_materializer.m_entities.begin(); entity_up != m_materializer.m_entities.end(); entity_up++)
+ (*entity_up)->DumpToLog(m_map, m_process_address, log);
}
- for (EntityUP &entity_up : m_materializer.m_entities)
+ for (auto entity_up = m_materializer.m_entities.begin(); entity_up != m_materializer.m_entities.end(); entity_up++)
{
- entity_up->Dematerialize (frame_sp, m_map, m_process_address, frame_top, frame_bottom, error);
+ (*entity_up)->Dematerialize (frame_sp, m_map, m_process_address, frame_top, frame_bottom, error);
if (!error.Success())
break;
Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=179698&r1=179697&r2=179698&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Wed Apr 17 13:03:22 2013
@@ -72,8 +72,9 @@ SymbolFileDWARFDebugMap::CompileUnitInfo
std::vector<SymbolFileDWARFDebugMap::CompileUnitInfo *> cu_infos;
if (exe_symfile->GetCompUnitInfosForModule(oso_module, cu_infos))
{
- for (auto comp_unit_info : cu_infos)
+ for (auto comp_unit_info_ref = cu_infos.begin(); comp_unit_info_ref != cu_infos.end(); comp_unit_info_ref++)
{
+ auto comp_unit_info = *comp_unit_info_ref;
Symtab *exe_symtab = exe_symfile->GetObjectFile()->GetSymtab();
ModuleSP oso_module_sp (oso_objfile->GetModule());
Symtab *oso_symtab = oso_objfile->GetSymtab();
@@ -352,20 +353,20 @@ SymbolFileDWARFDebugMap::InitOSO()
symtab->SortSymbolIndexesByValue(m_func_indexes, true);
symtab->SortSymbolIndexesByValue(m_glob_indexes, true);
- for (uint32_t sym_idx : m_func_indexes)
+ for (auto sym_idx = m_func_indexes.begin(); sym_idx != m_func_indexes.end(); sym_idx ++)
{
- const Symbol *symbol = symtab->SymbolAtIndex(sym_idx);
+ const Symbol *symbol = symtab->SymbolAtIndex(*sym_idx);
lldb::addr_t file_addr = symbol->GetAddress().GetFileAddress();
lldb::addr_t byte_size = symbol->GetByteSize();
- DebugMap::Entry debug_map_entry(file_addr, byte_size, OSOEntry(sym_idx, LLDB_INVALID_ADDRESS));
+ DebugMap::Entry debug_map_entry(file_addr, byte_size, OSOEntry(*sym_idx, LLDB_INVALID_ADDRESS));
m_debug_map.Append(debug_map_entry);
}
- for (uint32_t sym_idx : m_glob_indexes)
+ for (auto sym_idx = m_glob_indexes.begin(); sym_idx != m_glob_indexes.end(); sym_idx ++)
{
- const Symbol *symbol = symtab->SymbolAtIndex(sym_idx);
+ const Symbol *symbol = symtab->SymbolAtIndex(*sym_idx);
lldb::addr_t file_addr = symbol->GetAddress().GetFileAddress();
lldb::addr_t byte_size = symbol->GetByteSize();
- DebugMap::Entry debug_map_entry(file_addr, byte_size, OSOEntry(sym_idx, LLDB_INVALID_ADDRESS));
+ DebugMap::Entry debug_map_entry(file_addr, byte_size, OSOEntry(*sym_idx, LLDB_INVALID_ADDRESS));
m_debug_map.Append(debug_map_entry);
}
m_debug_map.Sort();
More information about the llvm-branch-commits
mailing list