From 1a65ae11bd65d007391473f8bde3d06f4abad740 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 25 Jan 2011 23:55:37 +0000 Subject: [PATCH] Enabled extra warnings and fixed a bunch of small issues. llvm-svn: 124250 --- lldb/include/lldb/Breakpoint/BreakpointList.h | 2 +- .../lldb/Breakpoint/BreakpointLocationList.h | 1 + lldb/include/lldb/Core/DataExtractor.h | 4 +- lldb/include/lldb/Core/Module.h | 1 + lldb/include/lldb/Core/PluginInterface.h | 2 + lldb/include/lldb/Core/StreamFile.h | 3 + lldb/include/lldb/Core/Value.h | 15 +- .../lldb/Expression/ASTResultSynthesizer.h | 2 +- .../lldb/Expression/ASTStructExtractor.h | 2 +- lldb/include/lldb/Expression/ClangASTSource.h | 2 +- .../lldb/Expression/ClangExpressionDeclMap.h | 6 +- .../lldb/Expression/ClangExpressionVariable.h | 7 +- .../include/lldb/Expression/DWARFExpression.h | 9 +- lldb/include/lldb/Symbol/ClangASTContext.h | 2 +- lldb/include/lldb/Symbol/ClangASTType.h | 6 +- lldb/include/lldb/Symbol/Symbol.h | 2 +- lldb/include/lldb/Symbol/SymbolContextScope.h | 3 + lldb/include/lldb/Symbol/TaggedASTType.h | 2 +- lldb/include/lldb/Symbol/Type.h | 13 +- lldb/include/lldb/Symbol/UnwindTable.h | 2 + .../lldb/Target/ExecutionContextScope.h | 3 + lldb/include/lldb/Utility/SharingPtr.h | 7 +- lldb/lldb.xcodeproj/project.pbxproj | 21 +++ lldb/source/Commands/CommandObjectFrame.cpp | 2 +- lldb/source/Core/DataExtractor.cpp | 2 +- lldb/source/Core/Value.cpp | 36 +++-- lldb/source/Core/ValueObjectVariable.cpp | 2 +- .../Expression/ClangExpressionDeclMap.cpp | 12 +- lldb/source/Expression/DWARFExpression.cpp | 37 ++--- lldb/source/Expression/IRDynamicChecks.cpp | 18 ++- .../Interpreter/ScriptInterpreterPython.cpp | 1 - .../AppleObjCTrampolineHandler.cpp | 10 +- .../ObjectFile/Mach-O/ObjectFileMachO.cpp | 4 +- .../source/MacOSX/MachThreadContext_arm.cpp | 2 +- .../MacOSX-User/source/ProcessMacOSXLog.cpp | 5 +- .../Process/Utility/RegisterContextLLDB.cpp | 2 +- .../Process/gdb-remote/ProcessGDBRemote.cpp | 10 +- .../gdb-remote/ProcessGDBRemoteLog.cpp | 5 +- .../SymbolFile/DWARF/DWARFCompileUnit.cpp | 6 +- .../SymbolFile/DWARF/SymbolFileDWARF.cpp | 14 +- lldb/source/Symbol/ClangASTContext.cpp | 2 +- lldb/source/Symbol/ClangASTType.cpp | 4 +- lldb/source/Symbol/Type.cpp | 131 +++++++++--------- lldb/source/Target/StackFrame.cpp | 21 +-- lldb/source/Target/Thread.cpp | 2 +- .../Target/ThreadPlanShouldStopHere.cpp | 2 +- .../debugserver.xcodeproj/project.pbxproj | 1 + 47 files changed, 264 insertions(+), 184 deletions(-) diff --git a/lldb/include/lldb/Breakpoint/BreakpointList.h b/lldb/include/lldb/Breakpoint/BreakpointList.h index bf3ce14d91a8..e5ccb8ed2574 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointList.h +++ b/lldb/include/lldb/Breakpoint/BreakpointList.h @@ -46,7 +46,7 @@ public: /// @result /// Returns breakpoint id. //------------------------------------------------------------------ - virtual lldb::break_id_t + lldb::break_id_t Add (lldb::BreakpointSP& bp_sp, bool notify); //------------------------------------------------------------------ diff --git a/lldb/include/lldb/Breakpoint/BreakpointLocationList.h b/lldb/include/lldb/Breakpoint/BreakpointLocationList.h index 183ce8c72067..5c870f9596dc 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointLocationList.h +++ b/lldb/include/lldb/Breakpoint/BreakpointLocationList.h @@ -38,6 +38,7 @@ class BreakpointLocationList friend class Breakpoint; public: + virtual ~BreakpointLocationList(); //------------------------------------------------------------------ diff --git a/lldb/include/lldb/Core/DataExtractor.h b/lldb/include/lldb/Core/DataExtractor.h index ae5849dfdc1c..64c1d6fc6766 100644 --- a/lldb/include/lldb/Core/DataExtractor.h +++ b/lldb/include/lldb/Core/DataExtractor.h @@ -720,10 +720,10 @@ public: GetU8 ( uint32_t *offset_ptr) const; uint8_t - GetU8_unchecked ( uint32_t *offset_ptr) const + GetU8_unchecked (uint32_t *offset_ptr) const { uint8_t val = m_start[*offset_ptr]; - *offset_ptr += sizeof(val); + *offset_ptr += 1; return val; } diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h index 9f3c75479292..0889b094ed3e 100644 --- a/lldb/include/lldb/Core/Module.h +++ b/lldb/include/lldb/Core/Module.h @@ -82,6 +82,7 @@ public: //------------------------------------------------------------------ /// Destructor. //------------------------------------------------------------------ + virtual ~Module (); //------------------------------------------------------------------ diff --git a/lldb/include/lldb/Core/PluginInterface.h b/lldb/include/lldb/Core/PluginInterface.h index 2c2823501fc7..e2466f3978ac 100644 --- a/lldb/include/lldb/Core/PluginInterface.h +++ b/lldb/include/lldb/Core/PluginInterface.h @@ -21,6 +21,8 @@ namespace lldb_private { class PluginInterface { public: + virtual + ~PluginInterface () {} virtual const char * GetPluginName() = 0; diff --git a/lldb/include/lldb/Core/StreamFile.h b/lldb/include/lldb/Core/StreamFile.h index cbbeec1fbbc0..13f889a8d723 100644 --- a/lldb/include/lldb/Core/StreamFile.h +++ b/lldb/include/lldb/Core/StreamFile.h @@ -72,6 +72,9 @@ protected: FILE* m_file; ///< File handle to dump to. bool m_close_file; std::string m_path_name; + +private: + DISALLOW_COPY_AND_ASSIGN (StreamFile); }; } // namespace lldb_private diff --git a/lldb/include/lldb/Core/Value.h b/lldb/include/lldb/Core/Value.h index dfb1da249d80..49b594906a59 100644 --- a/lldb/include/lldb/Core/Value.h +++ b/lldb/include/lldb/Core/Value.h @@ -63,8 +63,11 @@ public: Value(double v); Value(long double v); Value(const uint8_t *bytes, int len); - Value(const Value &v); + Value(const Value &rhs); + Value & + operator=(const Value &rhs); + Value * CreateProxy(); @@ -145,10 +148,16 @@ protected: class ValueList { public: - ValueList () {} + ValueList () : + m_values() + { + } + ValueList (const ValueList &rhs); - ~ValueList () {} + ~ValueList () + { + } const ValueList & operator= (const ValueList &rhs); diff --git a/lldb/include/lldb/Expression/ASTResultSynthesizer.h b/lldb/include/lldb/Expression/ASTResultSynthesizer.h index 9813812de403..6a1e32b00ca8 100644 --- a/lldb/include/lldb/Expression/ASTResultSynthesizer.h +++ b/lldb/include/lldb/Expression/ASTResultSynthesizer.h @@ -158,4 +158,4 @@ private: } -#endif \ No newline at end of file +#endif diff --git a/lldb/include/lldb/Expression/ASTStructExtractor.h b/lldb/include/lldb/Expression/ASTStructExtractor.h index 37f4d9cc4cfb..b4af65f1e68d 100644 --- a/lldb/include/lldb/Expression/ASTStructExtractor.h +++ b/lldb/include/lldb/Expression/ASTStructExtractor.h @@ -153,4 +153,4 @@ private: } -#endif \ No newline at end of file +#endif diff --git a/lldb/include/lldb/Expression/ClangASTSource.h b/lldb/include/lldb/Expression/ClangASTSource.h index 5e166dfd65b9..a840ad99a2ed 100644 --- a/lldb/include/lldb/Expression/ClangASTSource.h +++ b/lldb/include/lldb/Expression/ClangASTSource.h @@ -255,4 +255,4 @@ struct NameSearchContext { } -#endif \ No newline at end of file +#endif diff --git a/lldb/include/lldb/Expression/ClangExpressionDeclMap.h b/lldb/include/lldb/Expression/ClangExpressionDeclMap.h index 81051aac7342..cd5d28721e3e 100644 --- a/lldb/include/lldb/Expression/ClangExpressionDeclMap.h +++ b/lldb/include/lldb/Expression/ClangExpressionDeclMap.h @@ -469,7 +469,9 @@ private: //---------------------------------------------------------------------- /// The following values should not live beyond parsing //---------------------------------------------------------------------- - struct ParserVars { + class ParserVars + { + public: ParserVars() : m_exe_ctx(NULL), m_sym_ctx(), @@ -493,6 +495,8 @@ private: ClangPersistentVariables *m_persistent_vars; ///< The persistent variables for the process. bool m_enable_lookups; ///< Set to true during parsing if we have found the first "$__lldb" name. bool m_ignore_lookups; ///< True during an import when we should be ignoring type lookups. + private: + DISALLOW_COPY_AND_ASSIGN (ParserVars); }; std::auto_ptr m_parser_vars; diff --git a/lldb/include/lldb/Expression/ClangExpressionVariable.h b/lldb/include/lldb/Expression/ClangExpressionVariable.h index dcac93c00bcc..862b8bc5c090 100644 --- a/lldb/include/lldb/Expression/ClangExpressionVariable.h +++ b/lldb/include/lldb/Expression/ClangExpressionVariable.h @@ -89,7 +89,9 @@ public: //---------------------------------------------------------------------- /// The following values should not live beyond parsing //---------------------------------------------------------------------- - struct ParserVars { + class ParserVars + { + public: ParserVars() : m_parser_type(), @@ -103,6 +105,9 @@ public: const clang::NamedDecl *m_named_decl; ///< The Decl corresponding to this variable llvm::Value *m_llvm_value; ///< The IR value corresponding to this variable; usually a GlobalValue lldb_private::Value *m_lldb_value; ///< The value found in LLDB for this variable + + private: + DISALLOW_COPY_AND_ASSIGN (ParserVars); }; //---------------------------------------------------------------------- /// Make this variable usable by the parser by allocating space for diff --git a/lldb/include/lldb/Expression/DWARFExpression.h b/lldb/include/lldb/Expression/DWARFExpression.h index 2624fa5546f8..60f278abba07 100644 --- a/lldb/include/lldb/Expression/DWARFExpression.h +++ b/lldb/include/lldb/Expression/DWARFExpression.h @@ -189,6 +189,8 @@ public: bool Evaluate (ExecutionContextScope *exe_scope, clang::ASTContext *ast_context, + ClangExpressionVariableList *expr_locals, + ClangExpressionDeclMap *decl_map, lldb::addr_t loclist_base_load_addr, const Value* initial_value_ptr, Value& result, @@ -201,6 +203,8 @@ public: bool Evaluate (ExecutionContext *exe_ctx, clang::ASTContext *ast_context, + ClangExpressionVariableList *expr_locals, + ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx, lldb::addr_t loclist_base_load_addr, const Value* initial_value_ptr, @@ -269,10 +273,10 @@ public: static bool Evaluate (ExecutionContext *exe_ctx, clang::ASTContext *ast_context, - const DataExtractor& opcodes, ClangExpressionVariableList *expr_locals, ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx, + const DataExtractor& opcodes, const uint32_t offset, const uint32_t length, const uint32_t reg_set, @@ -331,8 +335,7 @@ protected: lldb::addr_t m_loclist_slide; ///< A value used to slide the location list offsets so that ///< they are relative to the object that owns the location list ///< (the function for frame base and variable location lists) - ClangExpressionVariableList *m_expr_locals; ///< The locals used by this expression. See Evaluate() - ClangExpressionDeclMap *m_decl_map; ///< The external variables used by this expression. See Evaluate() + }; } // namespace lldb_private diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h index 9fd48d7e9c9a..b23f2b80f023 100644 --- a/lldb/include/lldb/Symbol/ClangASTContext.h +++ b/lldb/include/lldb/Symbol/ClangASTContext.h @@ -589,7 +589,7 @@ public: CreateMemberPointerType (lldb::clang_type_t clang_pointee_type, lldb::clang_type_t clang_class_type); - size_t + uint32_t GetPointerBitSize (); static bool diff --git a/lldb/include/lldb/Symbol/ClangASTType.h b/lldb/include/lldb/Symbol/ClangASTType.h index 9807bf333608..666a470d858f 100644 --- a/lldb/include/lldb/Symbol/ClangASTType.h +++ b/lldb/include/lldb/Symbol/ClangASTType.h @@ -46,7 +46,7 @@ protected: { } - ~ClangASTType(); + virtual ~ClangASTType(); const ClangASTType & operator= (const ClangASTType &atb) @@ -75,10 +75,10 @@ public: static ConstString GetClangTypeName (lldb::clang_type_t clang_type); - uint64_t + uint32_t GetClangTypeBitWidth (); - static uint64_t + static uint32_t GetClangTypeBitWidth (clang::ASTContext *ast_context, lldb::clang_type_t opaque_clang_qual_type); size_t diff --git a/lldb/include/lldb/Symbol/Symbol.h b/lldb/include/lldb/Symbol/Symbol.h index 8fcf350eca8a..d8e187e78473 100644 --- a/lldb/include/lldb/Symbol/Symbol.h +++ b/lldb/include/lldb/Symbol/Symbol.h @@ -93,7 +93,7 @@ public: uint32_t GetSiblingIndex () const; - uint32_t + lldb::addr_t GetByteSize () const { return m_addr_range.GetByteSize(); } lldb::SymbolType diff --git a/lldb/include/lldb/Symbol/SymbolContextScope.h b/lldb/include/lldb/Symbol/SymbolContextScope.h index 7394da27a97e..223618714eb3 100644 --- a/lldb/include/lldb/Symbol/SymbolContextScope.h +++ b/lldb/include/lldb/Symbol/SymbolContextScope.h @@ -71,6 +71,9 @@ namespace lldb_private { class SymbolContextScope { public: + virtual + ~SymbolContextScope () {} + //------------------------------------------------------------------ /// Reconstruct the object's symbolc context into \a sc. /// diff --git a/lldb/include/lldb/Symbol/TaggedASTType.h b/lldb/include/lldb/Symbol/TaggedASTType.h index 72efdb501f74..697f7777fe35 100644 --- a/lldb/include/lldb/Symbol/TaggedASTType.h +++ b/lldb/include/lldb/Symbol/TaggedASTType.h @@ -29,7 +29,7 @@ public: TaggedASTType () : ClangASTType() { } - ~TaggedASTType() { } + virtual ~TaggedASTType() { } TaggedASTType &operator= (const TaggedASTType &tw) { diff --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h index 1270d65b9587..5cfbf571020e 100644 --- a/lldb/include/lldb/Symbol/Type.h +++ b/lldb/include/lldb/Symbol/Type.h @@ -48,8 +48,8 @@ public: const ConstString &name, uint32_t byte_size, SymbolContextScope *context, - uintptr_t encoding_uid, - EncodingDataType encoding_type, + lldb::user_id_t encoding_uid, + EncodingDataType encoding_uid_type, const Declaration& decl, lldb::clang_type_t clang_qual_type, ResolveState clang_type_resolve_state); @@ -57,6 +57,8 @@ public: // This makes an invalid type. Used for functions that return a Type when they // get an error. Type(); + + Type (const Type &rhs); const Type& operator= (const Type& rhs); @@ -88,7 +90,7 @@ public: const ConstString& GetName(); - uint64_t + uint32_t GetByteSize(); uint32_t @@ -234,8 +236,8 @@ protected: SymbolFile *m_symbol_file; SymbolContextScope *m_context; // The symbol context in which this type is defined Type *m_encoding_type; - EncodingDataType m_encoding_uid_type; uint32_t m_encoding_uid; + EncodingDataType m_encoding_uid_type; uint32_t m_byte_size; Declaration m_decl; lldb::clang_type_t m_clang_type; @@ -244,7 +246,8 @@ protected: Type * GetEncodingType (); - bool ResolveClangType (ResolveState clang_type_resolve_state); + bool + ResolveClangType (ResolveState clang_type_resolve_state); }; } // namespace lldb_private diff --git a/lldb/include/lldb/Symbol/UnwindTable.h b/lldb/include/lldb/Symbol/UnwindTable.h index 993d94888f8a..57300a5354fe 100644 --- a/lldb/include/lldb/Symbol/UnwindTable.h +++ b/lldb/include/lldb/Symbol/UnwindTable.h @@ -51,6 +51,8 @@ private: UnwindAssemblyProfiler* m_assembly_profiler; DWARFCallFrameInfo* m_eh_frame; + + DISALLOW_COPY_AND_ASSIGN (UnwindTable); }; } // namespace lldb_private diff --git a/lldb/include/lldb/Target/ExecutionContextScope.h b/lldb/include/lldb/Target/ExecutionContextScope.h index d8e754923e3f..6e5815ff84c1 100644 --- a/lldb/include/lldb/Target/ExecutionContextScope.h +++ b/lldb/include/lldb/Target/ExecutionContextScope.h @@ -39,6 +39,9 @@ namespace lldb_private { class ExecutionContextScope { public: + virtual + ~ExecutionContextScope () {} + virtual Target * CalculateTarget () = 0; diff --git a/lldb/include/lldb/Utility/SharingPtr.h b/lldb/include/lldb/Utility/SharingPtr.h index a5d7f37cf700..c6fe77d2dbf9 100644 --- a/lldb/include/lldb/Utility/SharingPtr.h +++ b/lldb/include/lldb/Utility/SharingPtr.h @@ -48,6 +48,11 @@ public: private: virtual void on_zero_shared(); + + // Outlaw copy constructor and assignment operator to keep effictive C++ + // warnings down to a minumum + shared_ptr_pointer (const shared_ptr_pointer &); + shared_ptr_pointer & operator=(const shared_ptr_pointer &); }; template @@ -169,7 +174,7 @@ SharingPtr::SharingPtr() template template SharingPtr::SharingPtr(Y* p) - : ptr_(p) + : ptr_(p), cntrl_(0) { std::auto_ptr hold(p); typedef imp::shared_ptr_pointer _CntrlBlk; diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index f167c9c911a0..43269c707f71 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -2874,8 +2874,15 @@ __STDC_LIMIT_MACROS, LLDB_CONFIGURATION_DEBUG, ); + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; @@ -2897,8 +2904,15 @@ __STDC_LIMIT_MACROS, LLDB_CONFIGURATION_RELEASE, ); + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; PREBINDING = NO; VALID_ARCHS = "x86_64 i386"; @@ -3078,8 +3092,15 @@ __STDC_LIMIT_MACROS, LLDB_CONFIGURATION_BUILD_AND_INTEGRATION, ); + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MISSING_PARENTHESES = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; PREBINDING = NO; VALID_ARCHS = "x86_64 i386"; diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 3d9d819e6d8f..0d955b376912 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -629,7 +629,7 @@ public: { for (uint32_t i=0; iGetVariableAtIndex(i)); + var_sp = variable_list->GetVariableAtIndex(i); bool dump_variable = true; switch (var_sp->GetScope()) diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp index e6c8a4dcd0da..2c8054174326 100644 --- a/lldb/source/Core/DataExtractor.cpp +++ b/lldb/source/Core/DataExtractor.cpp @@ -1253,7 +1253,7 @@ DataExtractor::Dump // earlier C++ libraries std::string binary_value(64, '0'); std::bitset<64> bits(uval64); - for (size_t i = 0; i < 64; ++i) + for (i = 0; i < 64; ++i) if (bits[i]) binary_value[64 - 1 - i] = '1'; if (item_bit_size > 0) diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp index ce6a95b78e2d..41483c7c7ccf 100644 --- a/lldb/source/Core/Value.cpp +++ b/lldb/source/Core/Value.cpp @@ -142,6 +142,26 @@ Value::Value(const Value &v) : } } +Value & +Value::operator=(const Value &rhs) +{ + if (this != &rhs) + { + m_value = rhs.m_value; + m_value_type = rhs.m_value_type; + m_context = rhs.m_context; + m_context_type = rhs.m_context_type; + if ((uintptr_t)rhs.m_value.ULongLong(LLDB_INVALID_ADDRESS) == (uintptr_t)rhs.m_data_buffer.GetBytes()) + { + m_data_buffer.CopyData(rhs.m_data_buffer.GetBytes(), + rhs.m_data_buffer.GetByteSize()); + + m_value = (uintptr_t)m_data_buffer.GetBytes(); + } + } + return *this; +} + Value * Value::CreateProxy() { @@ -653,17 +673,17 @@ Value::ResolveValue(ExecutionContext *exe_ctx, clang::ASTContext *ast_context) { // Resolve the proxy - Value * v = (Value*)m_context; + Value * rhs = (Value*)m_context; - m_value = v->m_value; - m_value_type = v->m_value_type; - m_context = v->m_context; - m_context_type = v->m_context_type; + m_value = rhs->m_value; + m_value_type = rhs->m_value_type; + m_context = rhs->m_context; + m_context_type = rhs->m_context_type; - if ((uintptr_t)v->m_value.ULongLong(LLDB_INVALID_ADDRESS) == (uintptr_t)v->m_data_buffer.GetBytes()) + if ((uintptr_t)rhs->m_value.ULongLong(LLDB_INVALID_ADDRESS) == (uintptr_t)rhs->m_data_buffer.GetBytes()) { - m_data_buffer.CopyData(v->m_data_buffer.GetBytes(), - v->m_data_buffer.GetByteSize()); + m_data_buffer.CopyData(rhs->m_data_buffer.GetBytes(), + rhs->m_data_buffer.GetByteSize()); m_value = (uintptr_t)m_data_buffer.GetBytes(); } diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp index bcf4206476cd..f73ce64e5e3b 100644 --- a/lldb/source/Core/ValueObjectVariable.cpp +++ b/lldb/source/Core/ValueObjectVariable.cpp @@ -118,7 +118,7 @@ ValueObjectVariable::UpdateValue (ExecutionContextScope *exe_scope) loclist_base_load_addr = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (exe_ctx.target); } Value old_value(m_value); - if (expr.Evaluate (&exe_ctx, GetClangAST(), NULL, loclist_base_load_addr, NULL, m_value, &m_error)) + if (expr.Evaluate (&exe_ctx, GetClangAST(), NULL, NULL, NULL, loclist_base_load_addr, NULL, m_value, &m_error)) { m_value.SetContext(Value::eContextTypeVariable, variable); diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index f9962421c157..5c377cf14db6 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -1402,17 +1402,15 @@ ClangExpressionDeclMap::DoMaterializeOneRegister { uint32_t register_number = reg_info.kinds[lldb::eRegisterKindLLDB]; uint32_t register_byte_size = reg_info.byte_size; - - Error error; - + if (dematerialize) { DataBufferHeap register_data (register_byte_size, 0); - Error error; - if (exe_ctx.process->ReadMemory (addr, register_data.GetBytes(), register_byte_size, error) != register_byte_size) + Error read_error; + if (exe_ctx.process->ReadMemory (addr, register_data.GetBytes(), register_byte_size, read_error) != register_byte_size) { - err.SetErrorStringWithFormat ("Couldn't read %s from the target: %s", reg_info.name, error.AsCString()); + err.SetErrorStringWithFormat ("Couldn't read %s from the target: %s", reg_info.name, read_error.AsCString()); return false; } @@ -1801,7 +1799,7 @@ ClangExpressionDeclMap::GetVariableValue } Error err; - if (!var_location_expr.Evaluate(&exe_ctx, ast, NULL, loclist_base_load_addr, NULL, *var_location.get(), &err)) + if (!var_location_expr.Evaluate(&exe_ctx, ast, NULL, NULL, NULL, loclist_base_load_addr, NULL, *var_location.get(), &err)) { if (log) log->Printf("Error evaluating location: %s", err.AsCString()); diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp index 71145187bca7..1679c8d9df5e 100644 --- a/lldb/source/Expression/DWARFExpression.cpp +++ b/lldb/source/Expression/DWARFExpression.cpp @@ -217,18 +217,14 @@ DW_OP_value_to_name (uint32_t val) DWARFExpression::DWARFExpression() : m_data(), m_reg_kind (eRegisterKindDWARF), - m_loclist_slide (LLDB_INVALID_ADDRESS), - m_expr_locals (NULL), - m_decl_map (NULL) + m_loclist_slide (LLDB_INVALID_ADDRESS) { } DWARFExpression::DWARFExpression(const DWARFExpression& rhs) : m_data(rhs.m_data), m_reg_kind (rhs.m_reg_kind), - m_loclist_slide(rhs.m_loclist_slide), - m_expr_locals (rhs.m_expr_locals), - m_decl_map (rhs.m_decl_map) + m_loclist_slide(rhs.m_loclist_slide) { } @@ -236,9 +232,7 @@ DWARFExpression::DWARFExpression(const DWARFExpression& rhs) : DWARFExpression::DWARFExpression(const DataExtractor& data, uint32_t data_offset, uint32_t data_length) : m_data(data, data_offset, data_length), m_reg_kind (eRegisterKindDWARF), - m_loclist_slide(LLDB_INVALID_ADDRESS), - m_expr_locals (NULL), - m_decl_map (NULL) + m_loclist_slide(LLDB_INVALID_ADDRESS) { } @@ -256,19 +250,6 @@ DWARFExpression::IsValid() const return m_data.GetByteSize() > 0; } - -void -DWARFExpression::SetExpressionLocalVariableList (ClangExpressionVariableList *locals) -{ - m_expr_locals = locals; -} - -void -DWARFExpression::SetExpressionDeclMap (ClangExpressionDeclMap *decl_map) -{ - m_decl_map = decl_map; -} - void DWARFExpression::SetOpcodeData (const DataExtractor& data) { @@ -749,6 +730,8 @@ DWARFExpression::Evaluate ( ExecutionContextScope *exe_scope, clang::ASTContext *ast_context, + ClangExpressionVariableList *expr_locals, + ClangExpressionDeclMap *decl_map, lldb::addr_t loclist_base_load_addr, const Value* initial_value_ptr, Value& result, @@ -756,7 +739,7 @@ DWARFExpression::Evaluate ) const { ExecutionContext exe_ctx (exe_scope); - return Evaluate(&exe_ctx, ast_context, NULL, loclist_base_load_addr, initial_value_ptr, result, error_ptr); + return Evaluate(&exe_ctx, ast_context, expr_locals, decl_map, NULL, loclist_base_load_addr, initial_value_ptr, result, error_ptr); } bool @@ -764,6 +747,8 @@ DWARFExpression::Evaluate ( ExecutionContext *exe_ctx, clang::ASTContext *ast_context, + ClangExpressionVariableList *expr_locals, + ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx, lldb::addr_t loclist_base_load_addr, const Value* initial_value_ptr, @@ -809,7 +794,7 @@ DWARFExpression::Evaluate if (length > 0 && lo_pc <= pc && pc < hi_pc) { - return DWARFExpression::Evaluate (exe_ctx, ast_context, m_data, m_expr_locals, m_decl_map, reg_ctx, offset, length, m_reg_kind, initial_value_ptr, result, error_ptr); + return DWARFExpression::Evaluate (exe_ctx, ast_context, expr_locals, decl_map, reg_ctx, m_data, offset, length, m_reg_kind, initial_value_ptr, result, error_ptr); } offset += length; } @@ -821,7 +806,7 @@ DWARFExpression::Evaluate } // Not a location list, just a single expression. - return DWARFExpression::Evaluate (exe_ctx, ast_context, m_data, m_expr_locals, m_decl_map, reg_ctx, 0, m_data.GetByteSize(), m_reg_kind, initial_value_ptr, result, error_ptr); + return DWARFExpression::Evaluate (exe_ctx, ast_context, expr_locals, decl_map, reg_ctx, m_data, 0, m_data.GetByteSize(), m_reg_kind, initial_value_ptr, result, error_ptr); } @@ -831,10 +816,10 @@ DWARFExpression::Evaluate ( ExecutionContext *exe_ctx, clang::ASTContext *ast_context, - const DataExtractor& opcodes, ClangExpressionVariableList *expr_locals, ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx, + const DataExtractor& opcodes, const uint32_t opcodes_offset, const uint32_t opcodes_length, const uint32_t reg_kind, diff --git a/lldb/source/Expression/IRDynamicChecks.cpp b/lldb/source/Expression/IRDynamicChecks.cpp index a59ac644f845..e0284c70d5c8 100644 --- a/lldb/source/Expression/IRDynamicChecks.cpp +++ b/lldb/source/Expression/IRDynamicChecks.cpp @@ -127,6 +127,10 @@ public: { } + virtual~Instrumenter () + { + } + //------------------------------------------------------------------ /// Inspect a function to find instructions to instrument /// @@ -287,12 +291,16 @@ private: class ValidPointerChecker : public Instrumenter { public: - ValidPointerChecker(llvm::Module &module, - DynamicCheckerFunctions &checker_functions) : + ValidPointerChecker (llvm::Module &module, + DynamicCheckerFunctions &checker_functions) : Instrumenter(module, checker_functions), m_valid_pointer_check_func(NULL) { } + + virtual ~ValidPointerChecker () + { + } private: bool InstrumentInstruction(llvm::Instruction *inst) { @@ -356,6 +364,12 @@ public: m_objc_object_check_func(NULL) { } + + virtual + ~ObjcObjectChecker () + { + } + private: bool InstrumentInstruction(llvm::Instruction *inst) { diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index aafef87af290..224ea7f6d373 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -1293,7 +1293,6 @@ ScriptInterpreterPython::BreakpointCallbackFunction && python_function_name[0] != '\0') { Thread *thread = context->exe_ctx.thread; - Target *target = context->exe_ctx.target; const StackFrameSP stop_frame_sp = thread->GetStackFrameSPForStackFramePtr (context->exe_ctx.frame); BreakpointSP breakpoint_sp = target->GetBreakpointByID (break_id); const BreakpointLocationSP bp_loc_sp = breakpoint_sp->FindLocationByID (break_loc_id); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp index 9733a99bb5dc..25fc480b169b 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -344,11 +344,10 @@ AppleObjCTrampolineHandler::AppleObjCVTables::InitializeVTableSymbols () eSymbolTypeData); if (trampoline_symbol != NULL) { - const Address &temp_address = trampoline_symbol->GetValue(); - if (!temp_address.IsValid()) + if (!trampoline_symbol->GetValue().IsValid()) return false; - m_trampoline_header = temp_address.GetLoadAddress(&target); + m_trampoline_header = trampoline_symbol->GetValue().GetLoadAddress(&target); if (m_trampoline_header == LLDB_INVALID_ADDRESS) return false; @@ -358,11 +357,10 @@ AppleObjCTrampolineHandler::AppleObjCVTables::InitializeVTableSymbols () eSymbolTypeCode); if (changed_symbol != NULL) { - const Address &temp_address = changed_symbol->GetValue(); - if (!temp_address.IsValid()) + if (!changed_symbol->GetValue().IsValid()) return false; - lldb::addr_t changed_addr = temp_address.GetLoadAddress(&target); + lldb::addr_t changed_addr = changed_symbol->GetValue().GetLoadAddress(&target); if (changed_addr != LLDB_INVALID_ADDRESS) { BreakpointSP trampolines_changed_bp_sp = target.CreateBreakpoint (changed_addr, diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 7b045ab83957..1d8ff3be1e19 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -202,11 +202,11 @@ ObjectFileMachO::GetAddressByteSize () const Symtab * ObjectFileMachO::GetSymtab() { - lldb_private::Mutex::Locker locker(m_mutex); + lldb_private::Mutex::Locker symfile_locker(m_mutex); if (m_symtab_ap.get() == NULL) { m_symtab_ap.reset(new Symtab(this)); - Mutex::Locker locker (m_symtab_ap->GetMutex()); + Mutex::Locker symtab_locker (m_symtab_ap->GetMutex()); ParseSymtab (true); } return m_symtab_ap.get(); diff --git a/lldb/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp b/lldb/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp index 9b5847dff6c9..5ceedc0bb58e 100644 --- a/lldb/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp +++ b/lldb/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp @@ -133,7 +133,7 @@ MachThreadContext_arm::ShouldStop () void MachThreadContext_arm::RefreshStateAfterStop () { - EnableHardwareSingleStep (false) == KERN_SUCCESS; + EnableHardwareSingleStep (false); } #if defined (ENABLE_ARM_SINGLE_STEP) diff --git a/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp b/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp index f4c86c4684af..2289331333c6 100644 --- a/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp +++ b/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp @@ -89,12 +89,10 @@ ProcessMacOSXLog::EnableLog (StreamSP &log_stream_sp, uint32_t log_options, Args { // Try see if there already is a log - that way we can reuse its settings. // We could reuse the log in toto, but we don't know that the stream is the same. - uint32_t flag_bits; + uint32_t flag_bits = 0; LogSP log(GetLog ()); if (log) flag_bits = log->GetMask().Get(); - else - flag_bits = 0; // Now make a new log with this stream if one was provided if (log_stream_sp) @@ -105,7 +103,6 @@ ProcessMacOSXLog::EnableLog (StreamSP &log_stream_sp, uint32_t log_options, Args if (log) { - uint32_t flag_bits = 0; bool got_unknown_category = false; const size_t argc = args.GetArgumentCount(); for (size_t i=0; iSetName (thread_name.empty() ? thread_name.c_str() : NULL); if (exc_type != 0) { - const size_t exc_data_count = exc_data.size(); + const size_t exc_data_size = exc_data.size(); gdb_thread->SetStopInfo (StopInfoMachException::CreateStopReasonWithMachException (*thread_sp, exc_type, - exc_data_count, - exc_data_count >= 1 ? exc_data[0] : 0, - exc_data_count >= 2 ? exc_data[1] : 0)); + exc_data_size, + exc_data_size >= 1 ? exc_data[0] : 0, + exc_data_size >= 2 ? exc_data[1] : 0)); } else if (signo) { @@ -1230,7 +1230,7 @@ ProcessGDBRemote::InterruptIfRunning timeout_time.OffsetWithSeconds(5); StateType state = WaitForStateChangedEventsPrivate (&timeout_time, stop_event_sp); - const bool timed_out = state == eStateInvalid; + timed_out = state == eStateInvalid; if (log) log->Printf ("ProcessGDBRemote::InterruptIfRunning() catch stop event: state = %s, timed-out=%i", StateAsCString(state), timed_out); diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp index 044edd00705b..0c019bf72058 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp @@ -96,12 +96,10 @@ ProcessGDBRemoteLog::EnableLog (StreamSP &log_stream_sp, uint32_t log_options, A { // Try see if there already is a log - that way we can reuse its settings. // We could reuse the log in toto, but we don't know that the stream is the same. - uint32_t flag_bits; + uint32_t flag_bits = 0; LogSP log(GetLog ()); if (log) flag_bits = log->GetMask().Get(); - else - flag_bits = 0; // Now make a new log with this stream if one was provided if (log_stream_sp) @@ -112,7 +110,6 @@ ProcessGDBRemoteLog::EnableLog (StreamSP &log_stream_sp, uint32_t log_options, A if (log) { - uint32_t flag_bits = 0; bool got_unknown_category = false; const size_t argc = args.GetArgumentCount(); for (size_t i=0; i 0) { - uint32_t i; - is_variable = tag == DW_TAG_variable; - for (i=0; iAppendRange (m_offset, range->begin_offset, range->end_offset); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index d80edfbdaaac..f778f454fdae 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1272,10 +1272,10 @@ SymbolFileDWARF::ParseChildMembers uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart(); if (DWARFExpression::Evaluate (NULL, NULL, - debug_info_data, NULL, NULL, NULL, + debug_info_data, block_offset, block_length, eRegisterKindDWARF, @@ -2882,14 +2882,14 @@ SymbolFileDWARF::GetClangDeclContextForDIE (DWARFCompileUnit *curr_cu, const DWA // DIE and we want to try and find a type that has the complete definition. TypeSP SymbolFileDWARF::FindDefinitionTypeForDIE ( - DWARFCompileUnit* curr_cu, + DWARFCompileUnit* cu, const DWARFDebugInfoEntry *die, const ConstString &type_name ) { TypeSP type_sp; - if (curr_cu == NULL || die == NULL || !type_name) + if (cu == NULL || die == NULL || !type_name) return type_sp; if (!m_indexed) @@ -2901,7 +2901,7 @@ SymbolFileDWARF::FindDefinitionTypeForDIE ( if (num_matches > 0) { DWARFCompileUnit* type_cu = NULL; - DWARFCompileUnit* curr_cu = curr_cu; + DWARFCompileUnit* curr_cu = cu; DWARFDebugInfo *info = DebugInfo(); for (size_t i=0; iHasChildren()) { - SymbolContext sc(GetCompUnitForDWARFCompUnit(dwarf_cu)); - ParseChildEnumerators(sc, clang_type, type_sp->GetByteSize(), dwarf_cu, die); + SymbolContext cu_sc(GetCompUnitForDWARFCompUnit(dwarf_cu)); + ParseChildEnumerators(cu_sc, clang_type, type_sp->GetByteSize(), dwarf_cu, die); } ast.CompleteTagDeclarationDefinition (clang_type); #endif @@ -3396,7 +3396,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, uint32_t i; for (i=0; i"), m_symbol_file (NULL), @@ -71,29 +72,33 @@ lldb_private::Type::Type () : } -const lldb_private::Type& -lldb_private::Type::operator= (const Type& rhs) +Type::Type (const Type &rhs) : + UserID (rhs), + m_name (rhs.m_name), + m_symbol_file (rhs.m_symbol_file), + m_context (rhs.m_context), + m_encoding_type (rhs.m_encoding_type), + m_encoding_uid_type (rhs.m_encoding_uid_type), + m_encoding_uid (rhs.m_encoding_uid), + m_byte_size (rhs.m_byte_size), + m_decl (rhs.m_decl), + m_clang_type (rhs.m_clang_type), + m_clang_type_resolve_state (rhs.m_clang_type_resolve_state) +{ +} + +const Type& +Type::operator= (const Type& rhs) { if (this != &rhs) { - UserID::operator= (rhs); - m_name = rhs.m_name; - m_symbol_file = rhs.m_symbol_file; - m_context = rhs.m_context; - m_encoding_type = rhs.m_encoding_type; - m_encoding_uid_type = rhs.m_encoding_uid_type; - m_encoding_uid = rhs.m_encoding_uid; - m_byte_size = rhs.m_byte_size; - m_decl = rhs.m_decl; - m_clang_type = rhs.m_clang_type; - m_clang_type_resolve_state = rhs.m_clang_type_resolve_state; } return *this; } void -lldb_private::Type::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_name) +Type::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_name) { *s << "id = " << (const UserID&)*this; @@ -133,7 +138,7 @@ lldb_private::Type::GetDescription (Stream *s, lldb::DescriptionLevel level, boo void -lldb_private::Type::Dump (Stream *s, bool show_context) +Type::Dump (Stream *s, bool show_context) { s->Printf("%.*p: ", (int)sizeof(void*) * 2, this); s->Indent(); @@ -183,8 +188,8 @@ lldb_private::Type::Dump (Stream *s, bool show_context) s->EOL(); } -const lldb_private::ConstString & -lldb_private::Type::GetName() +const ConstString & +Type::GetName() { if (!(m_name)) { @@ -199,18 +204,18 @@ lldb_private::Type::GetName() } void -lldb_private::Type::DumpTypeName(Stream *s) +Type::DumpTypeName(Stream *s) { GetName().Dump(s, ""); } void -lldb_private::Type::DumpValue +Type::DumpValue ( - lldb_private::ExecutionContext *exe_ctx, - lldb_private::Stream *s, - const lldb_private::DataExtractor &data, + ExecutionContext *exe_ctx, + Stream *s, + const DataExtractor &data, uint32_t data_byte_offset, bool show_types, bool show_summary, @@ -229,7 +234,7 @@ lldb_private::Type::DumpValue s->PutCString(") "); } - lldb_private::ClangASTType::DumpValue (GetClangAST (), + ClangASTType::DumpValue (GetClangAST (), m_clang_type, exe_ctx, s, @@ -246,8 +251,8 @@ lldb_private::Type::DumpValue } } -lldb_private::Type * -lldb_private::Type::GetEncodingType () +Type * +Type::GetEncodingType () { if (m_encoding_type == NULL && m_encoding_uid != LLDB_INVALID_UID) m_encoding_type = m_symbol_file->ResolveTypeUID(m_encoding_uid); @@ -256,8 +261,8 @@ lldb_private::Type::GetEncodingType () -uint64_t -lldb_private::Type::GetByteSize() +uint32_t +Type::GetByteSize() { if (m_byte_size == 0) { @@ -274,7 +279,7 @@ lldb_private::Type::GetByteSize() m_byte_size = encoding_type->GetByteSize(); if (m_byte_size == 0) { - uint64_t bit_width = ClangASTType::GetClangTypeBitWidth (GetClangAST(), GetClangLayoutType()); + uint32_t bit_width = ClangASTType::GetClangTypeBitWidth (GetClangAST(), GetClangLayoutType()); m_byte_size = (bit_width + 7 ) / 8; } } @@ -293,7 +298,7 @@ lldb_private::Type::GetByteSize() uint32_t -lldb_private::Type::GetNumChildren (bool omit_empty_base_classes) +Type::GetNumChildren (bool omit_empty_base_classes) { if (ResolveClangType(eResolveStateForward)) { @@ -305,7 +310,7 @@ lldb_private::Type::GetNumChildren (bool omit_empty_base_classes) } bool -lldb_private::Type::IsAggregateType () +Type::IsAggregateType () { if (ResolveClangType(eResolveStateForward)) return ClangASTContext::IsAggregateType (m_clang_type); @@ -313,33 +318,33 @@ lldb_private::Type::IsAggregateType () } lldb::Format -lldb_private::Type::GetFormat () +Type::GetFormat () { // Make sure we resolve our type if it already hasn't been. if (!ResolveClangType(eResolveStateForward)) return lldb::eFormatInvalid; - return lldb_private::ClangASTType::GetFormat (m_clang_type); + return ClangASTType::GetFormat (m_clang_type); } lldb::Encoding -lldb_private::Type::GetEncoding (uint32_t &count) +Type::GetEncoding (uint32_t &count) { // Make sure we resolve our type if it already hasn't been. if (!ResolveClangType(eResolveStateForward)) return lldb::eEncodingInvalid; - return lldb_private::ClangASTType::GetEncoding (m_clang_type, count); + return ClangASTType::GetEncoding (m_clang_type, count); } bool -lldb_private::Type::DumpValueInMemory +Type::DumpValueInMemory ( - lldb_private::ExecutionContext *exe_ctx, - lldb_private::Stream *s, + ExecutionContext *exe_ctx, + Stream *s, lldb::addr_t address, lldb::AddressType address_type, bool show_types, @@ -349,7 +354,7 @@ lldb_private::Type::DumpValueInMemory { if (address != LLDB_INVALID_ADDRESS) { - lldb_private::DataExtractor data; + DataExtractor data; data.SetByteOrder (exe_ctx->process->GetByteOrder()); if (ReadFromMemory (exe_ctx, address, address_type, data)) { @@ -362,7 +367,7 @@ lldb_private::Type::DumpValueInMemory bool -lldb_private::Type::ReadFromMemory (lldb_private::ExecutionContext *exe_ctx, lldb::addr_t addr, lldb::AddressType address_type, lldb_private::DataExtractor &data) +Type::ReadFromMemory (ExecutionContext *exe_ctx, lldb::addr_t addr, lldb::AddressType address_type, DataExtractor &data) { if (address_type == lldb::eAddressTypeFile) { @@ -401,26 +406,26 @@ lldb_private::Type::ReadFromMemory (lldb_private::ExecutionContext *exe_ctx, lld bool -lldb_private::Type::WriteToMemory (lldb_private::ExecutionContext *exe_ctx, lldb::addr_t addr, lldb::AddressType address_type, lldb_private::DataExtractor &data) +Type::WriteToMemory (ExecutionContext *exe_ctx, lldb::addr_t addr, lldb::AddressType address_type, DataExtractor &data) { return false; } -lldb_private::TypeList* -lldb_private::Type::GetTypeList() +TypeList* +Type::GetTypeList() { return GetSymbolFile()->GetTypeList(); } -const lldb_private::Declaration & -lldb_private::Type::GetDeclaration () const +const Declaration & +Type::GetDeclaration () const { return m_decl; } bool -lldb_private::Type::ResolveClangType (ResolveState clang_type_resolve_state) +Type::ResolveClangType (ResolveState clang_type_resolve_state) { Type *encoding_type = NULL; if (m_clang_type == NULL) @@ -560,7 +565,7 @@ lldb_private::Type::ResolveClangType (ResolveState clang_type_resolve_state) return m_clang_type != NULL; } uint32_t -lldb_private::Type::GetEncodingMask () +Type::GetEncodingMask () { uint32_t encoding_mask = 1u << m_encoding_uid_type; Type *encoding_type = GetEncodingType(); @@ -571,40 +576,40 @@ lldb_private::Type::GetEncodingMask () } clang_type_t -lldb_private::Type::GetClangType () +Type::GetClangType () { ResolveClangType(eResolveStateFull); return m_clang_type; } clang_type_t -lldb_private::Type::GetClangLayoutType () +Type::GetClangLayoutType () { ResolveClangType(eResolveStateLayout); return m_clang_type; } clang_type_t -lldb_private::Type::GetClangForwardType () +Type::GetClangForwardType () { ResolveClangType (eResolveStateForward); return m_clang_type; } clang::ASTContext * -lldb_private::Type::GetClangAST () +Type::GetClangAST () { return GetClangASTContext().getASTContext(); } -lldb_private::ClangASTContext & -lldb_private::Type::GetClangASTContext () +ClangASTContext & +Type::GetClangASTContext () { return m_symbol_file->GetClangASTContext(); } int -lldb_private::Type::Compare(const Type &a, const Type &b) +Type::Compare(const Type &a, const Type &b) { // Just compare the UID values for now... lldb::user_id_t a_uid = a.GetID(); @@ -620,14 +625,14 @@ lldb_private::Type::Compare(const Type &a, const Type &b) void * -lldb_private::Type::CreateClangPointerType (lldb_private::Type *type) +Type::CreateClangPointerType (Type *type) { assert(type); return GetClangASTContext().CreatePointerType(type->GetClangForwardType()); } void * -lldb_private::Type::CreateClangTypedefType (lldb_private::Type *typedef_type, lldb_private::Type *base_type) +Type::CreateClangTypedefType (Type *typedef_type, Type *base_type) { assert(typedef_type && base_type); return GetClangASTContext().CreateTypedefType (typedef_type->GetName().AsCString(), @@ -636,14 +641,14 @@ lldb_private::Type::CreateClangTypedefType (lldb_private::Type *typedef_type, ll } void * -lldb_private::Type::CreateClangLValueReferenceType (lldb_private::Type *type) +Type::CreateClangLValueReferenceType (Type *type) { assert(type); return GetClangASTContext().CreateLValueReferenceType(type->GetClangForwardType()); } void * -lldb_private::Type::CreateClangRValueReferenceType (lldb_private::Type *type) +Type::CreateClangRValueReferenceType (Type *type) { assert(type); return GetClangASTContext().CreateRValueReferenceType (type->GetClangForwardType()); diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp index 633d394cf071..32917b7b85d4 100644 --- a/lldb/source/Target/StackFrame.cpp +++ b/lldb/source/Target/StackFrame.cpp @@ -48,9 +48,9 @@ StackFrame::StackFrame lldb::addr_t pc, const SymbolContext *sc_ptr ) : + m_thread (thread), m_frame_index (frame_idx), m_concrete_frame_index (unwind_frame_index), - m_thread (thread), m_reg_context_sp (), m_id (pc, cfa, NULL), m_frame_code_addr (NULL, pc), @@ -59,7 +59,8 @@ StackFrame::StackFrame m_frame_base (), m_frame_base_error (), m_variable_list_sp (), - m_variable_list_value_objects () + m_variable_list_value_objects (), + m_disassembly () { if (sc_ptr != NULL) { @@ -78,9 +79,9 @@ StackFrame::StackFrame lldb::addr_t pc, const SymbolContext *sc_ptr ) : + m_thread (thread), m_frame_index (frame_idx), m_concrete_frame_index (unwind_frame_index), - m_thread (thread), m_reg_context_sp (reg_context_sp), m_id (pc, cfa, NULL), m_frame_code_addr (NULL, pc), @@ -89,7 +90,8 @@ StackFrame::StackFrame m_frame_base (), m_frame_base_error (), m_variable_list_sp (), - m_variable_list_value_objects () + m_variable_list_value_objects (), + m_disassembly () { if (sc_ptr != NULL) { @@ -114,9 +116,9 @@ StackFrame::StackFrame const Address& pc_addr, const SymbolContext *sc_ptr ) : + m_thread (thread), m_frame_index (frame_idx), m_concrete_frame_index (unwind_frame_index), - m_thread (thread), m_reg_context_sp (reg_context_sp), m_id (pc_addr.GetLoadAddress (&thread.GetProcess().GetTarget()), cfa, NULL), m_frame_code_addr (pc_addr), @@ -125,7 +127,8 @@ StackFrame::StackFrame m_frame_base (), m_frame_base_error (), m_variable_list_sp (), - m_variable_list_value_objects () + m_variable_list_value_objects (), + m_disassembly () { if (sc_ptr != NULL) { @@ -626,7 +629,7 @@ StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, uint32 if (var_path.size() > 2) // Need at least two brackets and a number { char *end = NULL; - int32_t child_index = ::strtol (&var_path[1], &end, 0); + long child_index = ::strtol (&var_path[1], &end, 0); if (end && *end == ']') { @@ -745,7 +748,7 @@ StackFrame::GetFrameBaseValue (Scalar &frame_base, Error *error_ptr) if (m_sc.function->GetFrameBaseExpression().IsLocationList()) loclist_base_addr = m_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (&m_thread.GetProcess().GetTarget()); - if (m_sc.function->GetFrameBaseExpression().Evaluate(&exe_ctx, NULL, NULL, loclist_base_addr, NULL, expr_value, &m_frame_base_error) == false) + if (m_sc.function->GetFrameBaseExpression().Evaluate(&exe_ctx, NULL, NULL, NULL, NULL, loclist_base_addr, NULL, expr_value, &m_frame_base_error) == false) { // We should really have an error if evaluate returns, but in case // we don't, lets set the error to something at least. @@ -963,4 +966,4 @@ lldb::StackFrameSP StackFrame::GetSP () { return m_thread.GetStackFrameSPForStackFramePtr (this); -} \ No newline at end of file +} diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 2dca598a52aa..31293171ea39 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -844,7 +844,7 @@ Thread::DumpThreadPlans (lldb_private::Stream *s) const stack_size = m_discarded_plan_stack.size(); s->Printf ("Discarded Plan Stack: %d elements.\n", stack_size); - for (int i = stack_size - 1; i >= 0; i--) + for (i = stack_size - 1; i >= 0; i--) { s->Printf ("Element %d: ", i); s->IndentMore(); diff --git a/lldb/source/Target/ThreadPlanShouldStopHere.cpp b/lldb/source/Target/ThreadPlanShouldStopHere.cpp index 493ab63bc333..a297dd84d57a 100644 --- a/lldb/source/Target/ThreadPlanShouldStopHere.cpp +++ b/lldb/source/Target/ThreadPlanShouldStopHere.cpp @@ -50,4 +50,4 @@ ThreadPlanShouldStopHere::InvokeShouldStopHereCallback () return m_callback (m_owner, m_flags, m_baton); else return NULL; -} \ No newline at end of file +} diff --git a/lldb/tools/debugserver/debugserver.xcodeproj/project.pbxproj b/lldb/tools/debugserver/debugserver.xcodeproj/project.pbxproj index bcab748b350f..392f5cab006a 100644 --- a/lldb/tools/debugserver/debugserver.xcodeproj/project.pbxproj +++ b/lldb/tools/debugserver/debugserver.xcodeproj/project.pbxproj @@ -372,6 +372,7 @@ isa = PBXProject; buildConfigurationList = 1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "debugserver" */; compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English,