diff options
28 files changed, 84 insertions, 83 deletions
diff --git a/lldb/include/lldb/Expression/ClangASTSource.h b/lldb/include/lldb/Expression/ClangASTSource.h index e7b8a43b536..11224e21c4d 100644 --- a/lldb/include/lldb/Expression/ClangASTSource.h +++ b/lldb/include/lldb/Expression/ClangASTSource.h @@ -21,10 +21,10 @@ class ClangASTSource : public clang::ExternalSemaSource { public: friend struct NameSearchContext; - ClangASTSource(clang::ASTContext &Context, - ClangExpressionDeclMap &DeclMap) : - Context(Context), - DeclMap(DeclMap) {} + ClangASTSource(clang::ASTContext &context, + ClangExpressionDeclMap &declMap) : + Context(context), + DeclMap(declMap) {} ~ClangASTSource(); clang::Decl *GetExternalDecl(uint32_t); @@ -49,14 +49,14 @@ struct NameSearchContext { clang::DeclarationName &Name; const clang::DeclContext *DC; - NameSearchContext (ClangASTSource &ASTSource, - llvm::SmallVectorImpl<clang::NamedDecl*> &Decls, - clang::DeclarationName &Name, - const clang::DeclContext *DC) : - ASTSource(ASTSource), - Decls(Decls), - Name(Name), - DC(DC) {} + NameSearchContext (ClangASTSource &astSource, + llvm::SmallVectorImpl<clang::NamedDecl*> &decls, + clang::DeclarationName &name, + const clang::DeclContext *dc) : + ASTSource(astSource), + Decls(decls), + Name(name), + DC(dc) {} clang::ASTContext *GetASTContext(); clang::NamedDecl *AddVarDecl(void *type); diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreter.h b/lldb/include/lldb/Interpreter/ScriptInterpreter.h index afa00a4744f..6c3de15ba6b 100644 --- a/lldb/include/lldb/Interpreter/ScriptInterpreter.h +++ b/lldb/include/lldb/Interpreter/ScriptInterpreter.h @@ -73,8 +73,9 @@ public: } virtual void - CollectDataForBreakpointCommandCallback (BreakpointOptions *bp_options, - CommandReturnObject &result); + CollectDataForBreakpointCommandCallback (CommandInterpreter &interpreter, + BreakpointOptions *bp_options, + CommandReturnObject &result); const char * GetScriptInterpreterPtyName (); diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index f226042eef1..b598628ca42 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -2700,6 +2700,7 @@ LLDB_CONFIGURATION_DEBUG, ); GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; @@ -2722,6 +2723,7 @@ LLDB_CONFIGURATION_RELEASE, ); GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_UNUSED_VARIABLE = YES; PREBINDING = NO; VALID_ARCHS = "x86_64 i386"; @@ -2850,6 +2852,7 @@ LLDB_CONFIGURATION_BUILD_AND_INTEGRATION, ); GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_UNUSED_VARIABLE = YES; PREBINDING = NO; VALID_ARCHS = "x86_64 i386"; diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index 8f4b3b9d99e..268270597b3 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -100,7 +100,6 @@ SBThread::GetStopDescription (char *dst, size_t dst_len) } else { - const char *stop_desc = NULL; size_t stop_desc_len = 0; switch (thread_stop_info.GetStopReason()) { diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index 123a5ade061..a1b973b74ef 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -258,12 +258,15 @@ CommandObjectBreakpointCommandAdd::Execute { if (m_options.m_use_script_language) { - interpreter.GetScriptInterpreter()->CollectDataForBreakpointCommandCallback (bp_loc_sp->GetLocationOptions(), - result); + interpreter.GetScriptInterpreter()->CollectDataForBreakpointCommandCallback (interpreter, + bp_loc_sp->GetLocationOptions(), + result); } else { - CollectDataForBreakpointCommandCallback (interpreter, bp_loc_sp->GetLocationOptions(), result); + CollectDataForBreakpointCommandCallback (interpreter, + bp_loc_sp->GetLocationOptions(), + result); } } } @@ -271,12 +274,15 @@ CommandObjectBreakpointCommandAdd::Execute { if (m_options.m_use_script_language) { - interpreter.GetScriptInterpreter()->CollectDataForBreakpointCommandCallback (bp->GetOptions(), - result); + interpreter.GetScriptInterpreter()->CollectDataForBreakpointCommandCallback (interpreter, + bp->GetOptions(), + result); } else { - CollectDataForBreakpointCommandCallback (interpreter, bp->GetOptions(), result); + CollectDataForBreakpointCommandCallback (interpreter, + bp->GetOptions(), + result); } } } diff --git a/lldb/source/Commands/CommandObjectImage.cpp b/lldb/source/Commands/CommandObjectImage.cpp index 0b61816fbcb..b6b0d2469e9 100644 --- a/lldb/source/Commands/CommandObjectImage.cpp +++ b/lldb/source/Commands/CommandObjectImage.cpp @@ -1395,9 +1395,9 @@ public: if (num_matching_modules > 0) { - for (size_t i=0; i<num_matching_modules; ++i) + for (size_t j=0; j<num_matching_modules; ++j) { - Module * image_module = matching_modules.GetModulePointerAtIndex(i); + Module * image_module = matching_modules.GetModulePointerAtIndex(j); if (image_module) { if (LookupInModule (interpreter, image_module, result, syntax_error)) diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 69467511604..20b008ff5a5 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -536,7 +536,7 @@ public: result.AppendMessageWithFormat ("Resuming process %i\n", process->GetID()); if (synchronous_execution) { - StateType state = process->WaitForProcessToStop (NULL); + state = process->WaitForProcessToStop (NULL); result.SetDidChangeProcessState (true); result.AppendMessageWithFormat ("Process %i %s\n", process->GetID(), StateAsCString (state)); diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 0934045fd5b..6c38758e3fc 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -760,7 +760,7 @@ public: result.AppendMessageWithFormat ("Resuming process %i\n", process->GetID()); if (synchronous_execution) { - StateType state = process->WaitForProcessToStop (NULL); + state = process->WaitForProcessToStop (NULL); result.SetDidChangeProcessState (true); result.AppendMessageWithFormat ("Process %i %s\n", process->GetID(), StateAsCString (state)); @@ -827,7 +827,7 @@ public: { case 't': { - uint32_t m_thread_idx = Args::StringToUInt32 (option_arg, LLDB_INVALID_INDEX32); + m_thread_idx = Args::StringToUInt32 (option_arg, LLDB_INVALID_INDEX32); if (m_thread_idx == LLDB_INVALID_INDEX32) { error.SetErrorStringWithFormat ("Invalid thread index '%s'.\n", option_arg); diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp index 057b8567a4d..7119b71987f 100644 --- a/lldb/source/Core/Address.cpp +++ b/lldb/source/Core/Address.cpp @@ -628,7 +628,6 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum if (so_addr.IsSectionOffset()) { lldb_private::SymbolContext pointer_sc; - Target *target = exe_scope->CalculateTarget(); if (target) { target->GetImages().ResolveSymbolContextForAddress (so_addr, diff --git a/lldb/source/Core/InputReader.cpp b/lldb/source/Core/InputReader.cpp index afda9fa25f6..bc1dc49b2fd 100644 --- a/lldb/source/Core/InputReader.cpp +++ b/lldb/source/Core/InputReader.cpp @@ -196,7 +196,6 @@ InputReader::HandleRawBytes (const char *bytes, size_t bytes_len) { const char *line_start = bytes; const char *end_line = NULL; - const char *end = bytes + bytes_len; while (p < end) { const char ch = *p; diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 4a1e002242e..c32bdc28148 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -540,7 +540,7 @@ ValueObject::SetValueFromCString (ExecutionContextScope *exe_scope, const char * lldb::Encoding encoding = Type::GetEncoding (GetOpaqueClangQualType(), count); char *end = NULL; - size_t byte_size = GetByteSize(); + const size_t byte_size = GetByteSize(); switch (encoding) { case eEncodingInvalid: @@ -580,7 +580,6 @@ ValueObject::SetValueFromCString (ExecutionContextScope *exe_scope, const char * case eEncodingIEEE754: { - const size_t byte_size = GetByteSize(); const off_t byte_offset = GetByteOffset(); uint8_t *dst = const_cast<uint8_t *>(m_data.PeekData(byte_offset, byte_size)); if (dst != NULL) diff --git a/lldb/source/Expression/ClangExpression.cpp b/lldb/source/Expression/ClangExpression.cpp index 14033662650..e996749de9e 100644 --- a/lldb/source/Expression/ClangExpression.cpp +++ b/lldb/source/Expression/ClangExpression.cpp @@ -583,15 +583,15 @@ ClangExpression::WriteJITCode (const ExecutionContext &exc_context) // For now I only write functions with no stubs, globals, exception tables, // etc. So I only need to write the functions. - size_t size = 0; + size_t alloc_size = 0; std::map<uint8_t *, uint8_t *>::iterator fun_pos, fun_end = m_jit_mm_ptr->m_functions.end(); for (fun_pos = m_jit_mm_ptr->m_functions.begin(); fun_pos != fun_end; fun_pos++) { - size += (*fun_pos).second - (*fun_pos).first; + alloc_size += (*fun_pos).second - (*fun_pos).first; } Error error; - lldb::addr_t target_addr = exc_context.process->AllocateMemory (size, lldb::ePermissionsReadable|lldb::ePermissionsExecutable, error); + lldb::addr_t target_addr = exc_context.process->AllocateMemory (alloc_size, lldb::ePermissionsReadable|lldb::ePermissionsExecutable, error); if (target_addr == LLDB_INVALID_ADDRESS) return false; diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp index 3b775e5cb36..a7bbff7b52f 100644 --- a/lldb/source/Expression/ClangFunction.cpp +++ b/lldb/source/Expression/ClangFunction.cpp @@ -552,7 +552,7 @@ ClangFunction::ExecuteFunction( { timeout_ptr = NULL; - lldb::StateType stop_state = process->WaitForStateChangedEvents (timeout_ptr, event_sp); + stop_state = process->WaitForStateChangedEvents (timeout_ptr, event_sp); if (stop_state == lldb::eStateInvalid) { errors.Printf ("Got an invalid stop state after halt."); diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp index 78c1003e575..4d358163721 100644 --- a/lldb/source/Interpreter/Args.cpp +++ b/lldb/source/Interpreter/Args.cpp @@ -454,7 +454,6 @@ Error Args::ParseOptions (Options &options) { StreamString sstr; - int i; Error error; struct option *long_options = options.GetLongOptions(); if (long_options == NULL) @@ -463,7 +462,7 @@ Args::ParseOptions (Options &options) return error; } - for (i=0; long_options[i].name != NULL; ++i) + for (int i=0; long_options[i].name != NULL; ++i) { if (long_options[i].flag == NULL) { @@ -950,7 +949,6 @@ Args::ParseArgsForCompletion ) { StreamString sstr; - int i; struct option *long_options = options.GetLongOptions(); option_element_vector.clear(); @@ -963,7 +961,7 @@ Args::ParseArgsForCompletion // to suppress error messages. sstr << ":"; - for (i = 0; long_options[i].name != NULL; ++i) + for (int i = 0; long_options[i].name != NULL; ++i) { if (long_options[i].flag == NULL) { diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index 28f29225793..90eb66c1a55 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -570,9 +570,9 @@ Options::HandleOptionCompletion // within the option group they belong to. char opt_str[3] = {'-', 'a', '\0'}; - for (int i = 0 ; opt_defs[i].short_option != 0 ; i++) + for (int j = 0 ; opt_defs[j].short_option != 0 ; j++) { - opt_str[1] = opt_defs[i].short_option; + opt_str[1] = opt_defs[j].short_option; matches.AppendString (opt_str); } return true; @@ -580,10 +580,10 @@ Options::HandleOptionCompletion else if (opt_defs_index == OptionArgElement::eBareDoubleDash) { std::string full_name ("--"); - for (int i = 0 ; opt_defs[i].short_option != 0 ; i++) + for (int j = 0 ; opt_defs[j].short_option != 0 ; j++) { full_name.erase(full_name.begin() + 2, full_name.end()); - full_name.append (opt_defs[i].long_option); + full_name.append (opt_defs[j].long_option); matches.AppendString (full_name.c_str()); } return true; @@ -619,18 +619,18 @@ Options::HandleOptionCompletion if (cur_opt_str && strlen (cur_opt_str) > 2 && cur_opt_str[0] == '-' && cur_opt_str[1] == '-') { - for (int i = 0 ; opt_defs[i].short_option != 0 ; i++) + for (int j = 0 ; opt_defs[j].short_option != 0 ; j++) { - if (strstr(opt_defs[i].long_option, cur_opt_str + 2) == opt_defs[i].long_option) + if (strstr(opt_defs[j].long_option, cur_opt_str + 2) == opt_defs[j].long_option) { std::string full_name ("--"); - full_name.append (opt_defs[i].long_option); + full_name.append (opt_defs[j].long_option); // The options definitions table has duplicates because of the // way the grouping information is stored, so only add once. bool duplicate = false; - for (int j = 0; j < matches.GetSize(); j++) + for (int k = 0; k < matches.GetSize(); k++) { - if (matches.GetStringAtIndex(j) == full_name) + if (matches.GetStringAtIndex(k) == full_name) { duplicate = true; break; diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp index e5d7bc308be..9c5c086bfa3 100644 --- a/lldb/source/Interpreter/ScriptInterpreter.cpp +++ b/lldb/source/Interpreter/ScriptInterpreter.cpp @@ -54,6 +54,7 @@ ScriptInterpreter::GetMasterFileDescriptor () void ScriptInterpreter::CollectDataForBreakpointCommandCallback ( + CommandInterpreter &interpreter, BreakpointOptions *bp_options, CommandReturnObject &result ) diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index 3166887aaf2..a8489dae8fb 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -505,7 +505,6 @@ DynamicLoaderMacOSXDYLD::UpdateAllImageInfos() { Mutex::Locker locker(m_mutex); uint32_t idx; - Error error; uint32_t i = 0; DYLDImageInfo::collection old_dyld_all_image_infos; old_dyld_all_image_infos.swap(m_dyld_image_infos); diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp index 169dc89c791..a1126488e19 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp @@ -245,7 +245,7 @@ ObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool stop_oth StreamString errors; { // Scope for mutex locker: - Mutex::Locker (m_impl_function_mutex); + Mutex::Locker locker(m_impl_function_mutex); if (!m_impl_function.get()) { m_impl_function.reset(new ClangFunction(process->GetTargetTriple().GetCString(), @@ -257,7 +257,6 @@ ObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool stop_oth unsigned num_errors = m_impl_function->CompileFunction(errors); if (num_errors) { - Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP); if (log) log->Printf ("Error compiling function: \"%s\".", errors.GetData()); return ret_plan_sp; @@ -266,7 +265,6 @@ ObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool stop_oth errors.Clear(); if (!m_impl_function->WriteFunctionWrapper(exec_ctx, errors)) { - Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP); if (log) log->Printf ("Error Inserting function: \"%s\".", errors.GetData()); return ret_plan_sp; diff --git a/lldb/source/Plugins/Process/Utility/libunwind/src/UnwindCursor.hpp b/lldb/source/Plugins/Process/Utility/libunwind/src/UnwindCursor.hpp index d7df99b64d7..1f3f00bb79c 100644 --- a/lldb/source/Plugins/Process/Utility/libunwind/src/UnwindCursor.hpp +++ b/lldb/source/Plugins/Process/Utility/libunwind/src/UnwindCursor.hpp @@ -551,12 +551,12 @@ bool UnwindCursor<A,R>::getInfoFromCompactEncodingSection(pint_t pc, pint_t mh, const UnwindSectionIndexArray<A> topIndex(fAddressSpace, unwindSectionStart + sectionHeader.indexSectionOffset()); uint32_t low = 0; uint32_t high = sectionHeader.indexCount(); - const uint32_t last = high - 1; + const uint32_t last_section_header = high - 1; while ( low < high ) { uint32_t mid = (low + high)/2; //if ( log ) fprintf(stderr, "\tmid=%d, low=%d, high=%d, *mid=0x%08X\n", mid, low, high, topIndex.functionOffset(mid)); if ( topIndex.functionOffset(mid) <= targetFunctionOffset ) { - if ( (mid == last) || (topIndex.functionOffset(mid+1) > targetFunctionOffset) ) { + if ( (mid == last_section_header) || (topIndex.functionOffset(mid+1) > targetFunctionOffset) ) { low = mid; break; } @@ -589,8 +589,8 @@ bool UnwindCursor<A,R>::getInfoFromCompactEncodingSection(pint_t pc, pint_t mh, // binary search looks for entry with e where index[e].offset <= pc < index[e+1].offset if ( log ) fprintf(stderr, "\tbinary search for targetFunctionOffset=0x%08llX in regular page starting at secondLevelAddr=0x%llX\n", (uint64_t)targetFunctionOffset, (uint64_t)secondLevelAddr); - uint32_t low = 0; - uint32_t high = pageHeader.entryCount(); + low = 0; + high = pageHeader.entryCount(); while ( low < high ) { uint32_t mid = (low + high)/2; if ( pageIndex.functionOffset(mid) <= targetFunctionOffset ) { @@ -632,13 +632,13 @@ bool UnwindCursor<A,R>::getInfoFromCompactEncodingSection(pint_t pc, pint_t mh, const uint32_t targetFunctionPageOffset = targetFunctionOffset - firstLevelFunctionOffset; // binary search looks for entry with e where index[e].offset <= pc < index[e+1].offset if ( log ) fprintf(stderr, "\tbinary search of compressed page starting at secondLevelAddr=0x%llX\n", (uint64_t)secondLevelAddr); - uint32_t low = 0; - const uint32_t last = pageHeader.entryCount() - 1; - uint32_t high = pageHeader.entryCount(); + low = 0; + const uint32_t last_page_header = pageHeader.entryCount() - 1; + high = pageHeader.entryCount(); while ( low < high ) { uint32_t mid = (low + high)/2; if ( pageIndex.functionOffset(mid) <= targetFunctionPageOffset ) { - if ( (mid == last) || (pageIndex.functionOffset(mid+1) > targetFunctionPageOffset) ) { + if ( (mid == last_page_header) || (pageIndex.functionOffset(mid+1) > targetFunctionPageOffset) ) { low = mid; break; } @@ -651,7 +651,7 @@ bool UnwindCursor<A,R>::getInfoFromCompactEncodingSection(pint_t pc, pint_t mh, } } funcStart = pageIndex.functionOffset(low) + firstLevelFunctionOffset + mh; - if ( low < last ) + if ( low < last_page_header ) funcEnd = pageIndex.functionOffset(low+1) + firstLevelFunctionOffset + mh; else funcEnd = firstLevelNextPageFunctionOffset + mh; @@ -683,8 +683,8 @@ bool UnwindCursor<A,R>::getInfoFromCompactEncodingSection(pint_t pc, pint_t mh, if ( encoding & UNWIND_HAS_LSDA ) { UnwindSectionLsdaArray<A> lsdaIndex(fAddressSpace, lsdaArrayStartAddr); uint32_t funcStartOffset = funcStart - mh; - uint32_t low = 0; - uint32_t high = (lsdaArrayEndAddr-lsdaArrayStartAddr)/sizeof(unwind_info_section_header_lsda_index_entry); + low = 0; + high = (lsdaArrayEndAddr-lsdaArrayStartAddr)/sizeof(unwind_info_section_header_lsda_index_entry); // binary search looks for entry with exact match for functionOffset if ( log ) fprintf(stderr, "\tbinary search of lsda table for targetFunctionOffset=0x%08X\n", funcStartOffset); while ( low < high ) { @@ -904,6 +904,9 @@ template <typename A, typename R> class RemoteUnwindCursor : UnwindCursor<A,R> { public: + using UnwindCursor<A,R>::getReg; + using UnwindCursor<A,R>::getFloatReg; + typedef typename A::pint_t pint_t; RemoteUnwindCursor(A& as, unw_context_t* regs, void* arg); virtual bool validReg(int); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index 65bf64fc06b..e5a55ca2bc7 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -25,8 +25,8 @@ using namespace std; extern int g_verbose; -DWARFCompileUnit::DWARFCompileUnit(SymbolFileDWARF* m_dwarf2Data) : - m_dwarf2Data ( m_dwarf2Data ), +DWARFCompileUnit::DWARFCompileUnit(SymbolFileDWARF* dwarf2Data) : + m_dwarf2Data ( dwarf2Data ), m_offset ( DW_INVALID_OFFSET ), m_length ( 0 ), m_version ( 0 ), @@ -603,8 +603,6 @@ DWARFCompileUnit::Index if (num_attributes > 0) { uint32_t i; - - dw_tag_t tag = die.Tag(); is_variable = tag == DW_TAG_variable; @@ -733,8 +731,8 @@ DWARFCompileUnit::Index bool is_method = false; if (parent) { - dw_tag_t tag = parent->Tag(); - if (tag == DW_TAG_class_type || tag == DW_TAG_structure_type) + dw_tag_t parent_tag = parent->Tag(); + if (parent_tag == DW_TAG_class_type || parent_tag == DW_TAG_structure_type) { is_method = true; } @@ -748,9 +746,9 @@ DWARFCompileUnit::Index parent = specification_die->GetParent(); if (parent) { - tag = parent->Tag(); + parent_tag = parent->Tag(); - if (tag == DW_TAG_class_type || tag == DW_TAG_structure_type) + if (parent_tag == DW_TAG_class_type || parent_tag == DW_TAG_structure_type) is_method = true; } } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 02e6785c238..a0fe0e2a0ec 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -3192,7 +3192,7 @@ SymbolFileDWARF::ParseType(const SymbolContext& sc, const DWARFCompileUnit* dwar void *pointee_clang_type = pointee_type->GetOpaqueClangQualType(); void *class_clang_type = class_type->GetOpaqueClangQualType(); - void *clang_type = type_list->GetClangASTContext().CreateMemberPointerType(pointee_clang_type, class_clang_type); + clang_type = type_list->GetClangASTContext().CreateMemberPointerType(pointee_clang_type, class_clang_type); size_t byte_size = ClangASTContext::GetTypeBitSize(type_list->GetClangASTContext().getASTContext(), clang_type) / 8; diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 6bb91ea6068..153ae818165 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -1493,7 +1493,6 @@ ClangASTContext::GetIndexOfChildMemberWithName decl_name.getAsOpaquePtr(), paths)) { - uint32_t child_idx; CXXBasePaths::const_paths_iterator path, path_end = paths.end(); for (path = paths.begin(); path != path_end; ++path) { diff --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp b/lldb/source/Symbol/DWARFCallFrameInfo.cpp index 0b37aba8433..4b6d19f1524 100644 --- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp +++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp @@ -664,8 +664,7 @@ DWARFCallFrameInfo::Index () while (m_cfi_data.ValidOffsetForDataOfSize(offset, 8)) { const dw_offset_t curr_offset = offset; - const uint32_t length = m_cfi_data.GetU32(&offset); - const dw_offset_t next_offset = offset + length; + const dw_offset_t next_offset = offset + m_cfi_data.GetU32(&offset); const dw_offset_t cie_id = m_cfi_data.GetU32(&offset); bool is_fde = for_eh_frame ? cie_id != 0 : cie_id != UINT32_MAX; diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp index a66e12a9c1a..41336a703d8 100644 --- a/lldb/source/Symbol/Type.cpp +++ b/lldb/source/Symbol/Type.cpp @@ -399,7 +399,7 @@ lldb_private::Type::DumpSummary else buf.resize (256); - lldb_private::DataExtractor data(buf.data(), buf.size(), exe_ctx->process->GetByteOrder(), 4); + lldb_private::DataExtractor cstr_data(buf.data(), buf.size(), exe_ctx->process->GetByteOrder(), 4); buf.back() = '\0'; size_t bytes_read; size_t total_cstr_len = 0; @@ -411,7 +411,7 @@ lldb_private::Type::DumpSummary break; if (total_cstr_len == 0) s->PutCString (" \""); - data.Dump(s, 0, lldb::eFormatChar, 1, len, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0); + cstr_data.Dump(s, 0, lldb::eFormatChar, 1, len, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0); total_cstr_len += len; if (len < buf.size()) break; diff --git a/lldb/source/Target/ThreadList.cpp b/lldb/source/Target/ThreadList.cpp index 8255c5df3b6..bd112f64fcc 100644 --- a/lldb/source/Target/ThreadList.cpp +++ b/lldb/source/Target/ThreadList.cpp @@ -45,7 +45,7 @@ ThreadList::operator = (const ThreadList& rhs) { // Lock both mutexes to make sure neither side changes anyone on us // while the assignement occurs - Mutex::Locker locker_this(m_threads_mutex); + Mutex::Locker locker_lhs(m_threads_mutex); Mutex::Locker locker_rhs(rhs.m_threads_mutex); m_process = rhs.m_process; m_stop_id = rhs.m_stop_id; diff --git a/lldb/source/Target/ThreadPlan.cpp b/lldb/source/Target/ThreadPlan.cpp index 3e1a9fda050..5447778a42e 100644 --- a/lldb/source/Target/ThreadPlan.cpp +++ b/lldb/source/Target/ThreadPlan.cpp @@ -66,21 +66,21 @@ ThreadPlan::GetThread() const bool ThreadPlan::IsPlanComplete () { - Mutex::Locker (m_plan_complete_mutex); + Mutex::Locker locker(m_plan_complete_mutex); return m_plan_complete; } void ThreadPlan::SetPlanComplete () { - Mutex::Locker (m_plan_complete_mutex); + Mutex::Locker locker(m_plan_complete_mutex); m_plan_complete = true; } bool ThreadPlan::MischiefManaged () { - Mutex::Locker (m_plan_complete_mutex); + Mutex::Locker locker(m_plan_complete_mutex); m_plan_complete = true; return true; } diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp index 49676ef719a..552fbae90e5 100644 --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -1220,7 +1220,7 @@ Driver::MainLoop () if (!iochannel_thread_exited) { - SBEvent event; + event.Clear(); listener.GetNextEventForBroadcasterWithType (*m_io_channel_ap, IOChannel::eBroadcastBitThreadDidExit, event); diff --git a/lldb/tools/driver/IOChannel.cpp b/lldb/tools/driver/IOChannel.cpp index 06d1004584a..a087ab8c656 100644 --- a/lldb/tools/driver/IOChannel.cpp +++ b/lldb/tools/driver/IOChannel.cpp @@ -101,7 +101,7 @@ IOChannel::HandleCompletion (EditLine *e, int ch) { for (int i = 1; i < num_elements; i++) { - const char *completion_str = completions.GetStringAtIndex(i); + completion_str = completions.GetStringAtIndex(i); OutWrite("\n\t", 2); OutWrite(completion_str, strlen (completion_str)); } @@ -119,7 +119,7 @@ IOChannel::HandleCompletion (EditLine *e, int ch) endpoint = num_elements; for (; cur_pos < endpoint; cur_pos++) { - const char *completion_str = completions.GetStringAtIndex(cur_pos); + completion_str = completions.GetStringAtIndex(cur_pos); OutWrite("\n\t", 2); OutWrite(completion_str, strlen (completion_str)); } |