[Lldb-commits] [lldb] r299020 - Move the definition of SBListener::GetSP() to SBListener.cpp.
Author: spyffe Date: Wed Mar 29 14:32:59 2017 New Revision: 299020 URL: http://llvm.org/viewvc/llvm-project?rev=299020&view=rev Log: Move the definition of SBListener::GetSP() to SBListener.cpp. This is the requirement for all functions in the public API, to eliminate weak symbol definitions. Modified: lldb/trunk/include/lldb/API/SBListener.h lldb/trunk/source/API/SBListener.cpp Modified: lldb/trunk/include/lldb/API/SBListener.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBListener.h?rev=299020&r1=299019&r2=299020&view=diff == --- lldb/trunk/include/lldb/API/SBListener.h (original) +++ lldb/trunk/include/lldb/API/SBListener.h Wed Mar 29 14:32:59 2017 @@ -89,7 +89,7 @@ protected: SBListener(const lldb::ListenerSP &listener_sp); - lldb::ListenerSP GetSP() { return m_opaque_sp; } + lldb::ListenerSP GetSP(); private: lldb_private::Listener *operator->() const; Modified: lldb/trunk/source/API/SBListener.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBListener.cpp?rev=299020&r1=299019&r2=299020&view=diff == --- lldb/trunk/source/API/SBListener.cpp (original) +++ lldb/trunk/source/API/SBListener.cpp Wed Mar 29 14:32:59 2017 @@ -302,6 +302,8 @@ bool SBListener::HandleBroadcastEvent(co return false; } +lldb::ListenerSP SBListener::GetSP() { return m_opaque_sp; } + Listener *SBListener::operator->() const { return m_opaque_sp.get(); } Listener *SBListener::get() const { return m_opaque_sp.get(); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r298189 - Remove some dead code from DumpValueObjectOptions::PointerDepth
This is not dead code in Swift-enabled LLDB, as I just found out doing a merge. I'm going to use Default and see what breaks. Sean > On Mar 18, 2017, at 10:33 AM, Tamas Berghammer via lldb-commits > wrote: > > Author: tberghammer > Date: Sat Mar 18 12:33:00 2017 > New Revision: 298189 > > URL: http://llvm.org/viewvc/llvm-project?rev=298189&view=rev > Log: > Remove some dead code from DumpValueObjectOptions::PointerDepth > > Modified: >lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h >lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp > > Modified: lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h?rev=298189&r1=298188&r2=298189&view=diff > == > --- lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h (original) > +++ lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h Sat Mar > 18 12:33:00 2017 > @@ -27,7 +27,7 @@ namespace lldb_private { > class DumpValueObjectOptions { > public: > struct PointerDepth { > -enum class Mode { Always, Formatters, Default, Never } m_mode; > +enum class Mode { Always, Default, Never } m_mode; > uint32_t m_count; > > PointerDepth operator--() const { > @@ -37,9 +37,6 @@ public: > } > > bool CanAllowExpansion() const; > - > -bool CanAllowExpansion(bool is_root, TypeSummaryImpl *entry, > - ValueObject *valobj, const std::string &summary); > }; > > struct PointerAsArraySettings { > > Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=298189&r1=298188&r2=298189&view=diff > == > --- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original) > +++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Sat Mar 18 > 12:33:00 2017 > @@ -468,32 +468,11 @@ bool ValueObjectPrinter::PrintObjectDesc > return true; > } > > -bool DumpValueObjectOptions::PointerDepth::CanAllowExpansion( > -bool is_root, TypeSummaryImpl *entry, ValueObject *valobj, > -const std::string &summary) { > - switch (m_mode) { > - case Mode::Always: > -return (m_count > 0); > - case Mode::Never: > -return false; > - case Mode::Default: > -if (is_root) > - m_count = std::min(m_count, 1); > -return m_count > 0; > - case Mode::Formatters: > -if (!entry || entry->DoesPrintChildren(valobj) || summary.empty()) > - return m_count > 0; > -return false; > - } > - return false; > -} > - > bool DumpValueObjectOptions::PointerDepth::CanAllowExpansion() const { > switch (m_mode) { > case Mode::Always: > case Mode::Default: > - case Mode::Formatters: > -return (m_count > 0); > +return m_count > 0; > case Mode::Never: > return false; > } > @@ -546,8 +525,7 @@ bool ValueObjectPrinter::ShouldPrintChil > return true; > } > > - return curr_ptr_depth.CanAllowExpansion(false, entry, m_valobj, > - m_summary); > + return curr_ptr_depth.CanAllowExpansion(); > } > > return (!entry || entry->DoesPrintChildren(m_valobj) || > m_summary.empty()); > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r299402 - Add CPlusPlusNameParser to the xcodeproj
Author: spyffe Date: Mon Apr 3 18:56:41 2017 New Revision: 299402 URL: http://llvm.org/viewvc/llvm-project?rev=299402&view=rev Log: Add CPlusPlusNameParser to the xcodeproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=299402&r1=299401&r2=299402&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Apr 3 18:56:41 2017 @@ -712,6 +712,7 @@ 49DCF702170E70120092F75E /* Materializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DCF700170E70120092F75E /* Materializer.cpp */; }; 49DEF1251CD7C6DF006A7C7D /* BlockPointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DEF11F1CD7BD90006A7C7D /* BlockPointer.cpp */; }; 49E4F66B1C9CAD16008487EA /* DiagnosticManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E4F6681C9CAD12008487EA /* DiagnosticManager.cpp */; }; + 49F811F31E931B2100F4E163 /* CPlusPlusNameParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49F811EF1E931B1500F4E163 /* CPlusPlusNameParser.cpp */; }; 4C0083401B9F9BA900D5CF24 /* UtilityFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp */; }; 4C2479BD1BA39295009C9A7B /* FunctionCaller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C0083321B9A5DE200D5CF24 /* FunctionCaller.cpp */; }; 4C3ADCD61810D88B00357218 /* BreakpointResolverFileRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CAA56141422D986001FFA01 /* BreakpointResolverFileRegex.cpp */; }; @@ -2474,6 +2475,8 @@ 49EC3E9C118F90D400B1265E /* ThreadPlanCallFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanCallFunction.h; path = include/lldb/Target/ThreadPlanCallFunction.h; sourceTree = ""; }; 49F1A74511B3388F003ED505 /* ClangExpressionDeclMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangExpressionDeclMap.cpp; path = ExpressionParser/Clang/ClangExpressionDeclMap.cpp; sourceTree = ""; }; 49F1A74911B338AE003ED505 /* ClangExpressionDeclMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExpressionDeclMap.h; path = ExpressionParser/Clang/ClangExpressionDeclMap.h; sourceTree = ""; }; + 49F811EF1E931B1500F4E163 /* CPlusPlusNameParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CPlusPlusNameParser.cpp; path = Language/CPlusPlus/CPlusPlusNameParser.cpp; sourceTree = ""; }; + 49F811F01E931B1500F4E163 /* CPlusPlusNameParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPlusPlusNameParser.h; path = Language/CPlusPlus/CPlusPlusNameParser.h; sourceTree = ""; }; 4C00832C1B9A58A700D5CF24 /* Expression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Expression.h; path = include/lldb/Expression/Expression.h; sourceTree = ""; }; 4C00832D1B9A58A700D5CF24 /* FunctionCaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionCaller.h; path = include/lldb/Expression/FunctionCaller.h; sourceTree = ""; }; 4C00832E1B9A58A700D5CF24 /* UserExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UserExpression.h; path = include/lldb/Expression/UserExpression.h; sourceTree = ""; }; @@ -6108,6 +6111,8 @@ 945261B01B9A11BE00BF138D /* Formatters */, 94B6385C1B8FB174004FE1E4 /* CPlusPlusLanguage.h */, 94B6385B1B8FB174004FE1E4 /* CPlusPlusLanguage.cpp */, + 49F811F01E931B1500F4E163 /* CPlusPlusNameParser.h */, + 49F811EF1E931B1500F4E163 /* CPlusPlusNameParser.cpp */, ); name = CPlusPlus; sourceTree = ""; @@ -7077,6 +7082,7 @@ 2689FFF713353DB600698AC0 /* BreakpointLocation.cpp in Sources */, 2654A68D1E552D1500DA1013 /* PseudoTerminal.cpp in Sources */, 2689FFF913353DB600698AC0 /* BreakpointLocationCollection.cpp in Sources */, + 49F811F31E931B2100F4E163 /* CPlusPlusNameParser.cpp in Sources */, 2689FFFB13353DB600698AC0 /* BreakpointLocationList.cpp in Sources */,
[Lldb-commits] [lldb] r299587 - The darwin_log tests are very fragile and currently do not properly assess the state of that functionality.
Author: spyffe Date: Wed Apr 5 15:33:39 2017 New Revision: 299587 URL: http://llvm.org/viewvc/llvm-project?rev=299587&view=rev Log: The darwin_log tests are very fragile and currently do not properly assess the state of that functionality. I have put them all in their own category, and made that category disabled by default. Differential revision: https://reviews.llvm.org/D31718 Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/.categories Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py lldb/trunk/packages/Python/lldbsuite/test/test_categories.py Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=299587&r1=299586&r2=299587&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Wed Apr 5 15:33:39 2017 @@ -66,7 +66,7 @@ categoriesList = None # set to true if we are going to use categories for cherry-picking test cases useCategories = False # Categories we want to skip -skipCategories = [] +skipCategories = ["darwin-log"] # use this to track per-category failures failuresPerCategory = {} Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/.categories URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/.categories?rev=299587&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/.categories (added) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/.categories Wed Apr 5 15:33:39 2017 @@ -0,0 +1 @@ +darwin-log Modified: lldb/trunk/packages/Python/lldbsuite/test/test_categories.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_categories.py?rev=299587&r1=299586&r2=299587&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/test_categories.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/test_categories.py Wed Apr 5 15:33:39 2017 @@ -33,7 +33,8 @@ all_categories = { 'dyntype': 'Tests related to dynamic type support', 'stresstest': 'Tests related to stressing lldb limits', 'flakey': 'Flakey test cases, i.e. tests that do not reliably pass at each execution', -'lldb-mi': 'lldb-mi tests'} +'lldb-mi': 'lldb-mi tests', +'darwin-log': 'Darwin log tests'} def unique_string_match(yourentry, list): ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300862 - Changed a use of APInt::getSignBit to APInt::getSignMask.
Author: spyffe Date: Thu Apr 20 13:07:51 2017 New Revision: 300862 URL: http://llvm.org/viewvc/llvm-project?rev=300862&view=rev Log: Changed a use of APInt::getSignBit to APInt::getSignMask. Modified: lldb/trunk/source/Core/Scalar.cpp Modified: lldb/trunk/source/Core/Scalar.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Scalar.cpp?rev=300862&r1=300861&r2=300862&view=diff == --- lldb/trunk/source/Core/Scalar.cpp (original) +++ lldb/trunk/source/Core/Scalar.cpp Thu Apr 20 13:07:51 2017 @@ -2745,7 +2745,7 @@ bool Scalar::SignExtend(uint32_t sign_bi if (max_bit_pos == sign_bit_pos) return true; else if (sign_bit_pos < (max_bit_pos - 1)) { -llvm::APInt sign_bit = llvm::APInt::getSignBit(sign_bit_pos + 1); +llvm::APInt sign_bit = llvm::APInt::getSignMask(sign_bit_pos + 1); llvm::APInt bitwize_and = m_integer & sign_bit; if (bitwize_and.getBoolValue()) { const llvm::APInt mask = ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r301263 - [DWARF] Fix lookup in the abstract origins of inlined blocks/functions
Author: spyffe Date: Mon Apr 24 17:11:10 2017 New Revision: 301263 URL: http://llvm.org/viewvc/llvm-project?rev=301263&view=rev Log: [DWARF] Fix lookup in the abstract origins of inlined blocks/functions LLDB uses clang::DeclContexts for lookups, and variables get put into the DeclContext for their abstract origin. (The abstract origin is a DWARF pointer that indicates the unique definition of inlined code.) When the expression parser is looking for variables, it locates the DeclContext for the current context. This needs to be done carefully, though, e.g.: __attribute__ ((always_inline)) void f(int a) { { int b = a * 2; } } void g() { f(3); } Here, if we're stopped in the inlined copy of f, we have to find the DeclContext corresponding to the definition of f – its abstract origin. Clang doesn't allow multiple functions with the same name and arguments to exist. It also means that any variables we see must be placed in the appropriate DeclContext. [Bug 1]: When stopped in an inline block, the function GetDeclContextDIEContainingDIE for that block doesn't properly construct a DeclContext for the abstract origin for inlined subroutines. That means we get duplicated function DeclContexts, but function arguments only get put in the abstract origin's DeclContext, and as a result when we try to look for them in nested contexts they aren't found. [Bug 2]: When stopped in an inline block, the DWARF (for space reasons) doesn't explicitly point to the abstract origin for that block. This means that the function GetClangDeclContextForDIE returns a different DeclContext for each place the block is inlined. However, any variables defined in the block have abstract origins, so they will only get placed in the DeclContext for their abstract origin. In this fix, I've introduced a test covering both of these issues, and fixed them. Bug 1 could be resolved simply by making sure we look up the abstract origin for inlined functions when looking up their DeclContexts on behalf of nested blocks. For Bug 2, I've implemented an algorithm that makes the DeclContext for a block be the containing DeclContext for the closest entity we would find during lookup that has an abstract origin pointer. That means that in the following situation: { // block 1 int a; { // block 2 int b; } } if we looked up the DeclContext for block 2, we'd find the block containing the abstract origin of b, and lookup would proceed correctly because we'd see b and a. However, in the situation { // block 1 int a; { // block 2 } } since there isn't anything to look up in block 2, we can't determine its abstract origin (and there is no such pointer in the DWARF for blocks). However, we can walk up the parent chain and find a, and its abstract origin lives in the abstract origin of block 1. So we simply say that the DeclContext for block 2 is the same as the DeclContext for block 1, which contains a. Lookups will return the same results. Thanks to Jim Ingham for review and suggestions. Differential revision: https://reviews.llvm.org/D32375 Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/inlines/main.c lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/inlines/main.c URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/inlines/main.c?rev=301263&r1=301262&r2=301263&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/c/inlines/main.c (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/inlines/main.c Mon Apr 24 17:11:10 2017 @@ -5,6 +5,11 @@ inline void test2(int) __attribute__ ((a void test2(int b) { printf("test2(%d)\n", b); //% self.expect("expression b", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["42"]) +{ + int c = b * 2; + printf("c=%d\n", c); //% self.expect("expression b", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["42"]) + //% self.expect("expression c", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["84"]) +} } void test1(int a) { Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=301263&r1=301262&r2=301263&view=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Mon Apr 24 17:11:10 2017 @@ -3682,7 +3682,7 @@ DWARFASTParserClang::GetClangDeclContext break; case DW_TAG_lexical_block: - decl_ctx = (clang::DeclContext *)ResolveBlockDIE(die);
[Lldb-commits] [lldb] r301273 - [Expression parser] Return both types and variables
Author: spyffe Date: Mon Apr 24 18:14:04 2017 New Revision: 301273 URL: http://llvm.org/viewvc/llvm-project?rev=301273&view=rev Log: [Expression parser] Return both types and variables Many times a user wants to access a type when there's a variable of the same name, or a variable when there's a type of the same name. Depending on the precise context, currently the expression parser can fail to resolve one or the other. This is because ClangExpressionDeclMap has logic to limit the amount of information it searches, and that logic sometimes cuts down the search prematurely. This patch removes some of those early exits. In that sense, this patch trades performance (early exit is faster) for correctness. I've also included two new test cases showing examples of this behavior – as well as modifying an existing test case that gets it wrong. Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/TestLLVMStyle.py lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/TestSymbols.py lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/main.cc Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/Makefile?rev=301273&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/Makefile Mon Apr 24 18:14:04 2017 @@ -0,0 +1,3 @@ +LEVEL = ../../../make +C_SOURCES := main.c +include $(LEVEL)/Makefile.rules \ No newline at end of file Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/TestLLVMStyle.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/TestLLVMStyle.py?rev=301273&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/TestLLVMStyle.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/TestLLVMStyle.py Mon Apr 24 18:14:04 2017 @@ -0,0 +1,7 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest( +__file__, globals(), [ +decorators.expectedFailureAll( +oslist=["windows"], bugnumber="llvm.org/pr24764")]) \ No newline at end of file Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc?rev=301273&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc Mon Apr 24 18:14:04 2017 @@ -0,0 +1,36 @@ +//===-- main.cc -*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LIDENSE.TXT for details. +// +//===--===// + +namespace n { +struct D { +int i; +static int anInt() { return 2; } +int dump() { return i; } +}; + +class C { +public: +int foo(D *D); +}; +} + +using namespace n; + +int C::foo(D* D) { +return D->dump(); //% self.expect("expression -- D->dump()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) + //% self.expect("expression -- D::anInt()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) + +} + +int main (int argc, char const *argv[]) +{ +D myD { D::anInt() }; +C().foo(&myD); +return 0; +} Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py?rev=301273&r1=301272&r2=301273&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py Mon Apr 24 18:14:04 2017
[Lldb-commits] [lldb] r301277 - Fixed two bad Makefiles that might be breaking Linux.
Author: spyffe Date: Mon Apr 24 18:49:06 2017 New Revision: 301277 URL: http://llvm.org/viewvc/llvm-project?rev=301277&view=rev Log: Fixed two bad Makefiles that might be breaking Linux. Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/Makefile Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/Makefile?rev=301277&r1=301276&r2=301277&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/Makefile (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/Makefile Mon Apr 24 18:49:06 2017 @@ -1,3 +1,3 @@ LEVEL = ../../../make -C_SOURCES := main.c +CXX_SOURCES := main.cpp include $(LEVEL)/Makefile.rules \ No newline at end of file Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/Makefile?rev=301277&r1=301276&r2=301277&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/Makefile (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/Makefile Mon Apr 24 18:49:06 2017 @@ -1,3 +1,3 @@ LEVEL = ../../../make -C_SOURCES := main.c +CXX_SOURCES := main.cpp include $(LEVEL)/Makefile.rules ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r301280 - Name the C++ source files for two tests correctly.
Author: spyffe Date: Mon Apr 24 18:58:36 2017 New Revision: 301280 URL: http://llvm.org/viewvc/llvm-project?rev=301280&view=rev Log: Name the C++ source files for two tests correctly. Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cpp - copied, changed from r301279, lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/main.cpp - copied, changed from r301279, lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/main.cc Removed: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/main.cc Removed: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc?rev=301279&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc (removed) @@ -1,36 +0,0 @@ -//===-- main.cc -*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LIDENSE.TXT for details. -// -//===--===// - -namespace n { -struct D { -int i; -static int anInt() { return 2; } -int dump() { return i; } -}; - -class C { -public: -int foo(D *D); -}; -} - -using namespace n; - -int C::foo(D* D) { -return D->dump(); //% self.expect("expression -- D->dump()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) - //% self.expect("expression -- D::anInt()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) - -} - -int main (int argc, char const *argv[]) -{ -D myD { D::anInt() }; -C().foo(&myD); -return 0; -} Copied: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cpp (from r301279, lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc) URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cpp?p2=lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cpp&p1=lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc&r1=301279&r2=301280&rev=301280&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cc (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/llvm-style/main.cpp Mon Apr 24 18:58:36 2017 @@ -1,4 +1,4 @@ -//===-- main.cc -*- C++ -*-===// +//===-- main.cpp *- C++ -*-===// // // The LLVM Compiler Infrastructure // Removed: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/main.cc URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/main.cc?rev=301279&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/main.cc (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/main.cc (removed) @@ -1,40 +0,0 @@ -//===-- main.cc -*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LIDENSE.TXT for details. -// -//===--===// - -void *D = 0; - -class D { -static int i; -}; - -int D::i = 3; - -namespace errno { -int j = 4; -}; - -int twice(int n) -{ -return n * 2; //% self.expect("expression -- D::i", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "3"]) - //% self.expect("expression -- D", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["void"]) - //% self.expect("expression -- errno::j", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "4"]) -} - -const char getAChar() -{ -const char D[] = "Hello world"; -return D[0]; //% self.expect("expression -- D::i", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "3"]) - //% self.expect("expression -- D", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["char", "Hello"]) -} - -int main (int argc, char const *argv[]) -{ -int six = twice(3); -return 0; -} Copied: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/main.cpp (from r301279, lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/symbols/main.cc) URL: http://llvm.org/viewvc/l
[Lldb-commits] [lldb] r301461 - Fixed a crash when dealing with an empty method name in the ObjC runtime.
Author: spyffe Date: Wed Apr 26 15:36:47 2017 New Revision: 301461 URL: http://llvm.org/viewvc/llvm-project?rev=301461&view=rev Log: Fixed a crash when dealing with an empty method name in the ObjC runtime. I've filed a bug covering better unit testing of our runtime metadata reader, which will allow this to be testable.. Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp?rev=301461&r1=301460&r2=301461&view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp Wed Apr 26 15:36:47 2017 @@ -355,9 +355,14 @@ public: } } +clang::IdentifierInfo **identifier_infos = selector_components.data(); +if (!identifier_infos) { + return NULL; +} + clang::Selector sel = ast_ctx.Selectors.getSelector( is_zero_argument ? 0 : selector_components.size(), -selector_components.data()); +identifier_infos); clang::QualType ret_type = ClangUtil::GetQualType(type_realizer_sp->RealizeType( ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r301993 - Fixed a bug where we did not properly use the complete versions of Objective-C classes.
Author: spyffe Date: Tue May 2 19:41:43 2017 New Revision: 301993 URL: http://llvm.org/viewvc/llvm-project?rev=301993&view=rev Log: Fixed a bug where we did not properly use the complete versions of Objective-C classes. Also added a test case, thanks to Greg Clayton. Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Foo.h lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.h lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.m lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestExt/ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestExt/Foo.h lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestExt/TestExt.h lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestExt/TestExt.m lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/main.m Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile?rev=301993&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile Tue May 2 19:41:43 2017 @@ -0,0 +1,24 @@ +LEVEL = ../../../make + +CFLAGS = -g -O0 +LDFLAGS = $(CFLAGS) -lobjc -framework Foundation + +all: a.out libTest.dylib libTestExt.dylib + +libTest.dylib: Test/Test.m + $(CC) $(CFLAGS) -I. -c -o Test.o Test/Test.m + $(CC) $(LDFLAGS) -shared -o libTest.dylib Test.o + dsymutil libTest.dylib + +libTestExt.dylib: TestExt/TestExt.m + $(CC) $(CFLAGS) -I. -c -o TestExt.o TestExt/TestExt.m + $(CC) $(LDFLAGS) -L. -lTest -shared -o libTestExt.dylib TestExt.o + dsymutil libTestExt.dylib + +a.out: main.m libTest.dylib libTestExt.dylib + $(CC) $(LDFLAGS) -I. -L. -lTest -lTestExt -o a.out main.m + +.PHONY: clean + +clean: + rm -rf *.dylib a.out *.o *.dSYM *.d Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Foo.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Foo.h?rev=301993&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Foo.h (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Foo.h Tue May 2 19:41:43 2017 @@ -0,0 +1,9 @@ +#ifndef __Foo_h__ +#define __Foo_h__ + +typedef struct { +float start; +float duration; +} CMTimeRange; + +#endif Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.h?rev=301993&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.h (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.h Tue May 2 19:41:43 2017 @@ -0,0 +1,10 @@ +#import +#import + +@interface Test : NSObject { +@public +CMTimeRange _range; +} +- (void) doTest; +@end + Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.m URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.m?rev=301993&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.m (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.m Tue May 2 19:41:43 2017 @@ -0,0 +1,8 @@ +#import "Test.h" + +@implementation Test +- (void) doTest { +NSLog(@"-[Test doTest]"); +} +@end + Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py?re
[Lldb-commits] [lldb] r302833 - [DWARF parser] Produce correct template parameter packs
Author: spyffe Date: Thu May 11 17:08:05 2017 New Revision: 302833 URL: http://llvm.org/viewvc/llvm-project?rev=302833&view=rev Log: [DWARF parser] Produce correct template parameter packs Templates can end in parameter packs, like this template struct MyStruct { /*...*/ }; LLDB does not currently support these parameter packs; it does not emit them into the template argument list at all. This causes problems when you specialize, e.g.: template <> struct MyStruct { /*...*/ }; template <> struct MyStruct : MyStruct { /*...*/ }; LLDB generates two template specializations, each with no template arguments, and then when they are imported by the ASTImporter into a parser's AST context we get a single specialization that inherits from itself, causing Clang's record layout mechanism to smash its stack. This patch fixes the problem for classes and adds tests. The tests for functions fail because Clang's ASTImporter can't import them at the moment, so I've xfailed that test. Differential Revision: https://reviews.llvm.org/D33025 Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/main.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=302833&r1=302832&r2=302833&view=diff == --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Thu May 11 17:08:05 2017 @@ -275,17 +275,16 @@ public: bool IsValid() const { if (args.empty()) return false; - return args.size() == names.size(); -} - -size_t GetSize() const { - if (IsValid()) -return args.size(); - return 0; + return args.size() == names.size() && +((bool)pack_name == (bool)packed_args) && +(!packed_args || !packed_args->packed_args); } llvm::SmallVector names; llvm::SmallVector args; + +const char * pack_name = nullptr; +std::unique_ptr packed_args; }; clang::FunctionTemplateDecl * Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/Makefile?rev=302833&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/Makefile Thu May 11 17:08:05 2017 @@ -0,0 +1,3 @@ +LEVEL = ../../../make +CXX_SOURCES := main.cpp +include $(LEVEL)/Makefile.rules Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py?rev=302833&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py Thu May 11 17:08:05 2017 @@ -0,0 +1,7 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest( +__file__, globals(), [ +decorators.expectedFailureAll( +oslist=["windows"], bugnumber="llvm.org/pr24764")]) Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk
[Lldb-commits] [lldb] r302850 - xfail TestClassTemplateParameterPack on gcc to mollify lldb-x86_64-ubuntu-14.04-cmake.
Author: spyffe Date: Thu May 11 18:38:21 2017 New Revision: 302850 URL: http://llvm.org/viewvc/llvm-project?rev=302850&view=rev Log: xfail TestClassTemplateParameterPack on gcc to mollify lldb-x86_64-ubuntu-14.04-cmake. Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py?rev=302850&r1=302849&r2=302850&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py Thu May 11 18:38:21 2017 @@ -4,4 +4,6 @@ from lldbsuite.test import decorators lldbinline.MakeInlineTest( __file__, globals(), [ decorators.expectedFailureAll( -oslist=["windows"], bugnumber="llvm.org/pr24764")]) +oslist=["windows"], bugnumber="llvm.org/pr24764"), +decorators.expectedFailureAll( +compiler="gcc")]) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r302954 - Fixed the OS X build after Error -> Status rename.
Author: spyffe Date: Fri May 12 16:53:44 2017 New Revision: 302954 URL: http://llvm.org/viewvc/llvm-project?rev=302954&view=rev Log: Fixed the OS X build after Error -> Status rename. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=302954&r1=302953&r2=302954&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri May 12 16:53:44 2017 @@ -333,7 +333,6 @@ 26744EF11338317700EF765A /* GDBRemoteCommunicationClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26744EED1338317700EF765A /* GDBRemoteCommunicationClient.cpp */; }; 26744EF31338317700EF765A /* GDBRemoteCommunicationServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26744EEF1338317700EF765A /* GDBRemoteCommunicationServer.cpp */; }; 26764C971E48F482008D3573 /* ConstString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764C961E48F482008D3573 /* ConstString.cpp */; }; - 26764C991E48F4D2008D3573 /* Error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764C981E48F4D2008D3573 /* Error.cpp */; }; 26764C9E1E48F51E008D3573 /* Stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764C9D1E48F51E008D3573 /* Stream.cpp */; }; 26764CA01E48F528008D3573 /* RegularExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764C9F1E48F528008D3573 /* RegularExpression.cpp */; }; 26764CA21E48F547008D3573 /* StreamString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764CA11E48F547008D3573 /* StreamString.cpp */; }; @@ -691,6 +690,8 @@ 3FDFED2D19C257A0009756A7 /* HostProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2C19C257A0009756A7 /* HostProcess.cpp */; }; 490A36C0180F0E6F00BA31F8 /* PlatformWindows.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 490A36BD180F0E6F00BA31F8 /* PlatformWindows.cpp */; }; 490A966B1628C3BF00F0002E /* SBDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 9452573816262CEF00325455 /* SBDeclaration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 492DB7E71EC662B100B9E9AF /* Status.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 492DB7E61EC662B100B9E9AF /* Status.h */; }; + 492DB7EB1EC662E200B9E9AF /* Status.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 492DB7E81EC662D100B9E9AF /* Status.cpp */; }; 4939EA8D1BD56B6D00084382 /* REPL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4939EA8C1BD56B6D00084382 /* REPL.cpp */; }; 494260DA14579144003C1C78 /* VerifyDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 494260D914579144003C1C78 /* VerifyDecl.cpp */; }; 4959511F1A1BC4BC00F6F8FC /* ClangModulesDeclVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4959511E1A1BC4BC00F6F8FC /* ClangModulesDeclVendor.cpp */; }; @@ -1193,6 +1194,7 @@ dstPath = "$(DEVELOPER_INSTALL_DIR)/usr/share/man/man1"; dstSubfolderSpec = 0; files = ( + 492DB7E71EC662B100B9E9AF /* Status.h in CopyFiles */, AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 1; @@ -1853,8 +1855,6 @@ 2675F6FF1332BE690067997B /* PlatformRemoteiOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteiOS.h; sourceTree = ""; }; 26764C951E48F46F008D3573 /* ConstString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ConstString.h; path = include/lldb/Utility/ConstString.h; sourceTree = ""; }; 26764C961E48F482008D3573 /* ConstString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConstString.cpp; path = source/Utility/ConstString.cpp; sourceTree = ""; }; - 26764C981E48F4D2008D3573 /* Error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Error.cpp; path = source/Utility/Error.cpp; sourceTree = ""; }; - 26764C9A1E48F4DD008D3573 /* Error.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Error.h; path = include/lldb/Utility/Error.h; sourceTree = ""; }; 26764C9B1E48F50C008D3573 /* Stream.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Stream.h; path = include/lldb/Utility/Stream.h; sourceTree = ""; }; 26764C9C1E48F516008D3573 /* RegularExpression.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h;
[Lldb-commits] [lldb] r303110 - [TypeSystem] Fix inspection of Objective-C object types
Author: spyffe Date: Mon May 15 14:55:20 2017 New Revision: 303110 URL: http://llvm.org/viewvc/llvm-project?rev=303110&view=rev Log: [TypeSystem] Fix inspection of Objective-C object types ptr_refs exposed a problem in ClangASTContext's implementation: it uses an accessor to downcast a QualType to an ObjCObjectPointerType, but the accessor is not fully general. getAs() is the safer way to go. I've added a test case that uses ptr_refs in a way that would crash before the fix. Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/main.m Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/Makefile?rev=303110&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/Makefile Mon May 15 14:55:20 2017 @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +OBJC_SOURCES := main.m + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py?rev=303110&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py Mon May 15 14:55:20 2017 @@ -0,0 +1,50 @@ +""" +Test the ptr_refs tool on Darwin with Objective-C +""" + +from __future__ import print_function + +import os +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestPtrRefsObjC(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +@skipUnlessDarwin +def test_ptr_refs(self): +"""Test the ptr_refs tool on Darwin with Objective-C""" +self.build() +exe_name = 'a.out' +exe = os.path.join(os.getcwd(), exe_name) + +target = self.dbg.CreateTarget(exe) +self.assertTrue(target, VALID_TARGET) + +main_file_spec = lldb.SBFileSpec('main.m') +breakpoint = target.BreakpointCreateBySourceRegex( +'break', main_file_spec) +self.assertTrue(breakpoint and +breakpoint.GetNumLocations() == 1, +VALID_BREAKPOINT) + +process = target.LaunchSimple( +None, None, self.get_process_working_directory()) +self.assertTrue(process, PROCESS_IS_VALID) + +# Frame #0 should be on self.line1 and the break condition should hold. +thread = lldbutil.get_stopped_thread( +process, lldb.eStopReasonBreakpoint) +self.assertTrue( +thread.IsValid(), +"There should be a thread stopped due to breakpoint condition") + +frame = thread.GetFrameAtIndex(0) + +self.dbg.HandleCommand("script import lldb.macosx.heap") +self.expect("ptr_refs self", substrs=["malloc", "stack"]) + Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/main.m URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/main.m?rev=303110&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/main.m (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ptr_refs/main.m Mon May 15 14:55:20 2017 @@ -0,0 +1,39 @@ +//===-- main.c --*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +#import + +@interface MyClass : NSObject { +}; +-(void)test; +@end + +@implementation MyClass +-(void)test { +printf("%p\n", self); // break here +} +@end + +@interface MyOwner : NSObject { + @public id ownedThing; // should be id, to test +}; +@end + +@implementation MyOwner +@end + +int main (int argc, char const *argv[]) { +@autoreleasepool { +MyOwner *owner = [[MyOwner alloc] init]; +owner->ownedThing = [[MyClass alloc] init]; +[(MyClass*)owner->ownedThing test]; +} +return 0; +} + Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/view
[Lldb-commits] [lldb] r303223 - [Expression parser] Look up module symbols before hunting globally
Author: spyffe Date: Tue May 16 18:46:13 2017 New Revision: 303223 URL: http://llvm.org/viewvc/llvm-project?rev=303223&view=rev Log: [Expression parser] Look up module symbols before hunting globally When it resolves symbol-only variables, the expression parser currently looks only in the global module list. It should prefer the current module. I've fixed that behavior by making it search the current module first, and only search globally if it finds nothing. I've also added a test case. After review, I moved the core of the lookup algorithm into SymbolContext for use by other code that needs it. Thanks to Greg Clayton and Pavel Labath for their help. Differential Revision: https://reviews.llvm.org/D33083 Added: lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/ lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/ lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.c lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.h lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/OneConstant.c lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/ lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.c lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.h lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/TwoConstant.c lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/main.c Modified: lldb/trunk/include/lldb/Symbol/SymbolContext.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h lldb/trunk/source/Symbol/SymbolContext.cpp Modified: lldb/trunk/include/lldb/Symbol/SymbolContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolContext.h?rev=303223&r1=303222&r2=303223&view=diff == --- lldb/trunk/include/lldb/Symbol/SymbolContext.h (original) +++ lldb/trunk/include/lldb/Symbol/SymbolContext.h Tue May 16 18:46:13 2017 @@ -235,6 +235,29 @@ public: bool GetAddressRangeFromHereToEndLine(uint32_t end_line, AddressRange &range, Status &error); + + //-- + /// Find the best global data symbol visible from this context. + /// + /// Symbol priority is: + /// - extern symbol in the current module if there is one + /// - non-extern symbol in the current module if there is one + /// - extern symbol in the target + /// - non-extern symbol in the target + /// It is an error if the highest-priority result is ambiguous. + /// + /// @param[in] name + /// The name of the symbol to search for. + /// + /// @param[out] error + /// An error that will be populated with a message if there was an + /// ambiguous result. The error will not be populated if no result + /// was found. + /// + /// @return + /// The symbol that was found, or \b nullptr if none was found. + //-- + const Symbol *FindBestGlobalDataSymbol(const ConstString &name, Status &error); void GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target) const; Added: lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile?rev=303223&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile Tue May 16 18:46:13 2017 @@ -0,0 +1,18 @@ +LEVEL := ../../../make + +LD_EXTRAS := -L. -l$(LIB_PREFIX)One -l$(LIB_PREFIX)Two +C_SOURCES := main.c + +main.o : CFLAGS_EXTRAS += -g -O0 + +include $(LEVEL)/Makefile.rules + +.PHONY: +a.out: lib_One lib_Two + +lib_%: + $(MAKE) -f $*.mk + +clean:: + $(MAKE) -f One.mk clean + $(MAKE) -f Two.mk clean Added: lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk?rev=303223&view=auto == --- lldb/trunk/packages/P
[Lldb-commits] [lldb] r304314 - Added a testcase for local/namespaced name conflicts.
Author: spyffe Date: Wed May 31 12:18:10 2017 New Revision: 304314 URL: http://llvm.org/viewvc/llvm-project?rev=304314&view=rev Log: Added a testcase for local/namespaced name conflicts. This works on SVN but is a bit fragile on the Swift branch. I'm adding the test to both, so we have this path covered. Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile?rev=304314&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/Makefile Wed May 31 12:18:10 2017 @@ -0,0 +1,3 @@ +LEVEL = ../../../make +CXX_SOURCES := main.cpp +include $(LEVEL)/Makefile.rules Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py?rev=304314&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/TestNamespaceConflicts.py Wed May 31 12:18:10 2017 @@ -0,0 +1,7 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest( +__file__, globals(), [ +decorators.expectedFailureAll( +oslist=["windows"], bugnumber="llvm.org/pr24764")]) Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp?rev=304314&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_conflicts/main.cpp Wed May 31 12:18:10 2017 @@ -0,0 +1,29 @@ +//===-- main.cpp *- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +namespace n { +struct D { +int i; +static int anInt() { return 2; } +int dump() { return i; } +}; +} + +using namespace n; + +int foo(D* D) { +return D->dump(); //% self.expect("expression -- D->dump()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) +} + +int main (int argc, char const *argv[]) +{ +D myD { D::anInt() }; +foo(&myD); +return 0; +} ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r304510 - [TypeSystem] Handle Clang AttributedTypes
Author: spyffe Date: Thu Jun 1 20:24:18 2017 New Revision: 304510 URL: http://llvm.org/viewvc/llvm-project?rev=304510&view=rev Log: [TypeSystem] Handle Clang AttributedTypes When parsing types originating in modules, it is possible to encounter AttributedTypes (such as the type generated for NSString *_Nonnull). Some of LLDB's ClangASTContext methods deal with them; others do not. In particular, one function that did not was GetTypeInfo, causing TestObjCNewSyntax to fail. This fixes that, treating AttributedType as essentially transparent and getting the information for the modified type. In addition, however, TestObjCNewSyntax is a monolithic test that verifies a bunch of different things, all of which can break independently of one another. I broke it apart into smaller tests so that we get more precise failures when something (like this) breaks. Differential Revision: https://reviews.llvm.org/D33812 Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=304510&r1=304509&r2=304510&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Thu Jun 1 20:24:18 2017 @@ -26,16 +26,7 @@ class ObjCNewSyntaxTestCase(TestBase): # Find the line number to break inside main(). self.line = line_number('main.m', '// Set breakpoint 0 here.') -@skipUnlessDarwin -@expectedFailureAll( -oslist=['macosx'], -compiler='clang', -compiler_version=[ -'<', -'7.0.0']) -@skipIf(macos_version=["<", "10.12"]) -@expectedFailureAll(archs=["i[3-6]86"]) -def test_expr(self): +def runToBreakpoint(self): self.build() exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) @@ -55,6 +46,18 @@ class ObjCNewSyntaxTestCase(TestBase): self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE, substrs=[' resolved, hit count = 1']) +@skipUnlessDarwin +@expectedFailureAll( +oslist=['macosx'], +compiler='clang', +compiler_version=[ +'<', +'7.0.0']) +@skipIf(macos_version=["<", "10.12"]) +@expectedFailureAll(archs=["i[3-6]86"]) +def test_read_array(self): +self.runToBreakpoint() + self.expect( "expr --object-description -- immutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY, @@ -65,6 +68,18 @@ class ObjCNewSyntaxTestCase(TestBase): VARIABLES_DISPLAYED_CORRECTLY, substrs=["foo"]) +@skipUnlessDarwin +@expectedFailureAll( +oslist=['macosx'], +compiler='clang', +compiler_version=[ +'<', +'7.0.0']) +@skipIf(macos_version=["<", "10.12"]) +@expectedFailureAll(archs=["i[3-6]86"]) +def test_update_array(self): +self.runToBreakpoint() + self.expect( "expr --object-description -- mutable_array[0] = @\"bar\"", VARIABLES_DISPLAYED_CORRECTLY, @@ -75,6 +90,18 @@ class ObjCNewSyntaxTestCase(TestBase): VARIABLES_DISPLAYED_CORRECTLY, substrs=["bar"]) +@skipUnlessDarwin +@expectedFailureAll( +oslist=['macosx'], +compiler='clang', +compiler_version=[ +'<', +'7.0.0']) +@skipIf(macos_version=["<", "10.12"]) +@expectedFailureAll(archs=["i[3-6]86"]) +def test_read_dictionary(self): +self.runToBreakpoint() + self.expect( "expr --object-description -- immutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY, @@ -85,6 +112,18 @@ class ObjCNewSyntaxTestCase(TestBase): VARIABLES_DISPLAYED_CORRECTLY, substrs=["value"]) +@skipUnlessDarwin +@expectedFailureAll( +oslist=['macosx'], +compiler='clang', +compiler_version=[ +'<', +'7.0.0']) +@skipIf(macos_version=["<", "10.12"]) +@expectedFailureAll(archs=["i[3-6]86"]) +def test_update_dictionary(self): +self.runToBreakpoint() + self.expect( "expr --object-description -- mutable_dictionary[@\"key\"] = @\"object\"", VARIABLES_DISPLAYED_CORRECTLY, @@ -95,6 +134,18 @@ class ObjCNewSyntaxTestCase(TestBase): VARIABLES_DISPLAYED_CORRECTLY, substrs=["object"]) +@skipUnlessDarwin +@expectedFailureAll( +oslist=['macosx'], +
[Lldb-commits] [lldb] r305424 - [testsuite] xfailed two tests that depend on NSString conforming to NSCopying.
Author: spyffe Date: Wed Jun 14 18:01:43 2017 New Revision: 305424 URL: http://llvm.org/viewvc/llvm-project?rev=305424&view=rev Log: [testsuite] xfailed two tests that depend on NSString conforming to NSCopying. NSString is loaded from the DWARF, which doesn't have the concept of protocols. When this is used with the NSMutableDictionary type from Objective-C modules, this produces errors of the form error: cannot initialize a parameter of type 'id _Nonnull' with an rvalue of type 'NSString *' We're aware of these problems and have an internal bug report filed () Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=305424&r1=305423&r2=305424&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Wed Jun 14 18:01:43 2017 @@ -121,6 +121,8 @@ class ObjCNewSyntaxTestCase(TestBase): '7.0.0']) @skipIf(macos_version=["<", "10.12"]) @expectedFailureAll(archs=["i[3-6]86"]) +@expectedFailureAll( +bugnumber="rdar://32777981") def test_update_dictionary(self): self.runToBreakpoint() @@ -163,6 +165,8 @@ class ObjCNewSyntaxTestCase(TestBase): '7.0.0']) @skipIf(macos_version=["<", "10.12"]) @expectedFailureAll(archs=["i[3-6]86"]) +@expectedFailureAll( +bugnumber="rdar://32777981") def test_dictionary_literal(self): self.runToBreakpoint() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r305727 - Updated NSNumber formatter for new internal representation.
Author: spyffe Date: Mon Jun 19 13:32:22 2017 New Revision: 305727 URL: http://llvm.org/viewvc/llvm-project?rev=305727&view=rev Log: Updated NSNumber formatter for new internal representation. Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=305727&r1=305726&r2=305727&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py Mon Jun 19 13:32:22 2017 @@ -186,16 +186,27 @@ class ObjCDataFormatterTestCase(TestBase def nsnumber_data_formatter_commands(self): # Now enable AppKit and check we are displaying Cocoa classes correctly -self.expect('frame variable num1 num2 num3 num4 num5 num6 num7 num9', +self.expect('frame variable num1 num2 num3 num5 num6 num7 num9', substrs=['(NSNumber *) num1 = ', ' (int)5', '(NSNumber *) num2 = ', ' (float)3.1', '(NSNumber *) num3 = ', ' (double)3.14', - '(NSNumber *) num4 = ', ' (long)-2', '(NSNumber *) num5 = ', ' (char)65', '(NSNumber *) num6 = ', ' (long)255', '(NSNumber *) num7 = ', '200', '(NSNumber *) num9 = ', ' (short)-31616']) + +self.runCmd('frame variable num4', check=True) +output = self.res.GetOutput() +i128_handled_correctly = False + +if output.find('long') >= 0: +i128_handled_correctly = (output.find('(long)-2') >= 0) +if output.find('int128_t') >= 0: +i128_handled_correctly = (output.find('(int128_t)18446744073709551614') >= 0) # deliberately broken, should be ..14 + +self.assertTrue(i128_handled_correctly, "Expected valid output for int128_t; got " + output) + self.expect('frame variable num_at1 num_at2 num_at3 num_at4', substrs=['(NSNumber *) num_at1 = ', ' (int)12', '(NSNumber *) num_at2 = ', ' (int)-12', Modified: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp?rev=305727&r1=305726&r2=305727&view=diff == --- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp (original) +++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp Mon Jun 19 13:32:22 2017 @@ -31,6 +31,8 @@ #include "lldb/Utility/Status.h" #include "lldb/Utility/Stream.h" +#include "llvm/ADT/APInt.h" + #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h" #include "NSString.h" @@ -369,6 +371,28 @@ static void NSNumber_FormatLong(ValueObj stream.Printf("%s%" PRId64 "%s", prefix.c_str(), value, suffix.c_str()); } +static void NSNumber_FormatInt128(ValueObject &valobj, Stream &stream, + const llvm::APInt &value, + lldb::LanguageType lang) { + static ConstString g_TypeHint("NSNumber:int128_t"); + + std::string prefix, suffix; + if (Language *language = Language::FindPlugin(lang)) { +if (!language->GetFormatterPrefixSuffix(valobj, g_TypeHint, prefix, +suffix)) { + prefix.clear(); + suffix.clear(); +} + } + + stream.PutCString(prefix.c_str()); + const int radix = 10; + const bool isSigned = true; + std::string str = value.toString(radix, isSigned); + stream.PutCString(str.c_str()); + stream.PutCString(suffix.c_str()); +} + static void NSNumber_FormatFloat(ValueObject &valobj, Stream &stream, float value, lldb::LanguageType lang) { static ConstString g_TypeHint("NSNumber:float"); @@ -462,22 +486,72 @@ bool lldb_private::formatters::NSNumberS return true; } else { Status error; - uint8_t data_type = (process_sp->ReadUnsignedIntegerFromMemory( - valobj_addr + ptr_size, 1, 0, error) & - 0x1F); + + AppleObjCRuntime *runtime = + llvm::dyn_cast_or_null( + process_sp->GetObjCLanguageRuntime()); + + const bool new_format = + (runtime && runtime->G
[Lldb-commits] [lldb] r306180 - Updated the NSArray and NSDictionary formatters to support new storage formats.
Author: spyffe Date: Fri Jun 23 18:15:03 2017 New Revision: 306180 URL: http://llvm.org/viewvc/llvm-project?rev=306180&view=rev Log: Updated the NSArray and NSDictionary formatters to support new storage formats. Also un-xfailed a testcase that was affected by this. Thanks to Jason Molenda for the patch. Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=306180&r1=306179&r2=306180&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Fri Jun 23 18:15:03 2017 @@ -121,8 +121,6 @@ class ObjCNewSyntaxTestCase(TestBase): '7.0.0']) @skipIf(macos_version=["<", "10.12"]) @expectedFailureAll(archs=["i[3-6]86"]) -@expectedFailureAll( -bugnumber="rdar://32777981") def test_update_dictionary(self): self.runToBreakpoint() @@ -165,8 +163,6 @@ class ObjCNewSyntaxTestCase(TestBase): '7.0.0']) @skipIf(macos_version=["<", "10.12"]) @expectedFailureAll(archs=["i[3-6]86"]) -@expectedFailureAll( -bugnumber="rdar://32777981") def test_dictionary_literal(self): self.runToBreakpoint() Modified: lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp?rev=306180&r1=306179&r2=306180&view=diff == --- lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp (original) +++ lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp Fri Jun 23 18:15:03 2017 @@ -160,11 +160,47 @@ private: DataDescriptor_64 *m_data_64; }; -class NSArrayISyntheticFrontEnd : public SyntheticChildrenFrontEnd { +class NSArrayMSyntheticFrontEnd_1400 : public NSArrayMSyntheticFrontEnd { public: - NSArrayISyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); + NSArrayMSyntheticFrontEnd_1400(lldb::ValueObjectSP valobj_sp); - ~NSArrayISyntheticFrontEnd() override = default; + ~NSArrayMSyntheticFrontEnd_1400() override; + + bool Update() override; + +protected: + lldb::addr_t GetDataAddress() override; + + uint64_t GetUsedCount() override; + + uint64_t GetOffset() override; + + uint64_t GetSize() override; + +private: + struct DataDescriptor_32 { +uint32_t used; +uint32_t offset; +uint32_t size; +uint32_t list; + }; + + struct DataDescriptor_64 { +uint64_t used; +uint64_t offset; +uint64_t size; +uint64_t list; + }; + + DataDescriptor_32 *m_data_32; + DataDescriptor_64 *m_data_64; +}; + +class NSArrayISyntheticFrontEnd_1300 : public SyntheticChildrenFrontEnd { +public: + NSArrayISyntheticFrontEnd_1300(lldb::ValueObjectSP valobj_sp); + + ~NSArrayISyntheticFrontEnd_1300() override = default; size_t CalculateNumChildren() override; @@ -184,6 +220,45 @@ private: CompilerType m_id_type; }; +class NSArrayISyntheticFrontEnd_1400 : public SyntheticChildrenFrontEnd { +public: + NSArrayISyntheticFrontEnd_1400(lldb::ValueObjectSP valobj_sp); + + ~NSArrayISyntheticFrontEnd_1400() override; + + size_t CalculateNumChildren() override; + + lldb::ValueObjectSP GetChildAtIndex(size_t idx) override; + + bool Update() override; + + bool MightHaveChildren() override; + + size_t GetIndexOfChildWithName(const ConstString &name) override; + +private: + ExecutionContextRef m_exe_ctx_ref; + uint8_t m_ptr_size; + + struct DataDescriptor_32 { +uint32_t used; +uint32_t offset; +uint32_t size; +uint32_t list; + }; + + struct DataDescriptor_64 { +uint64_t used; +uint64_t offset; +uint64_t size; +uint64_t list; + }; + + DataDescriptor_32 *m_data_32; + DataDescriptor_64 *m_data_64; + CompilerType m_id_type; +}; + class NSArray0SyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: NSArray0SyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); @@ -257,6 +332,8 @@ bool lldb_private::formatters::NSArraySu static const ConstString g_NSArray0("__NSArray0"); static const ConstString g_NSArray1("__NSSingleObjectArrayI"); static const ConstString g_NSArrayCF("__NSCFArray"); + static const ConstString g_NSArrayMLegacy("__NSArrayM_Legacy"); + static const ConstString g_NSArrayMImmutable("__NSArrayM_Immutable"); if (class_name.IsEmpty()) return false; @@ -273,6 +350,18 @@ bool lldb_private::formatters::NSArraySu ptr_size, 0,
[Lldb-commits] [lldb] r306460 - [build system] If there's an OVERRIDE, don't guess the current SCM.
Author: spyffe Date: Tue Jun 27 13:35:53 2017 New Revision: 306460 URL: http://llvm.org/viewvc/llvm-project?rev=306460&view=rev Log: [build system] If there's an OVERRIDE, don't guess the current SCM. This makes automatic checkout work even in situations where the current repository can't be determined, such as in the case of a Git tag. Modified: lldb/trunk/scripts/Xcode/build-llvm.py lldb/trunk/scripts/Xcode/repo.py Modified: lldb/trunk/scripts/Xcode/build-llvm.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=306460&r1=306459&r2=306460&view=diff == --- lldb/trunk/scripts/Xcode/build-llvm.py (original) +++ lldb/trunk/scripts/Xcode/build-llvm.py Tue Jun 27 13:35:53 2017 @@ -43,6 +43,9 @@ def process_repo(r): } def XCODE_REPOSITORIES(): +override = repo.get_override() +if override: +return [process_repo(r) for r in override] identifier = repo.identifier() if identifier == None: identifier = "" # repo.find will just use the fallback file Modified: lldb/trunk/scripts/Xcode/repo.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/repo.py?rev=306460&r1=306459&r2=306460&view=diff == --- lldb/trunk/scripts/Xcode/repo.py (original) +++ lldb/trunk/scripts/Xcode/repo.py Tue Jun 27 13:35:53 2017 @@ -21,6 +21,17 @@ def identifier(): pass return None +def get_override(): + dir = os.path.dirname(os.path.realpath(__file__)) + repos_dir = os.path.join(dir, "repos") + json_regex = re.compile(r"^.*.json$") + override_path = os.path.join(repos_dir, "OVERRIDE") + if os.path.isfile(override_path): + override_set = json.load(open(override_path)) + return override_set["repos"] +else: + return None + def find(identifier): dir = os.path.dirname(os.path.realpath(__file__)) repos_dir = os.path.join(dir, "repos") ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r306611 - Added a project for the unified IR interpreter.
Author: spyffe Date: Wed Jun 28 15:51:16 2017 New Revision: 306611 URL: http://llvm.org/viewvc/llvm-project?rev=306611&view=rev Log: Added a project for the unified IR interpreter. Modified: lldb/trunk/www/projects.html Modified: lldb/trunk/www/projects.html URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/www/projects.html?rev=306611&r1=306610&r2=306611&view=diff == --- lldb/trunk/www/projects.html (original) +++ lldb/trunk/www/projects.html Wed Jun 28 15:51:16 2017 @@ -441,6 +441,18 @@ And then you have to explain these conditions the user in some helpful way. + + Unified IR interpreter. + +Currently IRInterpreter implements a portion of the LLVM IR, but it doesn't handle +vector data types and there are plenty of instructions it also doesn't support. +Conversely, lli supports most of LLVM's IR but it doesn't handle remote memory and +its function calling support is very rudimentary. It would be useful to unify these +and make the IR interpreter -- both for LLVM and LLDB -- better. An alternate strategy +would be simply to JIT into the current process but have callbacks for non-stack memory +access. + + ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r306773 - [Data formatters] Make NSSetM support both old- and new-style representation
Author: spyffe Date: Thu Jun 29 17:39:17 2017 New Revision: 306773 URL: http://llvm.org/viewvc/llvm-project?rev=306773&view=rev Log: [Data formatters] Make NSSetM support both old- and new-style representation NSSetM has two in-memory representations depending on what Foundation version is in use. This patch separates the two. rdar://33057292 Differential Revision: https://reviews.llvm.org/D34821 Modified: lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp Modified: lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp?rev=306773&r1=306772&r2=306773&view=diff == --- lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp (original) +++ lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp Thu Jun 29 17:39:17 2017 @@ -13,6 +13,7 @@ // Project includes #include "NSSet.h" +#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -84,11 +85,12 @@ private: std::vector m_children; }; -class NSSetMSyntheticFrontEnd : public SyntheticChildrenFrontEnd { +template +class GenericNSSetMSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: - NSSetMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); + GenericNSSetMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); - ~NSSetMSyntheticFrontEnd() override; + ~GenericNSSetMSyntheticFrontEnd() override; size_t CalculateNumChildren() override; @@ -101,32 +103,57 @@ public: size_t GetIndexOfChildWithName(const ConstString &name) override; private: + + struct SetItemDescriptor { +lldb::addr_t item_ptr; +lldb::ValueObjectSP valobj_sp; + }; + + ExecutionContextRef m_exe_ctx_ref; + uint8_t m_ptr_size; + D32 *m_data_32; + D64 *m_data_64; + std::vector m_children; +}; + +namespace Foundation1300 { struct DataDescriptor_32 { uint32_t _used : 26; uint32_t _size; uint32_t _mutations; uint32_t _objs_addr; }; - + struct DataDescriptor_64 { uint64_t _used : 58; uint64_t _size; uint64_t _mutations; uint64_t _objs_addr; }; - - struct SetItemDescriptor { -lldb::addr_t item_ptr; -lldb::ValueObjectSP valobj_sp; + + using NSSetMSyntheticFrontEnd = + GenericNSSetMSyntheticFrontEnd; +} + +namespace Foundation1400 { + struct DataDescriptor_32 { +uint32_t _used : 26; +uint32_t _size; +uint32_t _objs_addr; +uint32_t _mutations; }; - - ExecutionContextRef m_exe_ctx_ref; - uint8_t m_ptr_size; - DataDescriptor_32 *m_data_32; - DataDescriptor_64 *m_data_64; - std::vector m_children; -}; - + + struct DataDescriptor_64 { +uint64_t _used : 58; +uint64_t _size; +uint64_t _objs_addr; +uint64_t _mutations; + }; + + using NSSetMSyntheticFrontEnd = + GenericNSSetMSyntheticFrontEnd; +} + class NSSetCodeRunningSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: NSSetCodeRunningSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); @@ -283,7 +310,12 @@ lldb_private::formatters::NSSetSynthetic if (!strcmp(class_name, "__NSSetI")) { return (new NSSetISyntheticFrontEnd(valobj_sp)); } else if (!strcmp(class_name, "__NSSetM")) { -return (new NSSetMSyntheticFrontEnd(valobj_sp)); +AppleObjCRuntime *apple_runtime = +llvm::dyn_cast_or_null(runtime); +if (apple_runtime && apple_runtime->GetFoundationVersion() >= 1400) + return (new Foundation1400::NSSetMSyntheticFrontEnd(valobj_sp)); +else + return (new Foundation1300::NSSetMSyntheticFrontEnd(valobj_sp)); } else { auto &map(NSSet_Additionals::GetAdditionalSynthetics()); auto iter = map.find(class_name_cs), end = map.end(); @@ -442,7 +474,9 @@ lldb_private::formatters::NSSetISyntheti return set_item.valobj_sp; } -lldb_private::formatters::NSSetMSyntheticFrontEnd::NSSetMSyntheticFrontEnd( +template +lldb_private::formatters:: + GenericNSSetMSyntheticFrontEnd::GenericNSSetMSyntheticFrontEnd( lldb::ValueObjectSP valobj_sp) : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8), m_data_32(nullptr), m_data_64(nullptr) { @@ -450,15 +484,19 @@ lldb_private::formatters::NSSetMSyntheti Update(); } -lldb_private::formatters::NSSetMSyntheticFrontEnd::~NSSetMSyntheticFrontEnd() { +template +lldb_private::formatters:: + GenericNSSetMSyntheticFrontEnd::~GenericNSSetMSyntheticFrontEnd() { delete m_data_32; m_data_32 = nullptr; delete m_data_64; m_data_64 = nullptr; } +template size_t -lldb_private::formatters::NSSetMSyntheticFrontEnd::GetIndexOfChildWithName( +lldb_private::formatters:: + GenericNSSetMSyntheticFrontEnd::GetIndexOfChildWithName( const ConstString &name) { const char *item_name = name.GetCString(); uint32_t idx = ExtractIndexFromString
[Lldb-commits] [lldb] r308919 - Skip test_lldbmi_var_update on Darwin.
Author: spyffe Date: Mon Jul 24 13:11:20 2017 New Revision: 308919 URL: http://llvm.org/viewvc/llvm-project?rev=308919&view=rev Log: Skip test_lldbmi_var_update on Darwin. Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py?rev=308919&r1=308918&r2=308919&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py Mon Jul 24 13:11:20 2017 @@ -159,6 +159,7 @@ class MiVarTestCase(lldbmi_testcase.MiTe @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots +@skipIfDarwin # rdar://33462982 @skipIfRemote # We do not currently support remote debugging via the MI. def test_lldbmi_var_update(self): """Test that 'lldb-mi --interpreter' works for -var-update.""" ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r308993 - [TypeSystem] Guard the global `ASTSourceMap` with a mutex
Author: spyffe Date: Tue Jul 25 10:33:37 2017 New Revision: 308993 URL: http://llvm.org/viewvc/llvm-project?rev=308993&view=rev Log: [TypeSystem] Guard the global `ASTSourceMap` with a mutex s_source_map in ClangExternalASTSourceCommon.cpp is unguarded and therefore can break in multithreaded conditions. This can cause crashes in particular if multiple targets are being set up at once. This patch wraps s_source_map in a function that ensures exclusivity, and makes every user of it use that function instead. lldb crashes after "resume_off" Differential Revision: https://reviews.llvm.org/D35083 Modified: lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp Modified: lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp?rev=308993&r1=308992&r2=308993&view=diff == --- lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp (original) +++ lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp Tue Jul 25 10:33:37 2017 @@ -10,6 +10,8 @@ #include "lldb/Symbol/ClangExternalASTSourceCommon.h" #include "lldb/Utility/Stream.h" +#include + using namespace lldb_private; uint64_t g_TotalSizeOfMetadata = 0; @@ -18,15 +20,19 @@ typedef llvm::DenseMap ASTSourceMap; -static ASTSourceMap &GetSourceMap() { +static ASTSourceMap &GetSourceMap(std::unique_lock &guard) { // Intentionally leaked to avoid problems with global destructors. static ASTSourceMap *s_source_map = new ASTSourceMap; + static std::mutex s_mutex; + std::unique_lock locked_guard(s_mutex); + guard.swap(locked_guard); return *s_source_map; } ClangExternalASTSourceCommon * ClangExternalASTSourceCommon::Lookup(clang::ExternalASTSource *source) { - ASTSourceMap &source_map = GetSourceMap(); + std::unique_lock guard; + ASTSourceMap &source_map = GetSourceMap(guard); ASTSourceMap::iterator iter = source_map.find(source); @@ -40,11 +46,13 @@ ClangExternalASTSourceCommon::Lookup(cla ClangExternalASTSourceCommon::ClangExternalASTSourceCommon() : clang::ExternalASTSource() { g_TotalSizeOfMetadata += m_metadata.size(); - GetSourceMap()[this] = this; + std::unique_lock guard; + GetSourceMap(guard)[this] = this; } ClangExternalASTSourceCommon::~ClangExternalASTSourceCommon() { - GetSourceMap().erase(this); + std::unique_lock guard; + GetSourceMap(guard).erase(this); g_TotalSizeOfMetadata -= m_metadata.size(); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309046 - Skip test_unique_stacks on Darwin, because it doesn't terminate reliably.
Author: spyffe Date: Tue Jul 25 15:44:34 2017 New Revision: 309046 URL: http://llvm.org/viewvc/llvm-project?rev=309046&view=rev Log: Skip test_unique_stacks on Darwin, because it doesn't terminate reliably. rdar://problem/33462362 Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py?rev=309046&r1=309045&r2=309046&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py Tue Jul 25 15:44:34 2017 @@ -8,6 +8,7 @@ from __future__ import print_function import os import time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil @@ -60,7 +61,8 @@ class NumberOfThreadsTestCase(TestBase): self.assertTrue( num_threads >= 13, 'Number of expected threads and actual threads do not match.') - + +@skipIfDarwin # rdar://33462362 def test_unique_stacks(self): """Test backtrace unique with multiple threads executing the same stack.""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309631 - [build-script] Bring in modernizations from downstream:
Author: spyffe Date: Mon Jul 31 14:50:00 2017 New Revision: 309631 URL: http://llvm.org/viewvc/llvm-project?rev=309631&view=rev Log: [build-script] Bring in modernizations from downstream: - Don't do any checks of the current SCM repository if the llvm repositories are already there. Useful for bots. - When symlinking, remove old symlinks. - Support loading build-script as a library, not necessarily under Xcode. - Stringify args before passing them to subprocess. Modified: lldb/trunk/scripts/Xcode/build-llvm.py lldb/trunk/scripts/Xcode/lldbbuild.py Modified: lldb/trunk/scripts/Xcode/build-llvm.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=309631&r1=309630&r2=309631&view=diff == --- lldb/trunk/scripts/Xcode/build-llvm.py (original) +++ lldb/trunk/scripts/Xcode/build-llvm.py Mon Jul 31 14:50:00 2017 @@ -14,7 +14,6 @@ from lldbbuild import * SETTINGS - def LLVM_HASH_INCLUDES_DIFFS(): return False @@ -42,7 +41,25 @@ def process_repo(r): 'ref': r["ref"] } +def fallback_repo(name): +return { +'name': name, +'vcs': None, +'root': process_root(name), +'url': None, +'ref': None +} + +def dirs_exist(names): +for name in names: +if not os.path.isdir(process_root(name)): +return False +return True + def XCODE_REPOSITORIES(): +names = ["llvm", "clang", "ninja"] +if dirs_exist(names): +return [fallback_repo(n) for n in names] override = repo.get_override() if override: return [process_repo(r) for r in override] @@ -233,6 +250,8 @@ def should_build_llvm(): def do_symlink(source_path, link_path): print "Symlinking " + source_path + " to " + link_path +if os.path.islink(link_path): +os.remove(link_path) if not os.path.exists(link_path): os.symlink(source_path, link_path) @@ -433,8 +452,8 @@ def build_llvm_if_needed(): MAIN LOGIC -all_check_out_if_needed() -build_llvm_if_needed() -write_archives_txt() - -sys.exit(0) +if __name__ == "__main__": +all_check_out_if_needed() +build_llvm_if_needed() +write_archives_txt() +sys.exit(0) Modified: lldb/trunk/scripts/Xcode/lldbbuild.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/lldbbuild.py?rev=309631&r1=309630&r2=309631&view=diff == --- lldb/trunk/scripts/Xcode/lldbbuild.py (original) +++ lldb/trunk/scripts/Xcode/lldbbuild.py Mon Jul 31 14:50:00 2017 @@ -1,5 +1,6 @@ import os import subprocess +import sys UTILITIES @@ -14,7 +15,11 @@ def enum(*sequential, **named): def lldb_source_path(): -return os.environ.get('SRCROOT') +path = os.environ.get('SRCROOT') +if path: + return path +else: + return "./" def expected_llvm_build_path(): @@ -80,7 +85,7 @@ VCS = enum('git', def run_in_directory(args, path): -return subprocess.check_output(args, cwd=path) +return subprocess.check_output([str(arg) for arg in args], cwd=path) class Git: ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309702 - [build system] Add SBProcessInfo to the xcodeproj
Author: spyffe Date: Tue Aug 1 10:08:46 2017 New Revision: 309702 URL: http://llvm.org/viewvc/llvm-project?rev=309702&view=rev Log: [build system] Add SBProcessInfo to the xcodeproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=309702&r1=309701&r2=309702&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Aug 1 10:08:46 2017 @@ -690,12 +690,12 @@ 3FDFED2D19C257A0009756A7 /* HostProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2C19C257A0009756A7 /* HostProcess.cpp */; }; 490A36C0180F0E6F00BA31F8 /* PlatformWindows.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 490A36BD180F0E6F00BA31F8 /* PlatformWindows.cpp */; }; 490A966B1628C3BF00F0002E /* SBDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 9452573816262CEF00325455 /* SBDeclaration.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 492DB7E71EC662B100B9E9AF /* Status.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 492DB7E61EC662B100B9E9AF /* Status.h */; }; 492DB7EB1EC662E200B9E9AF /* Status.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 492DB7E81EC662D100B9E9AF /* Status.cpp */; }; 4939EA8D1BD56B6D00084382 /* REPL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4939EA8C1BD56B6D00084382 /* REPL.cpp */; }; 494260DA14579144003C1C78 /* VerifyDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 494260D914579144003C1C78 /* VerifyDecl.cpp */; }; 4959511F1A1BC4BC00F6F8FC /* ClangModulesDeclVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4959511E1A1BC4BC00F6F8FC /* ClangModulesDeclVendor.cpp */; }; 4966DCC4148978A10028481B /* ClangExternalASTSourceCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4966DCC3148978A10028481B /* ClangExternalASTSourceCommon.cpp */; }; + 4971D4B51F30ECFB00823171 /* SBProcessInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4987FB1E1F30EC7E00E5C17D /* SBProcessInfo.cpp */; }; 4984BA131B978C55008658D4 /* ClangExpressionVariable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4984BA0E1B978C3E008658D4 /* ClangExpressionVariable.cpp */; }; 4984BA161B979973008658D4 /* ExpressionVariable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4984BA151B979973008658D4 /* ExpressionVariable.cpp */; }; 4984BA181B979C08008658D4 /* ExpressionVariable.h in Headers */ = {isa = PBXBuildFile; fileRef = 4984BA171B979C08008658D4 /* ExpressionVariable.h */; }; @@ -1198,7 +1198,6 @@ dstPath = "$(DEVELOPER_INSTALL_DIR)/usr/share/man/man1"; dstSubfolderSpec = 0; files = ( - 492DB7E71EC662B100B9E9AF /* Status.h in CopyFiles */, AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 1; @@ -2439,6 +2438,9 @@ 4984BA0F1B978C3E008658D4 /* ClangExpressionVariable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExpressionVariable.h; path = ExpressionParser/Clang/ClangExpressionVariable.h; sourceTree = ""; }; 4984BA151B979973008658D4 /* ExpressionVariable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExpressionVariable.cpp; path = source/Expression/ExpressionVariable.cpp; sourceTree = ""; }; 4984BA171B979C08008658D4 /* ExpressionVariable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExpressionVariable.h; path = include/lldb/Expression/ExpressionVariable.h; sourceTree = ""; }; + 4987FB1C1F30EC6000E5C17D /* SBProcessInfo.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBProcessInfo.i; sourceTree = ""; }; + 4987FB1E1F30EC7E00E5C17D /* SBProcessInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBProcessInfo.cpp; path = source/API/SBProcessInfo.cpp; sourceTree = ""; }; + 4987FB201F30EC9900E5C17D /* SBProcessInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBProcessInfo.h; path = include/lldb/API/SBProcessInfo.h; sourceTree = ""; }; 499F381E11A5B3F300F5CE02 /* CommandObjectArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectArgs.h; path = source/Commands/CommandObjectArgs.h; sourceTree = ""
Re: [Lldb-commits] [lldb] r309664 - Expose process instance info via SB API
Vadim, this patch is breaking http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/11601 http://lab.llvm.org:8011/builders/lldb-windows7-android/builds/5560 http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-android/builds/6022 http://lab.llvm.org:8011/builders/lldb-x86_64-darwin-13.4/builds/5268 It looks like your test is failing on various platforms. I will skip your test, and rollback the patch in an hour if that doesn't clean things up. Obviously if within an hour you have a fix, thatwould be best! Just let me know! Sean On 8/1/17 12:34 AM, Vadim Macagon via lldb-commits wrote: Author: enlight Date: Tue Aug 1 00:34:26 2017 New Revision: 309664 URL: http://llvm.org/viewvc/llvm-project?rev=309664&view=rev Log: Expose process instance info via SB API Summary: Implement SBProcessInfo to wrap lldb_private::ProcessInstanceInfo, and add SBProcess::GetProcessInfo() to retrieve info like parent ID, group ID, user ID etc. from a live process. Differential Revision: https://reviews.llvm.org/D35881 Added: lldb/trunk/include/lldb/API/SBProcessInfo.h lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_process_info.py lldb/trunk/scripts/interface/SBProcessInfo.i lldb/trunk/source/API/SBProcessInfo.cpp Modified: lldb/trunk/include/lldb/API/LLDB.h lldb/trunk/include/lldb/API/SBDefines.h lldb/trunk/include/lldb/API/SBFileSpec.h lldb/trunk/include/lldb/API/SBProcess.h lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py lldb/trunk/scripts/interface/SBProcess.i lldb/trunk/scripts/lldb.swig lldb/trunk/source/API/CMakeLists.txt lldb/trunk/source/API/SBProcess.cpp Modified: lldb/trunk/include/lldb/API/LLDB.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/LLDB.h?rev=309664&r1=309663&r2=309664&view=diff == --- lldb/trunk/include/lldb/API/LLDB.h (original) +++ lldb/trunk/include/lldb/API/LLDB.h Tue Aug 1 00:34:26 2017 @@ -49,6 +49,7 @@ #include "lldb/API/SBModuleSpec.h" #include "lldb/API/SBPlatform.h" #include "lldb/API/SBProcess.h" +#include "lldb/API/SBProcessInfo.h" #include "lldb/API/SBQueue.h" #include "lldb/API/SBQueueItem.h" #include "lldb/API/SBSection.h" Modified: lldb/trunk/include/lldb/API/SBDefines.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDefines.h?rev=309664&r1=309663&r2=309664&view=diff == --- lldb/trunk/include/lldb/API/SBDefines.h (original) +++ lldb/trunk/include/lldb/API/SBDefines.h Tue Aug 1 00:34:26 2017 @@ -65,6 +65,7 @@ class LLDB_API SBModule; class LLDB_API SBModuleSpec; class LLDB_API SBModuleSpecList; class LLDB_API SBProcess; +class LLDB_API SBProcessInfo; class LLDB_API SBQueue; class LLDB_API SBQueueItem; class LLDB_API SBSection; Modified: lldb/trunk/include/lldb/API/SBFileSpec.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFileSpec.h?rev=309664&r1=309663&r2=309664&view=diff == --- lldb/trunk/include/lldb/API/SBFileSpec.h (original) +++ lldb/trunk/include/lldb/API/SBFileSpec.h Tue Aug 1 00:34:26 2017 @@ -65,6 +65,7 @@ private: friend class SBModuleSpec; friend class SBPlatform; friend class SBProcess; + friend class SBProcessInfo; friend class SBSourceManager; friend class SBThread; friend class SBTarget; Modified: lldb/trunk/include/lldb/API/SBProcess.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBProcess.h?rev=309664&r1=309663&r2=309664&view=diff == --- lldb/trunk/include/lldb/API/SBProcess.h (original) +++ lldb/trunk/include/lldb/API/SBProcess.h Tue Aug 1 00:34:26 2017 @@ -12,6 +12,7 @@ #include "lldb/API/SBDefines.h" #include "lldb/API/SBError.h" +#include "lldb/API/SBProcessInfo.h" #include "lldb/API/SBQueue.h" #include "lldb/API/SBTarget.h" #include @@ -380,6 +381,15 @@ public: //-- lldb::SBMemoryRegionInfoList GetMemoryRegions(); + //-- + /// Return information about the process. + /// + /// Valid process info will only be returned when the process is + /// alive, use SBProcessInfo::IsValid() to check returned info is + /// valid. + //-- + lldb::SBProcessInfo GetProcessInfo(); + protected: friend class SBAddress; friend class SBBreakpoint; Added: lldb/trunk/include/lldb/API/SBProcessInfo.h URL: http://llvm.org/viewv
[Lldb-commits] [lldb] r309714 - xfail test_get_process_info pending bot fixes
Author: spyffe Date: Tue Aug 1 10:43:54 2017 New Revision: 309714 URL: http://llvm.org/viewvc/llvm-project?rev=309714&view=rev Log: xfail test_get_process_info pending bot fixes Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py?rev=309714&r1=309713&r2=309714&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py Tue Aug 1 10:43:54 2017 @@ -328,6 +328,7 @@ class ProcessAPITestCase(TestBase): @add_test_categories(['pyapi']) @no_debug_info_test +@expectedFailureAll() # broken bots def test_get_process_info(self): """Test SBProcess::GetProcessInfo() API with a locally launched process.""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r314225 - [Expression Parser] Inhibit global lookups for symbols in the IR dynamic checks
Author: spyffe Date: Tue Sep 26 10:25:34 2017 New Revision: 314225 URL: http://llvm.org/viewvc/llvm-project?rev=314225&view=rev Log: [Expression Parser] Inhibit global lookups for symbols in the IR dynamic checks The IR dynamic checks are self-contained functions whose job is to - verify that pointers referenced in an expression are valid at runtime; and - verify that selectors sent to Objective-C objects by an expression are actually supported by that object. These dynamic checks forward-declare all the functions they use and should not require any external debug information. The way they ensure this is by marking all the names they use with a dollar sign ($). The expression parser recognizes such symbols and perform no lookups for them. This patch fixes three issues surrounding the use of the dollar sign: - to fix a MIPS issue, the name of the pointer checker was changed from starting with $ to starting with _$, but this was not properly ignored; and - the Objective-C object checker used a temporary variable that did not start with $. - the Objective-C object checker used an externally-defined struct (struct objc_selector) but didn't need to. The patch also implements some cleanup in the area: - it reformats the string containing the Objective-C object checker, which was mangled horribly when the code was transformed to a uniform width of 80 columns, and - it factors out the logic for ignoring global $-symbols into common code shared between ClangASTSource and ClangExpressionDeclMap. Differential Revision: https://reviews.llvm.org/D38153 Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp?rev=314225&r1=314224&r2=314225&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp Tue Sep 26 10:25:34 2017 @@ -623,6 +623,25 @@ void ClangASTSource::FindExternalVisible } } +bool ClangASTSource::IgnoreName(const ConstString name, +bool ignore_all_dollar_names) { + static const ConstString id_name("id"); + static const ConstString Class_name("Class"); + + if (name == id_name || name == Class_name) +return true; + + StringRef name_string_ref = name.GetStringRef(); + + // The ClangASTSource is not responsible for finding $-names. + if (name_string_ref.empty() || + (ignore_all_dollar_names && name_string_ref.startswith("$")) || + name_string_ref.startswith("_$")) +return true; + + return false; +} + void ClangASTSource::FindExternalVisibleDecls( NameSearchContext &context, lldb::ModuleSP module_sp, CompilerDeclContext &namespace_decl, unsigned int current_id) { @@ -633,20 +652,7 @@ void ClangASTSource::FindExternalVisible SymbolContextList sc_list; const ConstString name(context.m_decl_name.getAsString().c_str()); - - const char *name_unique_cstr = name.GetCString(); - - static ConstString id_name("id"); - static ConstString Class_name("Class"); - - if (name == id_name || name == Class_name) -return; - - if (name_unique_cstr == NULL) -return; - - // The ClangASTSource is not responsible for finding $-names. - if (name_unique_cstr[0] == '$') + if (IgnoreName(name, true)) return; if (module_sp && namespace_decl) { Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h?rev=314225&r1=314224&r2=314225&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h Tue Sep 26 10:25:34 2017 @@ -376,6 +376,22 @@ protected: //-- CompilerType GuardedCopyType(const CompilerType &src_type); + + //-- + /// Returns true if a name should be ignored by name lookup. + /// + /// @param[in] name + /// The name to be considered. + /// + /// @param[in] ignore_all_dollar_nmmes + /// True if $-names of all sorts should be ignored. + /// + /// @return + /// True if the name is one of a class of names that are ignored by + /// global lookup for performance reasons. + //--
[Lldb-commits] [lldb] r314458 - [Expression parser] Setting to enable use of ExternalASTMerger
Author: spyffe Date: Thu Sep 28 13:20:25 2017 New Revision: 314458 URL: http://llvm.org/viewvc/llvm-project?rev=314458&view=rev Log: [Expression parser] Setting to enable use of ExternalASTMerger This setting can be enabled like this at the target level: (lldb) settings set target.experimental.use-modern-type-lookup true This causes several new behaviors in the Clang expression parser: - It completely disables use of ClangASTImporter. None are created at all, and all users of it are now conditionalized on its presence. - It instead constructs a per-expression ExternalASTMerger, which exists inside Clang and contains much of the type completion logic that hitherto lived in ExternalASTSource, ClangExpressionDeclMap, and ClangASTImporter. - The expression parser uses this Merger as a backend for copying and completing types. - It also constructs a persistent ExternalASTMerger which is connected to the Target's persistent AST context. This is a major chunk of LLDB functionality moved into Clang. It can be tested in two ways: 1. For an individual debug session, enable the setting before running a target. 2. For the testsuite, change the option to be default-true. This is done in Target.cpp's g_experimental_properties. The testsuite is not yet clean with this, so I have not committed that switch. I have filed a Bugzilla for extending the testsuite to allow custom settings for all tests: https://bugs.llvm.org/show_bug.cgi?id=34771 I have also filed a Bugzilla for fixing the remaining testsuite failures with this setting enabled: https://bugs.llvm.org/show_bug.cgi?id=34772 Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/include/lldb/Symbol/DeclVendor.h lldb/trunk/include/lldb/Target/Target.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=314458&r1=314457&r2=314458&view=diff == --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Thu Sep 28 13:20:25 2017 @@ -25,6 +25,7 @@ // Other libraries and framework includes #include "clang/AST/ASTContext.h" +#include "clang/AST/ExternalASTMerger.h" #include "clang/AST/TemplateBase.h" #include "llvm/ADT/SmallVector.h" @@ -964,7 +965,10 @@ public: clang::DeclarationName GetDeclarationName(const char *name, const CompilerType &function_clang_type); - + + virtual const clang::ExternalASTMerger::OriginMap &GetOriginMap() { +return m_origins; + } protected: //-- // Classes that inherit from ClangASTContext can see and modify these @@ -990,6 +994,7 @@ protected: CompleteTagDeclCallback m_callback_tag_decl; CompleteObjCInterfaceDeclCallback m_callback_objc_decl; void * m_callback_baton; +clang::ExternalASTMerger::OriginMap m_origins; uint32_tm_pointer_byte_size; boolm_ast_owned; boolm_can_evaluate_expressions; @@ -1023,7 +1028,12 @@ public: const char *name) override; PersistentExpressionState *GetPersistentExpressionState() override; - + + clang::ExternalASTMerger &GetMergerUnchecked(); + + const clang::ExternalASTMerger::OriginMap &GetOriginMap() override { +return GetMergerUnchecked().GetOrigins(); + } private: lldb::TargetWP m_target_wp; lldb::ClangPersistentVariablesUP m_persistent_variables; ///< These are the Modified: lldb/trunk/include/lldb/Symbol/DeclVendor.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/DeclVendor.h?rev=314458&r1=314457&r2=314458&view=diff == --- lldb/trunk/include/lldb/Symbol/DeclVendor.h (original) +++ lldb/trunk/include/lldb/Symbol/DeclVendor.h Thu Sep 28 13:20:25 2017 @@ -13,6 +13,8 @@ #include "lldb/Core
[Lldb-commits] [lldb] r283604 - Remove a stray dump().
Author: spyffe Date: Fri Oct 7 16:25:29 2016 New Revision: 283604 URL: http://llvm.org/viewvc/llvm-project?rev=283604&view=rev Log: Remove a stray dump(). Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRExecutionUnit.cpp?rev=283604&r1=283603&r2=283604&view=diff == --- lldb/trunk/source/Expression/IRExecutionUnit.cpp (original) +++ lldb/trunk/source/Expression/IRExecutionUnit.cpp Fri Oct 7 16:25:29 2016 @@ -1023,8 +1023,6 @@ void IRExecutionUnit::GetStaticInitializ 3); // this is standardized if (llvm::Function *ctor_function = llvm::dyn_cast(ctor_struct->getOperand(1))) { -ctor_function->dump(); - ConstString ctor_function_name_cs(ctor_function->getName().str()); for (JittedFunction &jitted_function : m_jitted_functions) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r283904 - Clarified the explanation of expr --top-level.
Author: spyffe Date: Tue Oct 11 11:57:21 2016 New Revision: 283904 URL: http://llvm.org/viewvc/llvm-project?rev=283904&view=rev Log: Clarified the explanation of expr --top-level. Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=283904&r1=283903&r2=283904&view=diff == --- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Tue Oct 11 11:57:21 2016 @@ -62,8 +62,8 @@ static OptionDefinition g_expression_opt "setting is used." }, {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "apply-fixits", 'X', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeLanguage, "If true, simple fix-it hints will be automatically applied to the expression." }, {LLDB_OPT_SET_1, false, "description-verbosity", 'v', OptionParser::eOptionalArgument, nullptr, g_description_verbosity_type, 0, eArgTypeDescriptionVerbosity, "How verbose should the output of this expression be, if the object description is asked for."}, - {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "top-level", 'p', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Interpret the expression as top-level definitions rather than code to be immediately " - "executed."}, + {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "top-level", 'p', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Interpret the expression as a complete translation unit, without injecting it into the local " + "context. Allows declaration of persistent, top-level entities without a $ prefix."}, {LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "allow-jit", 'j', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeBoolean, "Controls whether the expression can fall back to being JITted if it's not supported by " "the interpreter (defaults to true)."} // clang-format on ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284674 - Added a decorator for the macOS version and switched over testcases that used platform.release
Author: spyffe Date: Wed Oct 19 19:03:39 2016 New Revision: 284674 URL: http://llvm.org/viewvc/llvm-project?rev=284674&view=rev Log: Added a decorator for the macOS version and switched over testcases that used platform.release Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py lldb/trunk/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=284674&r1=284673&r2=284674&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Wed Oct 19 19:03:39 2016 @@ -157,6 +157,7 @@ def _decorateTest(mode, archs=None, triple=None, debug_info=None, swig_version=None, py_version=None, + macos_version=None, remote=None): def fn(self): skip_for_os = _match_decorator_property( @@ -187,6 +188,11 @@ def _decorateTest(mode, skip_for_py_version = ( py_version is None) or _check_expected_version( py_version[0], py_version[1], sys.version_info) +skip_for_macos_version = (macos_version is None) or ( +_check_expected_version( +macos_version[0], +macos_version[1], +platform.mac_ver()[0])) # For the test to be skipped, all specified (e.g. not None) parameters must be True. # An unspecified parameter means "any", so those are marked skip by default. And we skip @@ -199,6 +205,7 @@ def _decorateTest(mode, (triple, skip_for_triple, "target triple"), (swig_version, skip_for_swig_version, "swig version"), (py_version, skip_for_py_version, "python version"), + (macos_version, skip_for_macos_version, "macOS version"), (remote, skip_for_remote, "platform locality (remote/local)")] reasons = [] final_skip_result = True @@ -242,6 +249,7 @@ def expectedFailureAll(bugnumber=None, archs=None, triple=None, debug_info=None, swig_version=None, py_version=None, + macos_version=None, remote=None): return _decorateTest(DecorateMode.Xfail, bugnumber=bugnumber, @@ -250,6 +258,7 @@ def expectedFailureAll(bugnumber=None, archs=archs, triple=triple, debug_info=debug_info, swig_version=swig_version, py_version=py_version, + macos_version=None, remote=remote) @@ -265,6 +274,7 @@ def skipIf(bugnumber=None, archs=None, triple=None, debug_info=None, swig_version=None, py_version=None, + macos_version=None, remote=None): return _decorateTest(DecorateMode.Skip, bugnumber=bugnumber, @@ -273,6 +283,7 @@ def skipIf(bugnumber=None, archs=archs, triple=triple, debug_info=debug_info, swig_version=swig_version, py_version=py_version, + macos_version=macos_version, remote=remote) Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py?rev=284674&r1=284673&r2=284674&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py Wed Oct 19 19:03:39 2016 @@ -25,10 +25,8 @@ class CModulesTestCase(TestBase): @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows") +@skipIf(macos_version=["<", "10.12"]) def test_expr(self): -if platform.system() == "Darwin" and platform.release() < StrictVersion('12.0.0'): -self.skipTest() - self.build
[Lldb-commits] [lldb] r288386 - Handle UTF-16 and UTF-32 constant CFStrings
Author: spyffe Date: Thu Dec 1 11:46:51 2016 New Revision: 288386 URL: http://llvm.org/viewvc/llvm-project?rev=288386&view=rev Log: Handle UTF-16 and UTF-32 constant CFStrings We have a longstanding issue where the expression parser does not handle wide CFStrings (e.g., @"凸凹") correctly, producing the useless error message Internal error [IRForTarget]: An Objective-C constant string's string initializer is not an array error: warning: expression result unused error: The expression could not be prepared to run in the target This is just a side effect of the fact that we don't handle wide string constants when converting these to CFStringCreateWithBytes. That function takes the string's encoding as an argument, so I made it work and added a testcase. https://reviews.llvm.org/D27291 Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py?rev=288386&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py Thu Dec 1 11:46:51 2016 @@ -0,0 +1,6 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest( +__file__, globals(), [ +decorators.skipUnlessDarwin]) Added: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m?rev=288386&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m (added) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m Thu Dec 1 11:46:51 2016 @@ -0,0 +1,5 @@ +#import + +int main() { + NSLog(@"å¸"); //% self.expect("po @\"å¹\"", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["å¹"]) +} Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp?rev=288386&r1=288385&r2=288386&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp Thu Dec 1 11:46:51 2016 @@ -498,42 +498,60 @@ bool IRForTarget::RewriteObjCConstString Constant *bytes_arg = cstr ? ConstantExpr::getBitCast(cstr, i8_ptr_ty) : Constant::getNullValue(i8_ptr_ty); Constant *numBytes_arg = ConstantInt::get( - m_intptr_ty, cstr ? string_array->getNumElements() - 1 : 0, false); - Constant *encoding_arg = ConstantInt::get( - i32_ty, 0x0600, false); /* 0x0600 is kCFStringEncodingASCII */ - Constant *isExternal_arg = - ConstantInt::get(i8_ty, 0x0, false); /* 0x0 is false */ - - Value *argument_array[5]; - - argument_array[0] = alloc_arg; - argument_array[1] = bytes_arg; - argument_array[2] = numBytes_arg; - argument_array[3] = encoding_arg; - argument_array[4] = isExternal_arg; - - ArrayRef CFSCWB_arguments(argument_array, 5); - - FunctionValueCache CFSCWB_Caller( - [this, &CFSCWB_arguments](llvm::Function *function) -> llvm::Value * { -return CallInst::Create( -m_CFStringCreateWithBytes, CFSCWB_arguments, -"CFStringCreateWithBytes", -llvm::cast( -m_entry_instruction_finder.GetValue(function))); - }); - - if (!UnfoldConstant(ns_str, nullptr, CFSCWB_Caller, - m_entry_instruction_finder, m_error_stream)) { -if (log) - log->PutCString( - "Couldn't replace the NSString with the result of the call"); - -m_error_stream.Printf("error [IRForTarget internal]: Couldn't replace an " - "Objective-C constant string with a dynamic " - "string\n"); + m_intptr_ty, cstr ? (string_array->getNumElements() - 1) * string_array->getElementByteSize() : 0, false); + int encoding_flags = 0; + switch (string_array->getElementByteSize()) { + case 1: + encoding_flags = 0x08000100; /* 0x08000100 is kCFStringEncodingUTF8 */ + break; + case 2: + encoding_flags = 0x0100; /* 0x0100 is kCFStringEncodingUTF16 */ + break; + case 4: + encoding_flags = 0x0c000100; /* 0x0c000100 i
Re: [Lldb-commits] [lldb] r288386 - Handle UTF-16 and UTF-32 constant CFStrings
It's definitely this one. I'll have a fix or a revert in the next 30 minutes. > On Dec 1, 2016, at 10:58 AM, Tim Hammerquist wrote: > > Builds with this patch have been failing due to a segfaulting testcase. See: > > http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22721/ > <http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22721/> > http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22722/ > <http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22722/> > > At first glance, it's possible the failure was introduced by either this > commit (r288386) or possibly r288372. > > -Tim > > > On Thu, Dec 1, 2016 at 9:46 AM, Sean Callanan via lldb-commits > mailto:lldb-commits@lists.llvm.org>> wrote: > Author: spyffe > Date: Thu Dec 1 11:46:51 2016 > New Revision: 288386 > > URL: http://llvm.org/viewvc/llvm-project?rev=288386&view=rev > <http://llvm.org/viewvc/llvm-project?rev=288386&view=rev> > Log: > Handle UTF-16 and UTF-32 constant CFStrings > > We have a longstanding issue where the expression parser does not handle wide > CFStrings (e.g., @"凸凹") correctly, producing the useless error message > > Internal error [IRForTarget]: An Objective-C constant string's string > initializer is not an array > error: warning: expression result unused > error: The expression could not be prepared to run in the target > > This is just a side effect of the fact that we don't handle wide string > constants when converting these to CFStringCreateWithBytes. That function > takes the string's encoding as an argument, so I made it work and added a > testcase. > > https://reviews.llvm.org/D27291 <https://reviews.llvm.org/D27291> > > > Added: > lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/ > > lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py > lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m > Modified: > lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp > > Added: > lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py?rev=288386&view=auto > > <http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py?rev=288386&view=auto> > == > --- > lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py > (added) > +++ > lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py > Thu Dec 1 11:46:51 2016 > @@ -0,0 +1,6 @@ > +from lldbsuite.test import lldbinline > +from lldbsuite.test import decorators > + > +lldbinline.MakeInlineTest( > +__file__, globals(), [ > +decorators.skipUnlessDarwin]) > > Added: > lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m?rev=288386&view=auto > > <http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m?rev=288386&view=auto> > == > --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m > (added) > +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m > Thu Dec 1 11:46:51 2016 > @@ -0,0 +1,5 @@ > +#import > + > +int main() { > + NSLog(@"凸"); //% self.expect("po @\"凹\"", > DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["凹"]) > +} > > Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp?rev=288386&r1=288385&r2=288386&view=diff > > <http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp?rev=288386&r1=288385&r2=288386&view=diff> > == > --- lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp > (original) > +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp Thu Dec > 1 11:46:51 2016 > @@ -498,42 +498,60 @@ bool IRForTarget::RewriteObjCConstString >Constant *byte
Re: [Lldb-commits] [lldb] r288386 - Handle UTF-16 and UTF-32 constant CFStrings
It'll be a fix. ETA 10 minutes. > On Dec 1, 2016, at 11:16 AM, Sean Callanan via lldb-commits > wrote: > > It's definitely this one. I'll have a fix or a revert in the next 30 minutes. >> On Dec 1, 2016, at 10:58 AM, Tim Hammerquist > <mailto:pen...@gmail.com>> wrote: >> >> Builds with this patch have been failing due to a segfaulting testcase. See: >> >> http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22721/ >> <http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22721/> >> http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22722/ >> <http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22722/> >> >> At first glance, it's possible the failure was introduced by either this >> commit (r288386) or possibly r288372. >> >> -Tim >> >> >> On Thu, Dec 1, 2016 at 9:46 AM, Sean Callanan via lldb-commits >> mailto:lldb-commits@lists.llvm.org>> wrote: >> Author: spyffe >> Date: Thu Dec 1 11:46:51 2016 >> New Revision: 288386 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=288386&view=rev >> <http://llvm.org/viewvc/llvm-project?rev=288386&view=rev> >> Log: >> Handle UTF-16 and UTF-32 constant CFStrings >> >> We have a longstanding issue where the expression parser does not handle >> wide CFStrings (e.g., @"凸凹") correctly, producing the useless error message >> >> Internal error [IRForTarget]: An Objective-C constant string's string >> initializer is not an array >> error: warning: expression result unused >> error: The expression could not be prepared to run in the target >> >> This is just a side effect of the fact that we don't handle wide string >> constants when converting these to CFStringCreateWithBytes. That function >> takes the string's encoding as an argument, so I made it work and added a >> testcase. >> >> https://reviews.llvm.org/D27291 <https://reviews.llvm.org/D27291> >> > >> >> Added: >> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/ >> >> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py >> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m >> Modified: >> lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp >> >> Added: >> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py?rev=288386&view=auto >> >> <http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py?rev=288386&view=auto> >> == >> --- >> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py >> (added) >> +++ >> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py >> Thu Dec 1 11:46:51 2016 >> @@ -0,0 +1,6 @@ >> +from lldbsuite.test import lldbinline >> +from lldbsuite.test import decorators >> + >> +lldbinline.MakeInlineTest( >> +__file__, globals(), [ >> +decorators.skipUnlessDarwin]) >> >> Added: >> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m?rev=288386&view=auto >> >> <http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m?rev=288386&view=auto> >> == >> --- >> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m >> (added) >> +++ >> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m >> Thu Dec 1 11:46:51 2016 >> @@ -0,0 +1,5 @@ >> +#import >> + >> +int main() { >> + NSLog(@"凸"); //% self.expect("po @\"凹\"", >> DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["凹"]) >> +} >> >> Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp?rev=288386&r1=288385&r2=288
[Lldb-commits] [lldb] r288403 - Handle empty strings when looking for a CFString's encoding.
Author: spyffe Date: Thu Dec 1 13:14:55 2016 New Revision: 288403 URL: http://llvm.org/viewvc/llvm-project?rev=288403&view=rev Log: Handle empty strings when looking for a CFString's encoding. Should fix the bots. Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp?rev=288403&r1=288402&r2=288403&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp Thu Dec 1 13:14:55 2016 @@ -500,7 +500,7 @@ bool IRForTarget::RewriteObjCConstString Constant *numBytes_arg = ConstantInt::get( m_intptr_ty, cstr ? (string_array->getNumElements() - 1) * string_array->getElementByteSize() : 0, false); int encoding_flags = 0; - switch (string_array->getElementByteSize()) { + switch (cstr ? string_array->getElementByteSize() : 1) { case 1: encoding_flags = 0x08000100; /* 0x08000100 is kCFStringEncodingUTF8 */ break; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r288386 - Handle UTF-16 and UTF-32 constant CFStrings
$ svn commit Sendingsource/Plugins/ExpressionParser/Clang/IRForTarget.cpp Transmitting file data .done Committing transaction... Committed revision 288403. Sorry for the noise, folks. Sean > On Dec 1, 2016, at 11:21 AM, Sean Callanan wrote: > > It'll be a fix. ETA 10 minutes. > >> On Dec 1, 2016, at 11:16 AM, Sean Callanan via lldb-commits >> mailto:lldb-commits@lists.llvm.org>> wrote: >> >> It's definitely this one. I'll have a fix or a revert in the next 30 >> minutes. >>> On Dec 1, 2016, at 10:58 AM, Tim Hammerquist >> <mailto:pen...@gmail.com>> wrote: >>> >>> Builds with this patch have been failing due to a segfaulting testcase. See: >>> >>> http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22721/ >>> <http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22721/> >>> http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22722/ >>> <http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/22722/> >>> >>> At first glance, it's possible the failure was introduced by either this >>> commit (r288386) or possibly r288372. >>> >>> -Tim >>> >>> >>> On Thu, Dec 1, 2016 at 9:46 AM, Sean Callanan via lldb-commits >>> mailto:lldb-commits@lists.llvm.org>> wrote: >>> Author: spyffe >>> Date: Thu Dec 1 11:46:51 2016 >>> New Revision: 288386 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=288386&view=rev >>> <http://llvm.org/viewvc/llvm-project?rev=288386&view=rev> >>> Log: >>> Handle UTF-16 and UTF-32 constant CFStrings >>> >>> We have a longstanding issue where the expression parser does not handle >>> wide CFStrings (e.g., @"凸凹") correctly, producing the useless error message >>> >>> Internal error [IRForTarget]: An Objective-C constant string's string >>> initializer is not an array >>> error: warning: expression result unused >>> error: The expression could not be prepared to run in the target >>> >>> This is just a side effect of the fact that we don't handle wide string >>> constants when converting these to CFStringCreateWithBytes. That function >>> takes the string's encoding as an argument, so I made it work and added a >>> testcase. >>> >>> https://reviews.llvm.org/D27291 <https://reviews.llvm.org/D27291> >>> > >>> >>> Added: >>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/ >>> >>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py >>> >>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m >>> Modified: >>> lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp >>> >>> Added: >>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py?rev=288386&view=auto >>> >>> <http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py?rev=288386&view=auto> >>> == >>> --- >>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py >>> (added) >>> +++ >>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py >>> Thu Dec 1 11:46:51 2016 >>> @@ -0,0 +1,6 @@ >>> +from lldbsuite.test import lldbinline >>> +from lldbsuite.test import decorators >>> + >>> +lldbinline.MakeInlineTest( >>> +__file__, globals(), [ >>> +decorators.skipUnlessDarwin]) >>> >>> Added: >>> lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m?rev=288386&view=auto >>> >>> <http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/unicode-string/main.m?rev=288386&view=auto> >>> == >>> --- >>> lldb/trunk/packages/Python/lldbsuite/test/lang/obj
[Lldb-commits] [lldb] r289711 - Adopt PrettyStackTrace in LLDB
Author: spyffe Date: Wed Dec 14 15:31:31 2016 New Revision: 289711 URL: http://llvm.org/viewvc/llvm-project?rev=289711&view=rev Log: Adopt PrettyStackTrace in LLDB LLDB needs some minor changes to adopt PrettyStackTrace after https://reviews.llvm.org/D27683. We remove our own SetCrashDescription() function and use LLVM-provided RAII objects instead. We also make sure LLDB doesn't define __crashtracer_info__ which would collide with LLVM's definition. Differential Revision: https://reviews.llvm.org/D27735 Modified: lldb/trunk/include/lldb/Host/Host.h lldb/trunk/scripts/Xcode/build-llvm.py lldb/trunk/source/API/SBFrame.cpp lldb/trunk/source/API/SBTarget.cpp lldb/trunk/source/Host/common/Host.cpp lldb/trunk/source/Host/macosx/Host.mm lldb/trunk/source/Initialization/SystemInitializerCommon.cpp lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Modified: lldb/trunk/include/lldb/Host/Host.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Host.h?rev=289711&r1=289710&r2=289711&view=diff == --- lldb/trunk/include/lldb/Host/Host.h (original) +++ lldb/trunk/include/lldb/Host/Host.h Wed Dec 14 15:31:31 2016 @@ -183,23 +183,6 @@ public: //-- static bool ResolveExecutableInBundle(FileSpec &file); - //-- - /// Set a string that can be displayed if host application crashes. - /// - /// Some operating systems have the ability to print a description - /// for shared libraries when a program crashes. If the host OS - /// supports such a mechanism, it should be implemented to help - /// with crash triage. - /// - /// @param[in] format - /// A printf format that will be used to form a new crash - /// description string. - //-- - static void SetCrashDescriptionWithFormat(const char *format, ...) - __attribute__((format(printf, 1, 2))); - - static void SetCrashDescription(const char *description); - static uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info, ProcessInstanceInfoList &proc_infos); Modified: lldb/trunk/scripts/Xcode/build-llvm.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=289711&r1=289710&r2=289711&view=diff == --- lldb/trunk/scripts/Xcode/build-llvm.py (original) +++ lldb/trunk/scripts/Xcode/build-llvm.py Wed Dec 14 15:31:31 2016 @@ -346,7 +346,8 @@ def cmake_flags(): "-DCMAKE_C_FLAGS={}".format(get_c_flags()), "-DCMAKE_CXX_FLAGS={}".format(get_cxx_flags()), "-DCMAKE_EXE_LINKER_FLAGS={}".format(get_exe_linker_flags()), - "-DCMAKE_SHARED_LINKER_FLAGS={}".format(get_shared_linker_flags())] + "-DCMAKE_SHARED_LINKER_FLAGS={}".format(get_shared_linker_flags()), +"-DHAVE_CRASHREPORTER_INFO=1"] deployment_target = get_deployment_target() if deployment_target: cmake_flags.append( Modified: lldb/trunk/source/API/SBFrame.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=289711&r1=289710&r2=289711&view=diff == --- lldb/trunk/source/API/SBFrame.cpp (original) +++ lldb/trunk/source/API/SBFrame.cpp Wed Dec 14 15:31:31 2016 @@ -52,6 +52,8 @@ #include "lldb/API/SBValue.h" #include "lldb/API/SBVariablesOptions.h" +#include "llvm/Support/PrettyStackTrace.h" + using namespace lldb; using namespace lldb_private; @@ -1288,10 +1290,11 @@ lldb::SBValue SBFrame::EvaluateExpressio if (stop_locker.TryLock(&process->GetRunLock())) { frame = exe_ctx.GetFramePtr(); if (frame) { +std::unique_ptr PST; if (target->GetDisplayExpressionsInCrashlogs()) { StreamString frame_description; frame->DumpUsingSettingsFormat(&frame_description); - Host::SetCrashDescriptionWithFormat( + PST = llvm::make_unique( "SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value " "= %u) %s", expr, options.GetFetchDynamicValue(), @@ -1301,9 +1304,6 @@ lldb::SBValue SBFrame::EvaluateExpressio exe_results = target->EvaluateExpression(expr, frame, expr_value_sp, options.ref()); expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue()); - -if (target->GetDisplayExpressionsInCrashlogs()) - Host::SetCrashDescription(nullptr); } else { if (log) log->Printf("SBFrame::EvaluateEx
[Lldb-commits] [lldb] r290282 - specify -DNDEBUG for BNI builds of all targets in the Xcode build
Author: spyffe Date: Wed Dec 21 17:21:11 2016 New Revision: 290282 URL: http://llvm.org/viewvc/llvm-project?rev=290282&view=rev Log: specify -DNDEBUG for BNI builds of all targets in the Xcode build Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=290282&r1=290281&r2=290282&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Dec 21 17:21:11 2016 @@ -8997,6 +8997,7 @@ "$(LLDB_COMPRESSION_CFLAGS)", "$(LLDB_COVERAGE_CFLAGS)", "-Wimplicit-fallthrough", + "-DNDEBUG", ); OTHER_LDFLAGS = ( "$(LLDB_COMPRESSION_LDFLAGS)", ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r293020 - Conditionalized OsLogger.cpp on a modern SDK.
Author: spyffe Date: Tue Jan 24 23:18:32 2017 New Revision: 293020 URL: http://llvm.org/viewvc/llvm-project?rev=293020&view=rev Log: Conditionalized OsLogger.cpp on a modern SDK. Modified: lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp Modified: lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp?rev=293020&r1=293019&r2=293020&view=diff == --- lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp (original) +++ lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp Tue Jan 24 23:18:32 2017 @@ -8,8 +8,9 @@ //===--===// #include "OsLogger.h" +#include -#if LLDB_USE_OS_LOG +#if (LLDB_USE_OS_LOG) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 101200) #include @@ -64,3 +65,4 @@ DNBCallbackLog OsLogger::GetLogFunction( DNBCallbackLog OsLogger::GetLogFunction() { return nullptr; } #endif + ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r293022 - Reverted 292880 to fix a linker error.
Author: spyffe Date: Tue Jan 24 23:39:14 2017 New Revision: 293022 URL: http://llvm.org/viewvc/llvm-project?rev=293022&view=rev Log: Reverted 292880 to fix a linker error. Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=293022&r1=293021&r2=293022&view=diff == --- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original) +++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Tue Jan 24 23:39:14 2017 @@ -713,7 +713,6 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ""; - "OTHER_LDFLAGS[sdk=macosx*]" = ""; STRIP_INSTALLED_PRODUCT = NO; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_BUILDER = "$(USER)"; @@ -884,8 +883,6 @@ MobileCoreServices, "$(LLDB_COMPRESSION_LDFLAGS)", "$(LLDB_ZLIB_LDFLAGS)", - "-weak_framework", - LoggingSupport, ); "OTHER_LDFLAGS[sdk=macosx*]" = ( "-sectcreate", @@ -895,8 +892,6 @@ "$(LLDB_ENERGY_LFLAGS)", "$(LLDB_COMPRESSION_LDFLAGS)", "$(LLDB_ZLIB_LDFLAGS)", - "-weak_framework", - LoggingSupport, ); OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)"; PRODUCT_NAME = debugserver; @@ -990,8 +985,6 @@ MobileCoreServices, "$(LLDB_COMPRESSION_LDFLAGS)", "$(LLDB_ZLIB_LDFLAGS)", - "-weak_framework", - LoggingSupport, ); "OTHER_LDFLAGS[sdk=macosx*]" = ( "-sectcreate", @@ -1001,8 +994,6 @@ "$(LLDB_ENERGY_LFLAGS)", "$(LLDB_ZLIB_LDFLAGS)", "$(LLDB_COMPRESSION_LDFLAGS)", - "-weak_framework", - LoggingSupport, ); OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)"; PRODUCT_NAME = debugserver; @@ -1095,8 +1086,6 @@ MobileCoreServices, "$(LLDB_COMPRESSION_LDFLAGS)", "$(LLDB_ZLIB_LDFLAGS)", - "-weak_framework", - LoggingSupport, ); "OTHER_LDFLAGS[sdk=macosx*]" = ( "-sectcreate", @@ -1106,8 +1095,6 @@ "$(LLDB_ENERGY_LFLAGS)", "$(LLDB_COMPRESSION_LDFLAGS)", "$(LLDB_ZLIB_LDFLAGS)", - "-weak_framework", - LoggingSupport, ); OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)"; PRODUCT_NAME = debugserver; @@ -1188,8 +1175,6 @@ "OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = ( "-framework", Foundation, - "-weak_framework", - LoggingSupport, ); "OTHER_LDFLAGS[sdk=macosx*]" = ( "-sectcreate", @@ -1197,8 +1182,6 @@ __info_plist, "$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist", "$(LLDB_ENERGY_LFLAGS)", - "-weak_framework", - LoggingSupport,
[Lldb-commits] [lldb] r293098 - Link debugserver against Foundation to get access to NSProcessInfo.
Author: spyffe Date: Wed Jan 25 15:32:00 2017 New Revision: 293098 URL: http://llvm.org/viewvc/llvm-project?rev=293098&view=rev Log: Link debugserver against Foundation to get access to NSProcessInfo. debugserver-mini can't use Foundation so disable that code there. Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=293098&r1=293097&r2=293098&view=diff == --- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original) +++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Wed Jan 25 15:32:00 2017 @@ -98,6 +98,7 @@ 456F67691AD46CE9002850C2 /* DNBArchImplARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266B5ECF1460A68200E43F0A /* DNBArchImplARM64.cpp */; }; 456F676B1AD46CE9002850C2 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26ACA3340D3E956300A2120B /* CoreFoundation.framework */; settings = {ATTRIBUTES = (Required, ); }; }; 4971AE7213D10F4F00649E37 /* HasAVX.s in Sources */ = {isa = PBXBuildFile; fileRef = 4971AE7113D10F4F00649E37 /* HasAVX.s */; }; + 49D404621E39260F00570CDC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49D404611E39260F00570CDC /* Foundation.framework */; }; AF48558C1D75126800D19C07 /* StdStringExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF48558B1D75126800D19C07 /* StdStringExtractor.cpp */; }; AF48558D1D75127500D19C07 /* StdStringExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF48558B1D75126800D19C07 /* StdStringExtractor.cpp */; }; AFEC3364194A8B0B00FF05C6 /* Genealogy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFEC3363194A8B0B00FF05C6 /* Genealogy.cpp */; }; @@ -210,6 +211,7 @@ 456F67721AD46CE9002850C2 /* debugserver-nonui */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "debugserver-nonui"; sourceTree = BUILT_PRODUCTS_DIR; }; 4971AE7013D10F4F00649E37 /* HasAVX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HasAVX.h; sourceTree = ""; }; 4971AE7113D10F4F00649E37 /* HasAVX.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = HasAVX.s; sourceTree = ""; }; + 49D404611E39260F00570CDC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 49F530111331519C008956F6 /* MachRegisterStatesI386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachRegisterStatesI386.h; sourceTree = ""; }; 49F5301213316D7F008956F6 /* MachRegisterStatesX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachRegisterStatesX86_64.h; sourceTree = ""; }; 9457ECF61419864100DFE7D8 /* stack_logging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stack_logging.h; sourceTree = ""; }; @@ -232,6 +234,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 49D404621E39260F00570CDC /* Foundation.framework in Frameworks */, 26CE05CF115C36F70022F371 /* CoreFoundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -253,6 +256,7 @@ 26ACA3330D3E94F200A2120B /* Framework */, 26C637D50C71334A0024798E /* source */, 1AB674ADFE9D54B511CA2CBB /* Products */, + 49D404601E39260F00570CDC /* Frameworks */, ); name = dbgnub; sourceTree = ""; @@ -483,6 +487,14 @@ sourceTree = ""; usesTabs = 0; }; + 49D404601E39260F00570CDC /* Frameworks */ = { + isa = PBXGroup; + children = ( + 49D404611E39260F00570CDC /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -874,8
[Lldb-commits] [lldb] r293161 - Removed an unneccesary #if now that debugserver-mini links Foundation.
Author: spyffe Date: Thu Jan 26 02:51:32 2017 New Revision: 293161 URL: http://llvm.org/viewvc/llvm-project?rev=293161&view=rev Log: Removed an unneccesary #if now that debugserver-mini links Foundation. Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=293161&r1=293160&r2=293161&view=diff == --- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm (original) +++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Thu Jan 26 02:51:32 2017 @@ -2449,8 +2449,6 @@ bool MachProcess::GetOSVersionNumbers(ui #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \ (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101000) return false; -#elif defined(OS_OBJECT_USE_OBJC) && (OS_OBJECT_USE_OBJC == 0) - return false; #else NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r295522 - Updated the results formatter to eliminate redundant data.
Author: spyffe Date: Fri Feb 17 19:07:51 2017 New Revision: 295522 URL: http://llvm.org/viewvc/llvm-project?rev=295522&view=rev Log: Updated the results formatter to eliminate redundant data. The testsuite's results formatter maintains a result_status_counts structure solely for the purpose of setting the return status code after the testsuite has run. This data is redundant with the result_events structure that contains the results of individual tests. There are subtle bugs arising from this redundancy that make some builds report no errors but a nonzero status. Rather than try to make sure these two are always in agreement, I've just rewritten the code that used to use the counts to now use the per-test results. Modified: lldb/trunk/packages/Python/lldbsuite/test_event/formatter/results_formatter.py Modified: lldb/trunk/packages/Python/lldbsuite/test_event/formatter/results_formatter.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test_event/formatter/results_formatter.py?rev=295522&r1=295521&r2=295522&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test_event/formatter/results_formatter.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test_event/formatter/results_formatter.py Fri Feb 17 19:07:51 2017 @@ -126,19 +126,6 @@ class ResultsFormatter(object): self.terminate_called = False self.file_is_stream = file_is_stream -# Store counts of test_result events by status. -self.result_status_counts = { -EventBuilder.STATUS_SUCCESS: 0, -EventBuilder.STATUS_EXPECTED_FAILURE: 0, -EventBuilder.STATUS_EXPECTED_TIMEOUT: 0, -EventBuilder.STATUS_SKIP: 0, -EventBuilder.STATUS_UNEXPECTED_SUCCESS: 0, -EventBuilder.STATUS_FAILURE: 0, -EventBuilder.STATUS_ERROR: 0, -EventBuilder.STATUS_TIMEOUT: 0, -EventBuilder.STATUS_EXCEPTIONAL_EXIT: 0 -} - # Track the most recent test start event by worker index. # We'll use this to assign TIMEOUT and exceptional # exits to the most recent test started on a given @@ -359,18 +346,12 @@ class ResultsFormatter(object): if event_type == "terminate": self.terminate_called = True elif event_type in EventBuilder.RESULT_TYPES: -# Keep track of event counts per test/job result status -# type. The only job (i.e. inferior process) results that -# make it here are ones that cannot be remapped to the most -# recently started test for the given worker index. -status = test_event["status"] -self.result_status_counts[status] += 1 # Clear the most recently started test for the related # worker. worker_index = test_event.get("worker_index", None) if worker_index is not None: self.started_tests_by_worker.pop(worker_index, None) - +status = test_event["status"] if status in EventBuilder.TESTRUN_ERROR_STATUS_VALUES: # A test/job status value in any of those status values # causes a testrun failure. If such a test fails, check @@ -393,12 +374,6 @@ class ResultsFormatter(object): # the need to run a low-load, single-worker test run can # have the final run's results to always be used. if test_key in self.result_events: -# We are replacing the result of something that was -# already counted by the base class. Remove the double -# counting by reducing by one the count for the test -# result status. -old_status = self.result_events[test_key]["status"] -self.result_status_counts[old_status] -= 1 self.test_method_rerun_count += 1 self.result_events[test_key] = test_event elif event_type == EventBuilder.TYPE_TEST_START: @@ -494,7 +469,9 @@ class ResultsFormatter(object): @return an integer returning the number of test methods matching the given test result status. """ -return self.result_status_counts[status] +return len([ +[key, event] for (key, event) in self.result_events.items() +if event.get("status", "") == status]) @classmethod def _event_sort_key(cls, event): ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r295897 - Changed builld-llvm.py to use .json files
Author: spyffe Date: Wed Feb 22 16:57:59 2017 New Revision: 295897 URL: http://llvm.org/viewvc/llvm-project?rev=295897&view=rev Log: Changed builld-llvm.py to use .json files LLDB has many branches in a variety of repositories. The build-script.py file is subtly different for each set. This is unnecessary and causes merge headaches. This patch makes build-llvm.py consult a directory full of .json files, each one of which matches a particular branch using a regular expression. Differential revision: https://reviews.llvm.org/D30275 Added: lldb/trunk/scripts/Xcode/repo.py lldb/trunk/scripts/Xcode/repos/ lldb/trunk/scripts/Xcode/repos/svn-trunk.json Modified: lldb/trunk/scripts/Xcode/build-llvm.py Modified: lldb/trunk/scripts/Xcode/build-llvm.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=295897&r1=295896&r2=295897&view=diff == --- lldb/trunk/scripts/Xcode/build-llvm.py (original) +++ lldb/trunk/scripts/Xcode/build-llvm.py Wed Feb 22 16:57:59 2017 @@ -6,6 +6,7 @@ import fnmatch import os import platform import re +import repo import subprocess import sys @@ -17,42 +18,38 @@ from lldbbuild import * def LLVM_HASH_INCLUDES_DIFFS(): return False -# The use of "x = "..."; return x" here is important because tooling looks for -# it with regexps. Only change how this works if you know what you are doing. - - -def LLVM_REF(): -llvm_ref = "master" -return llvm_ref - - -def CLANG_REF(): -clang_ref = "master" -return clang_ref - # For use with Xcode-style builds +def process_vcs(vcs): +return { +"svn": VCS.svn, +"git": VCS.git +}[vcs] + +def process_root(name): +return { +"llvm": llvm_source_path(), +"clang": clang_source_path(), +"ninja": ninja_source_path() +}[name] + +def process_repo(r): +return { +'name': r["name"], +'vcs': process_vcs(r["vcs"]), +'root': process_root(r["name"]), +'url': r["url"], +'ref': r["ref"] +} def XCODE_REPOSITORIES(): -return [ -{'name': "llvm", - 'vcs': VCS.git, - 'root': llvm_source_path(), - 'url': "http://llvm.org/git/llvm.git";, - 'ref': LLVM_REF()}, - -{'name': "clang", - 'vcs': VCS.git, - 'root': clang_source_path(), - 'url': "http://llvm.org/git/clang.git";, - 'ref': CLANG_REF()}, - -{'name': "ninja", - 'vcs': VCS.git, - 'root': ninja_source_path(), - 'url': "https://github.com/ninja-build/ninja.git";, - 'ref': "master"} -] +identifier = repo.identifier() +if identifier == None: +sys.exit("Couldn't identify the current branch") +set = repo.find(identifier) +if set == None: +sys.exit("Couldn't find a repository set for the current branch") +return [process_repo(r) for r in set] def get_c_compiler(): Added: lldb/trunk/scripts/Xcode/repo.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/repo.py?rev=295897&view=auto == --- lldb/trunk/scripts/Xcode/repo.py (added) +++ lldb/trunk/scripts/Xcode/repo.py Wed Feb 22 16:57:59 2017 @@ -0,0 +1,33 @@ +import json +import os +import re +import subprocess + +def identifier(): + try: + svn_output = subprocess.check_output(["svn", "info", "--show-item", "url"], stderr=subprocess.STDOUT).rstrip() + return svn_output + except: + pass + try: + git_remote_and_branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"]).rstrip() + git_remote = git_remote_and_branch.split("/")[0] + git_branch = "/".join(git_remote_and_branch.split("/")[1:]) + git_url = subprocess.check_output(["git", "remote", "get-url", git_remote]).rstrip() + return git_url + ":" + git_branch + except: + pass + return None + +def find(identifier): + dir = os.path.dirname(os.path.realpath(__file__)) + repos_dir = os.path.join(dir, "repos") + json_regex = re.compile(r"^.*.json$") + override_path = os.path.join(repos_dir, "OVERRIDE.json") + if os.path.isfile(override_path): + override_set = json.load(open(override_path)) + return override_set["repos"] + for set in [json.load(open(os.path.join(repos_dir, f))) for f in filter(json_regex.match, os.listdir(repos_dir))]: + if re.match(set["regexp"], identifier): + return set["repos"] + return None Added: lldb/trunk/scripts/Xcode/repos/svn-trunk.json URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/repos/svn-trunk.json?rev=295897&view=auto ==
Re: [Lldb-commits] [lldb] r295897 - Changed builld-llvm.py to use .json files
I'll roll it back pending some fixes on my end. Sorry for the break. Sean > On Feb 22, 2017, at 4:40 PM, Tim Hammerquist wrote: > > Hi Sean, > > Looks like this is breaking builds in Green Dragon (and locally for me from > master branch). Can you take a look at the failures here? > > http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/26076/console > <http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/26076/console> > > Thanks! > -Tim > > > On Wed, Feb 22, 2017 at 2:57 PM, Sean Callanan via lldb-commits > mailto:lldb-commits@lists.llvm.org>> wrote: > Author: spyffe > Date: Wed Feb 22 16:57:59 2017 > New Revision: 295897 > > URL: http://llvm.org/viewvc/llvm-project?rev=295897&view=rev > <http://llvm.org/viewvc/llvm-project?rev=295897&view=rev> > Log: > Changed builld-llvm.py to use .json files > > LLDB has many branches in a variety of repositories. > The build-script.py file is subtly different for each set. > This is unnecessary and causes merge headaches. > > This patch makes build-llvm.py consult a directory full > of .json files, each one of which matches a particular > branch using a regular expression. > > Differential revision: https://reviews.llvm.org/D30275 > <https://reviews.llvm.org/D30275> > > Added: > lldb/trunk/scripts/Xcode/repo.py > lldb/trunk/scripts/Xcode/repos/ > lldb/trunk/scripts/Xcode/repos/svn-trunk.json > Modified: > lldb/trunk/scripts/Xcode/build-llvm.py > > Modified: lldb/trunk/scripts/Xcode/build-llvm.py > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=295897&r1=295896&r2=295897&view=diff > > <http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=295897&r1=295896&r2=295897&view=diff> > == > --- lldb/trunk/scripts/Xcode/build-llvm.py (original) > +++ lldb/trunk/scripts/Xcode/build-llvm.py Wed Feb 22 16:57:59 2017 > @@ -6,6 +6,7 @@ import fnmatch > import os > import platform > import re > +import repo > import subprocess > import sys > > @@ -17,42 +18,38 @@ from lldbbuild import * > def LLVM_HASH_INCLUDES_DIFFS(): > return False > > -# The use of "x = "..."; return x" here is important because tooling looks > for > -# it with regexps. Only change how this works if you know what you are > doing. > - > - > -def LLVM_REF(): > -llvm_ref = "master" > -return llvm_ref > - > - > -def CLANG_REF(): > -clang_ref = "master" > -return clang_ref > - > # For use with Xcode-style builds > > +def process_vcs(vcs): > +return { > +"svn": VCS.svn, > +"git": VCS.git > +}[vcs] > + > +def process_root(name): > +return { > +"llvm": llvm_source_path(), > +"clang": clang_source_path(), > +"ninja": ninja_source_path() > +}[name] > + > +def process_repo(r): > +return { > +'name': r["name"], > +'vcs': process_vcs(r["vcs"]), > +'root': process_root(r["name"]), > +'url': r["url"], > +'ref': r["ref"] > +} > > def XCODE_REPOSITORIES(): > -return [ > -{'name': "llvm", > - 'vcs': VCS.git, > - 'root': llvm_source_path(), > - 'url': "http://llvm.org/git/llvm.git > <http://llvm.org/git/llvm.git>", > - 'ref': LLVM_REF()}, > - > -{'name': "clang", > - 'vcs': VCS.git, > - 'root': clang_source_path(), > - 'url': "http://llvm.org/git/clang.git > <http://llvm.org/git/clang.git>", > - 'ref': CLANG_REF()}, > - > -{'name': "ninja", > - 'vcs': VCS.git, > - 'root': ninja_source_path(), > - 'url': "https://github.com/ninja-build/ninja.git > <https://github.com/ninja-build/ninja.git>", > - 'ref': "master"} > -] > +identifier = repo.identifier() > +if identifier == None: > +sys.exit("Couldn't identify the current branch") > +set = repo.find(identifier) > +if set == None: > +sys.exit("Couldn't find a repository set for the
[Lldb-commits] [lldb] r295915 - Reverted 295897 pending refinements and fixes for green-dragon.
Author: spyffe Date: Wed Feb 22 18:46:30 2017 New Revision: 295915 URL: http://llvm.org/viewvc/llvm-project?rev=295915&view=rev Log: Reverted 295897 pending refinements and fixes for green-dragon. Removed: lldb/trunk/scripts/Xcode/repo.py lldb/trunk/scripts/Xcode/repos/ Modified: lldb/trunk/scripts/Xcode/build-llvm.py Modified: lldb/trunk/scripts/Xcode/build-llvm.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=295915&r1=295914&r2=295915&view=diff == --- lldb/trunk/scripts/Xcode/build-llvm.py (original) +++ lldb/trunk/scripts/Xcode/build-llvm.py Wed Feb 22 18:46:30 2017 @@ -6,7 +6,6 @@ import fnmatch import os import platform import re -import repo import subprocess import sys @@ -18,38 +17,42 @@ from lldbbuild import * def LLVM_HASH_INCLUDES_DIFFS(): return False +# The use of "x = "..."; return x" here is important because tooling looks for +# it with regexps. Only change how this works if you know what you are doing. + + +def LLVM_REF(): +llvm_ref = "master" +return llvm_ref + + +def CLANG_REF(): +clang_ref = "master" +return clang_ref + # For use with Xcode-style builds -def process_vcs(vcs): -return { -"svn": VCS.svn, -"git": VCS.git -}[vcs] - -def process_root(name): -return { -"llvm": llvm_source_path(), -"clang": clang_source_path(), -"ninja": ninja_source_path() -}[name] - -def process_repo(r): -return { -'name': r["name"], -'vcs': process_vcs(r["vcs"]), -'root': process_root(r["name"]), -'url': r["url"], -'ref': r["ref"] -} def XCODE_REPOSITORIES(): -identifier = repo.identifier() -if identifier == None: -sys.exit("Couldn't identify the current branch") -set = repo.find(identifier) -if set == None: -sys.exit("Couldn't find a repository set for the current branch") -return [process_repo(r) for r in set] +return [ +{'name': "llvm", + 'vcs': VCS.git, + 'root': llvm_source_path(), + 'url': "http://llvm.org/git/llvm.git";, + 'ref': LLVM_REF()}, + +{'name': "clang", + 'vcs': VCS.git, + 'root': clang_source_path(), + 'url': "http://llvm.org/git/clang.git";, + 'ref': CLANG_REF()}, + +{'name': "ninja", + 'vcs': VCS.git, + 'root': ninja_source_path(), + 'url': "https://github.com/ninja-build/ninja.git";, + 'ref': "master"} +] def get_c_compiler(): Removed: lldb/trunk/scripts/Xcode/repo.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/repo.py?rev=295914&view=auto == --- lldb/trunk/scripts/Xcode/repo.py (original) +++ lldb/trunk/scripts/Xcode/repo.py (removed) @@ -1,33 +0,0 @@ -import json -import os -import re -import subprocess - -def identifier(): - try: - svn_output = subprocess.check_output(["svn", "info", "--show-item", "url"], stderr=subprocess.STDOUT).rstrip() - return svn_output - except: - pass - try: - git_remote_and_branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"]).rstrip() - git_remote = git_remote_and_branch.split("/")[0] - git_branch = "/".join(git_remote_and_branch.split("/")[1:]) - git_url = subprocess.check_output(["git", "remote", "get-url", git_remote]).rstrip() - return git_url + ":" + git_branch - except: - pass - return None - -def find(identifier): - dir = os.path.dirname(os.path.realpath(__file__)) - repos_dir = os.path.join(dir, "repos") - json_regex = re.compile(r"^.*.json$") - override_path = os.path.join(repos_dir, "OVERRIDE.json") - if os.path.isfile(override_path): - override_set = json.load(open(override_path)) - return override_set["repos"] - for set in [json.load(open(os.path.join(repos_dir, f))) for f in filter(json_regex.match, os.listdir(repos_dir))]: - if re.match(set["regexp"], identifier): - return set["repos"] - return None ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r295922 - Changed builld-llvm.py to use .json files
Author: spyffe Date: Wed Feb 22 20:21:34 2017 New Revision: 295922 URL: http://llvm.org/viewvc/llvm-project?rev=295922&view=rev Log: Changed builld-llvm.py to use .json files LLDB has many branches in a variety of repositories. The build-script.py file is subtly different for each set. This is unnecessary and causes merge headaches. This patch makes build-llvm.py consult a directory full of .json files, each one of which matches a particular branch using a regular expression. This update to the patch introduces a FALLBACK file whose contents take precedence if the current branch could not be identified. If the current branch could be identified, FALLBACK is updated, allowing the user to e.g. cut branches off of known branches and still have the automatic checkout mechanism work. It also documents all of this. Differential revision: https://reviews.llvm.org/D30275 Added: lldb/trunk/scripts/Xcode/repo.py lldb/trunk/scripts/Xcode/repos/ lldb/trunk/scripts/Xcode/repos/FALLBACK lldb/trunk/scripts/Xcode/repos/svn-trunk.json Modified: lldb/trunk/INSTALL.txt lldb/trunk/scripts/Xcode/build-llvm.py Modified: lldb/trunk/INSTALL.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/INSTALL.txt?rev=295922&r1=295921&r2=295922&view=diff == --- lldb/trunk/INSTALL.txt (original) +++ lldb/trunk/INSTALL.txt Wed Feb 22 20:21:34 2017 @@ -7,6 +7,11 @@ On Mac OS X, in addition to using Xcode on your system to either build lldb or debug using lldb. Please see the code signing documentation in docs/code-signing.txt for more detailed directions. +If you are building on Mac OS X and LLVM is not present in llvm/, then LLDB +will check it out automatically. The files in scripts/Xcode/repos determine +which branches of LLVM/Clang are checked out, depending on the current +LLDB branch, according to the algorithm in scripts/Xcode/repo.py. + For instructions to build LLDB on Linux, or more details about supported compiler versions, other dependencies, and build flags, see: Modified: lldb/trunk/scripts/Xcode/build-llvm.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=295922&r1=295921&r2=295922&view=diff == --- lldb/trunk/scripts/Xcode/build-llvm.py (original) +++ lldb/trunk/scripts/Xcode/build-llvm.py Wed Feb 22 20:21:34 2017 @@ -6,6 +6,7 @@ import fnmatch import os import platform import re +import repo import subprocess import sys @@ -17,42 +18,36 @@ from lldbbuild import * def LLVM_HASH_INCLUDES_DIFFS(): return False -# The use of "x = "..."; return x" here is important because tooling looks for -# it with regexps. Only change how this works if you know what you are doing. - - -def LLVM_REF(): -llvm_ref = "master" -return llvm_ref - - -def CLANG_REF(): -clang_ref = "master" -return clang_ref - # For use with Xcode-style builds +def process_vcs(vcs): +return { +"svn": VCS.svn, +"git": VCS.git +}[vcs] + +def process_root(name): +return { +"llvm": llvm_source_path(), +"clang": clang_source_path(), +"ninja": ninja_source_path() +}[name] + +def process_repo(r): +return { +'name': r["name"], +'vcs': process_vcs(r["vcs"]), +'root': process_root(r["name"]), +'url': r["url"], +'ref': r["ref"] +} def XCODE_REPOSITORIES(): -return [ -{'name': "llvm", - 'vcs': VCS.git, - 'root': llvm_source_path(), - 'url': "http://llvm.org/git/llvm.git";, - 'ref': LLVM_REF()}, - -{'name': "clang", - 'vcs': VCS.git, - 'root': clang_source_path(), - 'url': "http://llvm.org/git/clang.git";, - 'ref': CLANG_REF()}, - -{'name': "ninja", - 'vcs': VCS.git, - 'root': ninja_source_path(), - 'url': "https://github.com/ninja-build/ninja.git";, - 'ref': "master"} -] +identifier = repo.identifier() +if identifier == None: +identifier = "" # repo.find will just use the fallback file +set = repo.find(identifier) +return [process_repo(r) for r in set] def get_c_compiler(): Added: lldb/trunk/scripts/Xcode/repo.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/repo.py?rev=295922&view=auto == --- lldb/trunk/scripts/Xcode/repo.py (added) +++ lldb/trunk/scripts/Xcode/repo.py Wed Feb 22 20:21:34 2017 @@ -0,0 +1,42 @@ +import json +import os +import re +import shutil +import subprocess + +def identifier(): + try: + svn_output = subprocess.check_output(["svn", "info", "--show-item", "url"], stderr=subprocess.STDOUT).rstrip() + return svn_output + except: + pass + try: + git_remote_and_branch
Re: [Lldb-commits] [lldb] r295897 - Changed builld-llvm.py to use .json files
I've recommitted with a bunch of fixes: SendingINSTALL.txt Sendingscripts/Xcode/build-llvm.py Adding scripts/Xcode/repo.py Adding scripts/Xcode/repos Adding scripts/Xcode/repos/FALLBACK Adding scripts/Xcode/repos/svn-trunk.json Transmitting file data .done Committing transaction... Committed revision 295922. Please let me know if you see any problems. Sean > On Feb 22, 2017, at 4:56 PM, Sean Callanan via lldb-commits > wrote: > > I'll roll it back pending some fixes on my end. > Sorry for the break. > > Sean > >> On Feb 22, 2017, at 4:40 PM, Tim Hammerquist > <mailto:pen...@gmail.com>> wrote: >> >> Hi Sean, >> >> Looks like this is breaking builds in Green Dragon (and locally for me from >> master branch). Can you take a look at the failures here? >> >> http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/26076/console >> <http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/26076/console> >> >> Thanks! >> -Tim >> >> >> On Wed, Feb 22, 2017 at 2:57 PM, Sean Callanan via lldb-commits >> mailto:lldb-commits@lists.llvm.org>> wrote: >> Author: spyffe >> Date: Wed Feb 22 16:57:59 2017 >> New Revision: 295897 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=295897&view=rev >> <http://llvm.org/viewvc/llvm-project?rev=295897&view=rev> >> Log: >> Changed builld-llvm.py to use .json files >> >> LLDB has many branches in a variety of repositories. >> The build-script.py file is subtly different for each set. >> This is unnecessary and causes merge headaches. >> >> This patch makes build-llvm.py consult a directory full >> of .json files, each one of which matches a particular >> branch using a regular expression. >> >> Differential revision: https://reviews.llvm.org/D30275 >> <https://reviews.llvm.org/D30275> >> >> Added: >> lldb/trunk/scripts/Xcode/repo.py >> lldb/trunk/scripts/Xcode/repos/ >> lldb/trunk/scripts/Xcode/repos/svn-trunk.json >> Modified: >> lldb/trunk/scripts/Xcode/build-llvm.py >> >> Modified: lldb/trunk/scripts/Xcode/build-llvm.py >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=295897&r1=295896&r2=295897&view=diff >> >> <http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/build-llvm.py?rev=295897&r1=295896&r2=295897&view=diff> >> == >> --- lldb/trunk/scripts/Xcode/build-llvm.py (original) >> +++ lldb/trunk/scripts/Xcode/build-llvm.py Wed Feb 22 16:57:59 2017 >> @@ -6,6 +6,7 @@ import fnmatch >> import os >> import platform >> import re >> +import repo >> import subprocess >> import sys >> >> @@ -17,42 +18,38 @@ from lldbbuild import * >> def LLVM_HASH_INCLUDES_DIFFS(): >> return False >> >> -# The use of "x = "..."; return x" here is important because tooling looks >> for >> -# it with regexps. Only change how this works if you know what you are >> doing. >> - >> - >> -def LLVM_REF(): >> -llvm_ref = "master" >> -return llvm_ref >> - >> - >> -def CLANG_REF(): >> -clang_ref = "master" >> -return clang_ref >> - >> # For use with Xcode-style builds >> >> +def process_vcs(vcs): >> +return { >> +"svn": VCS.svn, >> +"git": VCS.git >> +}[vcs] >> + >> +def process_root(name): >> +return { >> +"llvm": llvm_source_path(), >> +"clang": clang_source_path(), >> +"ninja": ninja_source_path() >> +}[name] >> + >> +def process_repo(r): >> +return { >> +'name': r["name"], >> +'vcs': process_vcs(r["vcs"]), >> +'root': process_root(r["name"]), >> +'url': r["url"], >> +'ref': r["ref"] >> +} >> >> def XCODE_REPOSITORIES(): >> -return [ >> -{'name': "llvm", >> - 'vcs': VCS.git, >> - 'root': llvm_source_path(), >> - 'url': "http://llvm.org/git/llvm.git >> <http://llvm.org/git/llvm.git>", >> -
[Lldb-commits] [lldb] r296924 - Fixed repo.py to not send git errors to stderr.
Author: spyffe Date: Fri Mar 3 17:13:30 2017 New Revision: 296924 URL: http://llvm.org/viewvc/llvm-project?rev=296924&view=rev Log: Fixed repo.py to not send git errors to stderr. Some repos are not git repos, so git is expected to fail. These errors should not go to stderr, because Xcode interprets them as failures. Modified: lldb/trunk/scripts/Xcode/repo.py Modified: lldb/trunk/scripts/Xcode/repo.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/repo.py?rev=296924&r1=296923&r2=296924&view=diff == --- lldb/trunk/scripts/Xcode/repo.py (original) +++ lldb/trunk/scripts/Xcode/repo.py Fri Mar 3 17:13:30 2017 @@ -11,7 +11,7 @@ def identifier(): except: pass try: - git_remote_and_branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"]).rstrip() + git_remote_and_branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"], stderr=subprocess.STDOUT).rstrip() git_remote = git_remote_and_branch.split("/")[0] git_branch = "/".join(git_remote_and_branch.split("/")[1:]) git_url = subprocess.check_output(["git", "remote", "get-url", git_remote]).rstrip() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r296951 - Disable the lldb-mi tests on remote platforms.
Author: spyffe Date: Fri Mar 3 19:48:43 2017 New Revision: 296951 URL: http://llvm.org/viewvc/llvm-project?rev=296951&view=rev Log: Disable the lldb-mi tests on remote platforms. Currently on remote platforms the lldb-mi tests fail, which means they time out. Given how many of the lldb-mi tests there are, this means a long wait. Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiPrompt.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/threadinfo/TestMiThreadInfo.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py?rev=296951&r1=296950&r2=296951&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiEnvironmentCd.py Fri Mar 3 19:48:43 2017 @@ -18,6 +18,7 @@ class MiEnvironmentCdTestCase(lldbmi_tes @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races @skipIfDarwin # Disabled while I investigate the failure on buildbot. +@skipIfRemote # We do not currently support remote debugging via the MI. def test_lldbmi_environment_cd(self): """Test that 'lldb-mi --interpreter' changes working directory for inferior.""" Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py?rev=296951&r1=296950&r2=296951&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py Fri Mar 3 19:48:43 2017 @@ -18,6 +18,7 @@ class MiExitTestCase(lldbmi_testcase.MiT oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows") @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races +@skipIfRemote # We do not currently support remote debugging via the MI. def test_lldbmi_gdb_exit(self): """Test that '-gdb-exit' terminates local debug session and exits.""" @@ -44,6 +45,7 @@ class MiExitTestCase(lldbmi_testcase.MiT oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows") @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races +@skipIfRemote # We do not currently support remote debugging via the MI. def test_lldbmi_quit(self): """Test that 'quit' exits immediately.""" @@ -69,6 +71,7 @@ class MiExitTestCase(lldbmi_testcase.MiT oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows") @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races +@skipIfRemote # We do not currently support remote debugging via the MI. def test_lldbmi_q(self): """Test that 'q' exits immediately.""" Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py?rev=296951&r1=296950&r2=296951&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/
[Lldb-commits] [lldb] r296963 - Project file fixes after movement of Data* and removal of ThisThread.cpp
Author: spyffe Date: Sat Mar 4 02:05:54 2017 New Revision: 296963 URL: http://llvm.org/viewvc/llvm-project?rev=296963&view=rev Log: Project file fixes after movement of Data* and removal of ThisThread.cpp Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=296963&r1=296962&r2=296963&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Sat Mar 4 02:05:54 2017 @@ -399,8 +399,6 @@ 2689003113353E0400698AC0 /* Broadcaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6D10F1B85900F91463 /* Broadcaster.cpp */; }; 2689003213353E0400698AC0 /* Communication.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6E10F1B85900F91463 /* Communication.cpp */; }; 2689003313353E0400698AC0 /* Connection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6F10F1B85900F91463 /* Connection.cpp */; }; - 2689003613353E0400698AC0 /* DataBufferHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7210F1B85900F91463 /* DataBufferHeap.cpp */; }; - 2689003813353E0400698AC0 /* DataExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7110F1B85900F91463 /* DataExtractor.cpp */; }; 2689003913353E0400698AC0 /* Debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263664921140A4930075843B /* Debugger.cpp */; }; 2689003A13353E0400698AC0 /* Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7610F1B85900F91463 /* Disassembler.cpp */; }; 2689003B13353E0400698AC0 /* EmulateInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D9FDC812F784FD0003F2EE /* EmulateInstruction.cpp */; }; @@ -423,7 +421,6 @@ 2689005213353E0400698AC0 /* Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9610F1B85900F91463 /* Timer.cpp */; }; 2689005313353E0400698AC0 /* UserID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9810F1B85900F91463 /* UserID.cpp */; }; 2689005413353E0400698AC0 /* UserSettingsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A4633DC11F65D9A00955CE1 /* UserSettingsController.cpp */; }; - 2689005513353E0400698AC0 /* UUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C81CA511335651004BDC5A /* UUID.cpp */; }; 2689005613353E0400698AC0 /* Value.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9910F1B85900F91463 /* Value.cpp */; }; 2689005713353E0400698AC0 /* ValueObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9A10F1B85900F91463 /* ValueObject.cpp */; }; 2689005813353E0400698AC0 /* ValueObjectChild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9B10F1B85900F91463 /* ValueObjectChild.cpp */; }; @@ -693,8 +690,6 @@ 3FDFE56C19AF9C44009756A7 /* HostProcessPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFE56A19AF9C44009756A7 /* HostProcessPosix.cpp */; }; 3FDFE56D19AF9C44009756A7 /* HostThreadPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFE56B19AF9C44009756A7 /* HostThreadPosix.cpp */; }; 3FDFED0B19B7C8DE009756A7 /* HostThreadMacOSX.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED0519B7C898009756A7 /* HostThreadMacOSX.mm */; }; - 3FDFED0C19B7C8E7009756A7 /* ThisThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED0619B7C898009756A7 /* ThisThread.cpp */; }; - 3FDFED0F19B7D269009756A7 /* ThisThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED0D19B7D269009756A7 /* ThisThread.cpp */; }; 3FDFED2719BA6D96009756A7 /* HostNativeThreadBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2419BA6D96009756A7 /* HostNativeThreadBase.cpp */; }; 3FDFED2819BA6D96009756A7 /* HostThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2519BA6D96009756A7 /* HostThread.cpp */; }; 3FDFED2919BA6D96009756A7 /* ThreadLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2619BA6D96009756A7 /* ThreadLauncher.cpp */; }; @@ -711,7 +706,11 @@ 4984BA181B979C08008658D4 /* ExpressionVariable.h in Headers */ = {isa = PBXBuildFile; fileRef = 4984BA171B979C08008658D4 /* ExpressionVariable.h */; }; 49A1CAC51430E8DE00306AC9 /* ExpressionSourceCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49A1CAC31430E8BD00306AC9 /* ExpressionSourceCode.cpp */; }; 49A71FE7141FFA5C00D59478 /* IRInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 496B01581406DE8900F830D5 /* IRInterpreter.cpp */; }; - 49A71FE8141FFACF00D5
[Lldb-commits] [lldb] r297128 - Fixed a missing brace.
Author: spyffe Date: Tue Mar 7 02:31:41 2017 New Revision: 297128 URL: http://llvm.org/viewvc/llvm-project?rev=297128&view=rev Log: Fixed a missing brace. Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp?rev=297128&r1=297127&r2=297128&view=diff == --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp (original) +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Tue Mar 7 02:31:41 2017 @@ -398,7 +398,7 @@ void PlatformDarwinKernel::GetUserSpecif for (uint32_t i = 0; i < user_dirs_count; i++) { FileSpec dir = user_dirs.GetFileSpecAtIndex(i); dir.ResolvePath(); -if (llvm::sys::fs::is_directory(dir.GetPath())) +if (llvm::sys::fs::is_directory(dir.GetPath())) { m_search_directories.push_back(dir); } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r297139 - Revert "Use LLVM for all stat-related functionality."
Thanks, Pavel. I think if we do this again we should indirect the new API through the LLDB FileSpec API or at least a global function somewhere in LLDB, so that we can change implementations without having to touch so much source code. Sean > On Mar 7, 2017, at 5:19 AM, Pavel Labath via lldb-commits > wrote: > > Author: labath > Date: Tue Mar 7 07:19:15 2017 > New Revision: 297139 > > URL: http://llvm.org/viewvc/llvm-project?rev=297139&view=rev > Log: > Revert "Use LLVM for all stat-related functionality." > > this reverts r297116 because it breaks the unittests and > TestCompDirSymlink. The ModuleCache unit test is trivially fixable, but > the CompDirSymlink failure is a symptom of a deeper problem: llvm's stat > functionality is not a drop-in replacement for lldb's. The former is > based on stat(2) (which does symlink resolution), while the latter is > based on lstat(2) (which does not). > > This also reverts subsequent build fixes (r297128, r297120, 297117) and > r297119 (Remove FileSpec dependency on FileSystem) which builds on top > of this. > > Modified: >lldb/trunk/include/lldb/Host/FileSpec.h >lldb/trunk/source/API/SBPlatform.cpp >lldb/trunk/source/Commands/CommandCompletions.cpp >lldb/trunk/source/Commands/CommandObjectTarget.cpp >lldb/trunk/source/Core/Debugger.cpp >lldb/trunk/source/Core/FileSpecList.cpp >lldb/trunk/source/Core/Module.cpp >lldb/trunk/source/Core/ModuleList.cpp >lldb/trunk/source/Core/PluginManager.cpp >lldb/trunk/source/Host/common/FileSpec.cpp >lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp >lldb/trunk/source/Host/common/Symbols.cpp >lldb/trunk/source/Host/macosx/Host.mm >lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm >lldb/trunk/source/Host/macosx/Symbols.cpp >lldb/trunk/source/Host/posix/FileSystem.cpp >lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h >lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp >lldb/trunk/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp >lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp >lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp > > lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp >lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp >lldb/trunk/source/Target/ModuleCache.cpp >lldb/trunk/source/Target/Platform.cpp >lldb/trunk/source/Target/TargetList.cpp > > Modified: lldb/trunk/include/lldb/Host/FileSpec.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSpec.h?rev=297139&r1=297138&r2=297139&view=diff > == > --- lldb/trunk/include/lldb/Host/FileSpec.h (original) > +++ lldb/trunk/include/lldb/Host/FileSpec.h Tue Mar 7 07:19:15 2017 > @@ -22,7 +22,6 @@ > #include "lldb/lldb-private.h" > > #include "llvm/ADT/Triple.h" > -#include "llvm/Support/FileSystem.h" > #include "llvm/Support/FormatVariadic.h" > > namespace lldb_private { > @@ -47,6 +46,17 @@ namespace lldb_private { > //-- > class FileSpec { > public: > + typedef enum FileType { > +eFileTypeInvalid = -1, > +eFileTypeUnknown = 0, > +eFileTypeDirectory, > +eFileTypePipe, > +eFileTypeRegular, > +eFileTypeSocket, > +eFileTypeSymbolicLink, > +eFileTypeOther > + } FileType; > + > enum PathSyntax { > ePathSyntaxPosix, > ePathSyntaxWindows, > @@ -445,6 +455,8 @@ public: > //-- > ConstString GetFileNameStrippingExtension() const; > > + FileType GetFileType() const; > + > //-- > /// Return the current permissions of the path. > /// > @@ -459,6 +471,20 @@ public: > //-- > uint32_t GetPermissions() const; > > + bool IsDirectory() const { > +return GetFileType() == FileSpec::eFileTypeDirectory; >
[Lldb-commits] [lldb] r248842 - Removed a bunch of dependencies of Materializer on ClangUserExpression.
Author: spyffe Date: Tue Sep 29 17:52:50 2015 New Revision: 248842 URL: http://llvm.org/viewvc/llvm-project?rev=248842&view=rev Log: Removed a bunch of dependencies of Materializer on ClangUserExpression. Instead we now just generically use UserExpression. Modified: lldb/trunk/source/Expression/Materializer.cpp Modified: lldb/trunk/source/Expression/Materializer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=248842&r1=248841&r2=248842&view=diff == --- lldb/trunk/source/Expression/Materializer.cpp (original) +++ lldb/trunk/source/Expression/Materializer.cpp Tue Sep 29 17:52:50 2015 @@ -109,11 +109,11 @@ public: // Clear the flag if the variable will never be deallocated. -if (m_persistent_variable_sp->m_flags & ClangExpressionVariable::EVKeepInTarget) +if (m_persistent_variable_sp->m_flags & ExpressionVariable::EVKeepInTarget) { Error leak_error; map.Leak(mem, leak_error); -m_persistent_variable_sp->m_flags &= ~ClangExpressionVariable::EVNeedsAllocation; +m_persistent_variable_sp->m_flags &= ~ExpressionVariable::EVNeedsAllocation; } // Write the contents of the variable to the area. @@ -161,17 +161,17 @@ public: m_persistent_variable_sp->m_flags); } -if (m_persistent_variable_sp->m_flags & ClangExpressionVariable::EVNeedsAllocation) +if (m_persistent_variable_sp->m_flags & ExpressionVariable::EVNeedsAllocation) { MakeAllocation(map, err); -m_persistent_variable_sp->m_flags |= ClangExpressionVariable::EVIsLLDBAllocated; +m_persistent_variable_sp->m_flags |= ExpressionVariable::EVIsLLDBAllocated; if (!err.Success()) return; } -if ((m_persistent_variable_sp->m_flags & ClangExpressionVariable::EVIsProgramReference && m_persistent_variable_sp->m_live_sp) || -m_persistent_variable_sp->m_flags & ClangExpressionVariable::EVIsLLDBAllocated) +if ((m_persistent_variable_sp->m_flags & ExpressionVariable::EVIsProgramReference && m_persistent_variable_sp->m_live_sp) || +m_persistent_variable_sp->m_flags & ExpressionVariable::EVIsLLDBAllocated) { Error write_error; @@ -211,10 +211,10 @@ public: m_persistent_variable_sp->m_flags); } -if ((m_persistent_variable_sp->m_flags & ClangExpressionVariable::EVIsLLDBAllocated) || -(m_persistent_variable_sp->m_flags & ClangExpressionVariable::EVIsProgramReference)) +if ((m_persistent_variable_sp->m_flags & ExpressionVariable::EVIsLLDBAllocated) || +(m_persistent_variable_sp->m_flags & ExpressionVariable::EVIsProgramReference)) { -if (m_persistent_variable_sp->m_flags & ClangExpressionVariable::EVIsProgramReference && +if (m_persistent_variable_sp->m_flags & ExpressionVariable::EVIsProgramReference && !m_persistent_variable_sp->m_live_sp) { // If the reference comes from the program, then the ClangExpressionVariable's @@ -232,7 +232,7 @@ public: } m_persistent_variable_sp->m_live_sp = ValueObjectConstResult::Create (map.GetBestExecutionContextScope (), - llvm::cast(m_persistent_variable_sp.get())->GetTypeFromUser(), + m_persistent_variable_sp.get()->GetCompilerType(), m_persistent_variable_sp->GetName(), location, eAddressTypeLoad, @@ -246,10 +246,10 @@ public: // If the variable is resident in the stack frame created by the expression, // then it cannot be relied upon to stay around. We treat it as needing // reallocation. -m_persistent_variable_sp->m_flags |= ClangExpressionVariable::EVIsLLDBAllocated; -m_persistent_variable_sp->m_flags |= ClangExpressionVariable::EVNeedsAllocation; -m_persistent_variable_sp->m_flags |= ClangExpressionVariable::EVNeedsFreezeDry; -m_persistent_variable_sp->m_flags &= ~ClangExpressionVariable::EVIsProgramReference; +m_persistent_variable_sp->m_flags |= ExpressionVariable::EVIsLLDBAllocated; +
[Lldb-commits] [lldb] r248934 - Now persistent expression data no longer lives with the Target, but rather with
Author: spyffe Date: Wed Sep 30 14:57:57 2015 New Revision: 248934 URL: http://llvm.org/viewvc/llvm-project?rev=248934&view=rev Log: Now persistent expression data no longer lives with the Target, but rather with the corresponding TypeSystem. This makes sense because what kind of data there is -- and how it can be looked up -- depends on the language. Functionality that is common to all type systems is factored out into PersistentExpressionState. Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/include/lldb/Symbol/TypeSystem.h lldb/trunk/include/lldb/Target/Target.h lldb/trunk/include/lldb/lldb-forward.h lldb/trunk/source/API/SBFrame.cpp lldb/trunk/source/Commands/CommandObjectMemory.cpp lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/Expression/ExpressionSourceCode.cpp lldb/trunk/source/Expression/ExpressionVariable.cpp lldb/trunk/source/Expression/Materializer.cpp lldb/trunk/source/Expression/UserExpression.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/source/Target/ABI.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ExpressionVariable.h?rev=248934&r1=248933&r2=248934&view=diff == --- lldb/trunk/include/lldb/Expression/ExpressionVariable.h (original) +++ lldb/trunk/include/lldb/Expression/ExpressionVariable.h Wed Sep 30 14:57:57 2015 @@ -265,6 +265,36 @@ private: std::vector m_variables; }; +class PersistentExpressionState : public ExpressionVariableList { +public: +//-- +// See TypeSystem.h for how to add subclasses to this. +//-- +enum LLVMCastKind { +eKindClang, +eKindSwift, +eKindGo, +kNumKinds +}; + +LLVMCastKind getKind() const { return m_kind; } + +PersistentExpressionState(LLVMCastKind kind) : +m_kind(kind) +{ +} + +virtual ~PersistentExpressionState (); + +virtual ConstString +GetNextPersistentVariableName () = 0; + +virtual void +RemovePersistentVariable (lldb::ExpressionVariableSP variable) = 0; +private: +LLVMCastKind m_kind; +}; + } #endif /* liblldb_ExpressionVariable_h_ */ Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=248934&r1=248933&r2=248934&view=diff == --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Wed Sep 30 14:57:57 2015 @@ -20,6 +20,8 @@ #include // Other libraries and framework includes +#include "ClangPersistentVariables.h" + #include "llvm/ADT/SmallVector.h" #include "clang/AST/ASTContext.h" #include "clang/AST/TemplateBase.h" @@ -1188,8 +1190,12 @@ public: UtilityFunction * GetUtilityFunction(const char *text, const char *name) override; + +PersistentExpressionState * +GetPersistentExpressionState() override; private: lldb::TargetWP m_target_wp; +lldb::ClangPersistentVariablesUP m_persistent_variables; ///< These are the persistent variables associated with this process for the expression parser. }; } // namespace lldb_private Modified: lldb/trunk/include/lldb/Symbol/TypeSystem.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/TypeSystem.h?rev=248934&r1=248933&r2=248934&view=diff == --- lldb/trunk/include/lldb/Symbol/TypeSystem.h (original) +++ lldb/trunk/include/lldb/Symbol/TypeSystem.h Wed Sep 30 14:57:57 2015 @@ -504,6 +504,12 @@ public: return nullptr; } +virtual PersistentExpressionState * +GetPersistentExpressionState() +{ +return nullptr; +} + virtual CompilerType GetTypeForFormatters (void* type); Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=248934&r1=248933&r2=248934&view=diff
[Lldb-commits] [lldb] r248970 - Changed PersistentExpressionState to allow symbol lookups. Clang doesn't
Author: spyffe Date: Wed Sep 30 19:38:06 2015 New Revision: 248970 URL: http://llvm.org/viewvc/llvm-project?rev=248970&view=rev Log: Changed PersistentExpressionState to allow symbol lookups. Clang doesn't report any (yet). Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ExpressionVariable.h?rev=248970&r1=248969&r2=248970&view=diff == --- lldb/trunk/include/lldb/Expression/ExpressionVariable.h (original) +++ lldb/trunk/include/lldb/Expression/ExpressionVariable.h Wed Sep 30 19:38:06 2015 @@ -291,6 +291,10 @@ public: virtual void RemovePersistentVariable (lldb::ExpressionVariableSP variable) = 0; + +virtual lldb::addr_t +LookupSymbol (const ConstString &name) = 0; + private: LLVMCastKind m_kind; }; Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h?rev=248970&r1=248969&r2=248970&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h Wed Sep 30 19:38:06 2015 @@ -69,6 +69,9 @@ public: void RemovePersistentVariable (lldb::ExpressionVariableSP variable) override; + +lldb::addr_t +LookupSymbol (const ConstString &name) override { return LLDB_INVALID_ADDRESS; } void RegisterPersistentType (const ConstString &name, ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r248971 - Use the preferred display language when making a persistent variable from a
Author: spyffe Date: Wed Sep 30 19:39:03 2015 New Revision: 248971 URL: http://llvm.org/viewvc/llvm-project?rev=248971&view=rev Log: Use the preferred display language when making a persistent variable from a ValueObject. Modified: lldb/trunk/source/Core/ValueObject.cpp Modified: lldb/trunk/source/Core/ValueObject.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=248971&r1=248970&r2=248971&view=diff == --- lldb/trunk/source/Core/ValueObject.cpp (original) +++ lldb/trunk/source/Core/ValueObject.cpp Wed Sep 30 19:39:03 2015 @@ -4277,7 +4277,7 @@ ValueObject::Persist () if (!target_sp) return nullptr; -PersistentExpressionState *persistent_state = target_sp->GetScratchTypeSystemForLanguage(GetCompilerType().GetMinimumLanguage())->GetPersistentExpressionState(); +PersistentExpressionState *persistent_state = target_sp->GetScratchTypeSystemForLanguage(GetPreferredDisplayLanguage())->GetPersistentExpressionState(); if (!persistent_state) return nullptr; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249027 - Made Target hold a map of languages to TypeSystems, and added some accessors.
Author: spyffe Date: Thu Oct 1 11:28:02 2015 New Revision: 249027 URL: http://llvm.org/viewvc/llvm-project?rev=249027&view=rev Log: Made Target hold a map of languages to TypeSystems, and added some accessors. Also added some target-level search functions so that persistent variables and symbols can be searched for without hand-iterating across the map of TypeSystems. Modified: lldb/trunk/include/lldb/Target/Target.h lldb/trunk/source/Commands/CommandObjectMemory.cpp lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/Expression/UserExpression.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp lldb/trunk/source/Target/ABI.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=249027&r1=249026&r2=249027&view=diff == --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Thu Oct 1 11:28:02 2015 @@ -1231,6 +1231,9 @@ public: TypeSystem * GetScratchTypeSystemForLanguage (lldb::LanguageType language, bool create_on_demand = true); +PersistentExpressionState * +GetPersistentExpressionStateForLanguage (lldb::LanguageType language); + // Creates a UserExpression for the given language, the rest of the parameters have the // same meaning as for the UserExpression constructor. // Returns a new-ed object which the caller owns. @@ -1322,6 +1325,9 @@ public: lldb::ExpressionVariableSP GetPersistentVariable(const ConstString &name); +lldb::addr_t +GetPersistentSymbol(const ConstString &name); + //-- // Target Stop Hooks //-- @@ -1499,6 +1505,9 @@ public: GetSearchFilterForModuleAndCUList (const FileSpecList *containingModules, const FileSpecList *containingSourceFiles); protected: +ClangASTContext * +GetScratchClangASTContextImpl(); + //-- // Member variables. //-- @@ -1519,7 +1528,10 @@ protected: lldb::ProcessSP m_process_sp; lldb::SearchFilterSP m_search_filter_sp; PathMappingList m_image_search_paths; -lldb::ClangASTContextUP m_scratch_ast_context_ap; + +typedef std::map TypeSystemMap; +TypeSystemMap m_scratch_type_system_map; + lldb::ClangASTSourceUP m_scratch_ast_source_ap; lldb::ClangASTImporterUP m_ast_importer_ap; lldb::ClangModulesDeclVendorUP m_clang_modules_decl_vendor_ap; Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=249027&r1=249026&r2=249027&view=diff == --- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Thu Oct 1 11:28:02 2015 @@ -530,10 +530,14 @@ protected: if (type_list.GetSize() == 0 && lookup_type_name.GetCString() && *lookup_type_name.GetCString() == '$') { -clang::TypeDecl *tdecl = llvm::cast(target->GetScratchTypeSystemForLanguage(lldb::eLanguageTypeC)->GetPersistentExpressionState())->GetPersistentType(ConstString(lookup_type_name)); -if (tdecl) +if (ClangPersistentVariables *persistent_vars = llvm::dyn_cast_or_null(target->GetPersistentExpressionStateForLanguage(lldb::eLanguageTypeC))) { - clang_ast_type.SetCompilerType(ClangASTContext::GetASTContext(&tdecl->getASTContext()),(const lldb::opaque_compiler_type_t)tdecl->getTypeForDecl()); +clang::TypeDecl *tdecl = persistent_vars->GetPersistentType(ConstString(lookup_type_name)); + +if (tdecl) +{ + clang_ast_type.SetCompilerType(ClangASTContext::GetASTContext(&tdecl->getASTContext()),(const lldb::opaque_compiler_type_t)tdecl->getTypeForDecl()); +} } } Modified: lldb/trunk/source/Core/ValueObject.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=249027&r1=249026&r2=249027&view=diff == --- lldb/trunk/source/Core/ValueObject.cpp (orig
[Lldb-commits] [lldb] r249039 - Removed a mutex guard that I accidentally pasted in from other code.
Author: spyffe Date: Thu Oct 1 12:48:25 2015 New Revision: 249039 URL: http://llvm.org/viewvc/llvm-project?rev=249039&view=rev Log: Removed a mutex guard that I accidentally pasted in from other code. It was causing deadlocks when stepping out. Modified: lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/source/Target/Target.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=249039&r1=249038&r2=249039&view=diff == --- lldb/trunk/source/Target/Target.cpp (original) +++ lldb/trunk/source/Target/Target.cpp Thu Oct 1 12:48:25 2015 @@ -1892,8 +1892,6 @@ Target::ImageSearchPathsChanged TypeSystem * Target::GetScratchTypeSystemForLanguage (lldb::LanguageType language, bool create_on_demand) { -Mutex::Locker locker (m_mutex); - if (language == eLanguageTypeMipsAssembler // GNU AS and LLVM use it for all assembly code || language == eLanguageTypeUnknown) { language = eLanguageTypeC; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249095 - Eliminated redundant "constructors" for ClangExpressionVariable.
Author: spyffe Date: Thu Oct 1 18:07:06 2015 New Revision: 249095 URL: http://llvm.org/viewvc/llvm-project?rev=249095&view=rev Log: Eliminated redundant "constructors" for ClangExpressionVariable. The ClangExpressionVariable::CreateVariableInList functions looked cute, but caused more confusion than they solved. I removed them, and instead made sure that there are adequate facilities for easily adding newly-constructed ExpressionVariables to lists. I also made some of the constructors that are common be generic, so that it's possible to construct expression variables from generic places (like the ABI and ValueObject) without having to know the specifics about the class. Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/Expression/Materializer.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h lldb/trunk/source/Target/ABI.cpp Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ExpressionVariable.h?rev=249095&r1=249094&r2=249095&view=diff == --- lldb/trunk/include/lldb/Expression/ExpressionVariable.h (original) +++ lldb/trunk/include/lldb/Expression/ExpressionVariable.h Thu Oct 1 18:07:06 2015 @@ -184,6 +184,14 @@ public: m_variables.push_back(var_sp); return m_variables.size() - 1; } + +lldb::ExpressionVariableSP +AddNewlyConstructedVariable (ExpressionVariable *var) +{ +lldb::ExpressionVariableSP var_sp(var); +m_variables.push_back(var_sp); +return m_variables.back(); +} bool ContainsVariable (const lldb::ExpressionVariableSP &var_sp) @@ -283,6 +291,16 @@ public: m_kind(kind) { } + +virtual lldb::ExpressionVariableSP +CreatePersistentVariable (const lldb::ValueObjectSP &valobj_sp) = 0; + +virtual lldb::ExpressionVariableSP +CreatePersistentVariable (ExecutionContextScope *exe_scope, + const ConstString &name, + const CompilerType &type, + lldb::ByteOrder byte_order, + uint32_t addr_byte_size) = 0; virtual ~PersistentExpressionState (); Modified: lldb/trunk/source/Core/ValueObject.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=249095&r1=249094&r2=249095&view=diff == --- lldb/trunk/source/Core/ValueObject.cpp (original) +++ lldb/trunk/source/Core/ValueObject.cpp Thu Oct 1 18:07:06 2015 @@ -4284,13 +4284,11 @@ ValueObject::Persist () ConstString name(persistent_state->GetNextPersistentVariableName()); -ExpressionVariableSP clang_var_sp(new ClangExpressionVariable(target_sp.get(), GetValue(), name)); -if (clang_var_sp) -{ -clang_var_sp->m_live_sp = clang_var_sp->m_frozen_sp; -clang_var_sp->m_flags |= ClangExpressionVariable::EVIsProgramReference; -persistent_state->AddVariable(clang_var_sp); -} +ValueObjectSP const_result_sp = ValueObjectConstResult::Create (target_sp.get(), GetValue(), name); + +ExpressionVariableSP clang_var_sp = persistent_state->CreatePersistentVariable(const_result_sp); +clang_var_sp->m_live_sp = clang_var_sp->m_frozen_sp; +clang_var_sp->m_flags |= ExpressionVariable::EVIsProgramReference; return clang_var_sp->GetValueObject(); } Modified: lldb/trunk/source/Expression/Materializer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=249095&r1=249094&r2=249095&view=diff ==
[Lldb-commits] [lldb] r249167 - Made GetScratchTypeSystemForLanguage return an error if desired.
Author: spyffe Date: Fri Oct 2 13:40:30 2015 New Revision: 249167 URL: http://llvm.org/viewvc/llvm-project?rev=249167&view=rev Log: Made GetScratchTypeSystemForLanguage return an error if desired. Also made it not store nullptrs in its TypeSystemMap, so it will retry to make the AST context if it errored out last time. Modified: lldb/trunk/include/lldb/Target/Target.h lldb/trunk/source/DataFormatters/VectorType.cpp lldb/trunk/source/Expression/ExpressionSourceCode.cpp lldb/trunk/source/Expression/Materializer.cpp lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.cpp lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp lldb/trunk/source/Target/Target.cpp lldb/trunk/source/Target/ThreadPlanTracer.cpp Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=249167&r1=249166&r2=249167&view=diff == --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Fri Oct 2 13:40:30 2015 @@ -1229,7 +1229,7 @@ public: GetImageSearchPathList (); TypeSystem * -GetScratchTypeSystemForLanguage (lldb::LanguageType language, bool create_on_demand = true); +GetScratchTypeSystemForLanguage (Error *error, lldb::LanguageType language, bool create_on_demand = true); PersistentExpressionState * GetPersistentExpressionStateForLanguage (lldb::LanguageType language); @@ -1506,7 +1506,7 @@ public: protected: ClangASTContext * -GetScratchClangASTContextImpl(); +GetScratchClangASTContextImpl(Error *error); //-- // Member variables. Modified: lldb/trunk/source/DataFormatters/VectorType.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/VectorType.cpp?rev=249167&r1=249166&r2=249167&view=diff == --- lldb/trunk/source/DataFormatters/VectorType.cpp (original) +++ lldb/trunk/source/DataFormatters/VectorType.cpp Fri Oct 2 13:40:30 2015 @@ -235,7 +235,7 @@ namespace lldb_private { TargetSP target_sp(m_backend.GetTargetSP()); m_child_type = ::GetCompilerTypeForFormat(m_parent_format, element_type, - target_sp ? target_sp->GetScratchTypeSystemForLanguage(lldb::eLanguageTypeC) : nullptr); + target_sp ? target_sp->GetScratchTypeSystemForLanguage(nullptr, lldb::eLanguageTypeC) : nullptr); m_num_children = ::CalculateNumChildren(parent_type, m_child_type); m_item_format = GetItemFormatForFormat(m_parent_format, Modified: lldb/trunk/source/Expression/ExpressionSourceCode.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ExpressionSourceCode.cpp?rev=249167&r1=249166&r2=249167&view=diff == --- lldb/trunk/source/Expression/ExpressionSourceCode.cpp (original) +++ lldb/trunk/source/Expression/ExpressionSourceCode.cpp Fri Oct 2 13:40:30 2015 @@ -83,7 +83,7 @@ bool ExpressionSourceCode::GetText (std: if (ClangModulesDeclVendor *decl_vendor = target->GetClangModulesDeclVendor()) { -ClangPersistentVariables *persistent_vars = llvm::cast(target->GetScratchTypeSystemForLanguage(lldb::eLanguageTypeC)->GetPersistentExpressionState()); +ClangPersistentVariables *persistent_vars = llvm::cast(target->GetPersistentExpressionStateForLanguage(lldb::eLanguageTypeC)); const ClangModulesDeclVendor::ModuleVector &hand_imported_modules = persistent_vars->GetHandLoadedClangModules(); ClangModulesDeclVendor::ModuleVector modules_for_macros; Modified: lldb/trunk/source/Expression/Materializer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=249167&r1=249166&r2=249167&view=diff == --- lldb/trunk/source/Expression/Materializer.cpp (original) +++ lldb/trunk/source/Expression/Materializer.cpp Fri Oct 2 13:40:30 2015 @@ -857,11 +857,12 @@ public: return; } -TypeSystem *type_system = target_sp->GetScratchTypeSystemForLanguage(m_type.GetMinimumLanguage()); +Error type_system_error; +TypeSystem *type_system = target_sp->GetScratchTypeSystemForLanguage(&type_system_error, m_type.GetMinimumLanguage()); if (!type_system) { -err.SetErrorString("Couldn't dematerialize a result variable: coul
[Lldb-commits] [lldb] r249233 - Add PersistentVariableDelegate to handle language-specific dematerialization.
Author: spyffe Date: Sat Oct 3 04:09:01 2015 New Revision: 249233 URL: http://llvm.org/viewvc/llvm-project?rev=249233&view=rev Log: Add PersistentVariableDelegate to handle language-specific dematerialization. The concept here is that languages may have different ways of communicating results. In particular, languages may have different names for their result variables and in fact may have multiple types of result variables (e.g., error results). Materializer was tied to one specific model of result handling. Instead, now UserExpressions can register their own handlers for the result variables they inject. This allows language-specific code in Materializer to be moved into the expression parser plug-in, and it simplifies Materializer. These delegates are subclasses of PersistentVariableDelegate. PersistentVariableDelegate can provide the name of the result variable, and is notified when the result variable is populated. It can also be used to touch persistent variables if need be, updating language-specific state. The UserExpression owns the delegate and can decide on its result based on consulting all of its (potentially multiple) delegates. The user expression itself now makes the determination of what the final result of the expression is, rather than relying on the Materializer, and I've added a virtual function to UserExpression to allow this. Modified: lldb/trunk/include/lldb/Expression/Materializer.h lldb/trunk/include/lldb/Expression/UserExpression.h lldb/trunk/source/Expression/Materializer.cpp lldb/trunk/source/Expression/UserExpression.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp Modified: lldb/trunk/include/lldb/Expression/Materializer.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/Materializer.h?rev=249233&r1=249232&r2=249233&view=diff == --- lldb/trunk/include/lldb/Expression/Materializer.h (original) +++ lldb/trunk/include/lldb/Expression/Materializer.h Sat Oct 3 04:09:01 2015 @@ -44,7 +44,6 @@ public: } void Dematerialize (Error &err, -lldb::ExpressionVariableSP &result_sp, lldb::addr_t frame_top, lldb::addr_t frame_bottom); @@ -84,11 +83,28 @@ public: DematerializerSP Materialize (lldb::StackFrameSP &frame_sp, IRMemoryMap &map, lldb::addr_t process_address, Error &err); -uint32_t AddPersistentVariable (lldb::ExpressionVariableSP &persistent_variable_sp, Error &err); -uint32_t AddVariable (lldb::VariableSP &variable_sp, Error &err); -uint32_t AddResultVariable (const CompilerType &type, bool is_lvalue, bool keep_in_memory, Error &err); -uint32_t AddSymbol (const Symbol &symbol_sp, Error &err); -uint32_t AddRegister (const RegisterInfo ®ister_info, Error &err); +class PersistentVariableDelegate +{ +public: +virtual ~PersistentVariableDelegate(); +virtual ConstString GetName() = 0; +virtual void DidDematerialize(lldb::ExpressionVariableSP &variable) = 0; +}; + +uint32_t AddPersistentVariable (lldb::ExpressionVariableSP &persistent_variable_sp, +PersistentVariableDelegate *delegate, +Error &err); +uint32_t AddVariable (lldb::VariableSP &variable_sp, + Error &err); +uint32_t AddResultVariable (const CompilerType &type, +bool is_lvalue, +bool keep_in_memory, +PersistentVariableDelegate *delegate, +Error &err); +uint32_t AddSymbol (const Symbol &symbol_sp, +Error &err); +uint32_t AddRegister (const RegisterInfo ®ister_info, + Error &err); uint32_t GetStructAlignment () { @@ -100,14 +116,6 @@ public: return m_current_offset; } -uint32_t GetResultOffset () -{ -if (m_result_entity) -return m_result_entity->GetOffset(); -else -return UINT32_MAX; -} - class Entity { public: @@ -163,7 +171,6 @@ private: DematerializerWPm_dematerializer_wp; EntityVectorm_entities; -Entity *m_result_entity; uint32_tm_current_offset; uint32_tm_struct_alignment; }; Modified: lldb/trunk/include/lldb/Expression/UserE
[Lldb-commits] [lldb] r249769 - Added support for enumerating the languages that actually support TypeSystems
Author: spyffe Date: Thu Oct 8 18:07:53 2015 New Revision: 249769 URL: http://llvm.org/viewvc/llvm-project?rev=249769&view=rev Log: Added support for enumerating the languages that actually support TypeSystems and expressions. Also wired that into the OptionValue infrastructure, although it isn't used for tab-completion yet. Modified: lldb/trunk/include/lldb/Core/PluginManager.h lldb/trunk/include/lldb/Symbol/ClangASTContext.h lldb/trunk/include/lldb/Symbol/GoASTContext.h lldb/trunk/include/lldb/Target/Language.h lldb/trunk/include/lldb/lldb-private-interfaces.h lldb/trunk/source/Core/PluginManager.cpp lldb/trunk/source/Interpreter/OptionValueLanguage.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/source/Symbol/GoASTContext.cpp lldb/trunk/source/Target/Language.cpp Modified: lldb/trunk/include/lldb/Core/PluginManager.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=249769&r1=249768&r2=249769&view=diff == --- lldb/trunk/include/lldb/Core/PluginManager.h (original) +++ lldb/trunk/include/lldb/Core/PluginManager.h Thu Oct 8 18:07:53 2015 @@ -425,7 +425,8 @@ public: static bool RegisterPlugin (const ConstString &name, const char *description, -TypeSystemCreateInstance create_callback); +TypeSystemCreateInstance create_callback, +TypeSystemEnumerateSupportedLanguages enumerate_languages_callback); static bool UnregisterPlugin (TypeSystemCreateInstance create_callback); @@ -436,6 +437,12 @@ public: static TypeSystemCreateInstance GetTypeSystemCreateCallbackForPluginName (const ConstString &name); +static TypeSystemEnumerateSupportedLanguages +GetTypeSystemEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx); + +static TypeSystemEnumerateSupportedLanguages +GetTypeSystemEnumerateSupportedLanguagesCallbackForPluginName (const ConstString &name); + //-- // Some plug-ins might register a DebuggerInitializeCallback // callback when registering the plug-in. After a new Debugger Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=249769&r1=249768&r2=249769&view=diff == --- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Thu Oct 8 18:07:53 2015 @@ -72,6 +72,9 @@ public: static lldb::TypeSystemSP CreateInstance (lldb::LanguageType language, Module *module, Target *target); + +static void +EnumerateSupportedLanguages(std::set &languages_for_types, std::set &languages_for_expressions); static void Initialize (); Modified: lldb/trunk/include/lldb/Symbol/GoASTContext.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/GoASTContext.h?rev=249769&r1=249768&r2=249769&view=diff == --- lldb/trunk/include/lldb/Symbol/GoASTContext.h (original) +++ lldb/trunk/include/lldb/Symbol/GoASTContext.h Thu Oct 8 18:07:53 2015 @@ -41,6 +41,9 @@ class GoASTContext : public TypeSystem static lldb::TypeSystemSP CreateInstance (lldb::LanguageType language, Module *module, Target *target); + +static void +EnumerateSupportedLanguages(std::set &languages_for_types, std::set &languages_for_expressions); static void Initialize (); Modified: lldb/trunk/include/lldb/Target/Language.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=249769&r1=249768&r2=249769&view=diff == --- lldb/trunk/include/lldb/Target/Language.h (original) +++ lldb/trunk/include/lldb/Target/Language.h Thu Oct 8 18:07:53 2015 @@ -139,7 +139,11 @@ public: static bool LanguageIsPascal (lldb::LanguageType language); - + +static void +GetLanguagesSupportingTypeSystems (std::set &languages, + std::set &languages_for_expressions); + protected: //-- // Classes that inherit from Language can see and modify these Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=249769&r1=249768&r2=249769&view=diff == --- lldb/trunk/include/lldb/lldb-private-interfaces.h (original) +++ lldb/trunk/include/lldb/lldb-private-interfaces.h Thu Oct 8 18:07:53 2015
[Lldb-commits] [lldb] r249864 - Don't blindly use C for eLanguageTypeUnknown when getting a scratch TypeSystem.
Author: spyffe Date: Fri Oct 9 13:01:10 2015 New Revision: 249864 URL: http://llvm.org/viewvc/llvm-project?rev=249864&view=rev Log: Don't blindly use C for eLanguageTypeUnknown when getting a scratch TypeSystem. Instead check what languages are supported for expressions; use C if available, but otherwise pick one of the supported languages. This can be overridden using the target settings. Modified: lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/source/Target/Target.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=249864&r1=249863&r2=249864&view=diff == --- lldb/trunk/source/Target/Target.cpp (original) +++ lldb/trunk/source/Target/Target.cpp Fri Oct 9 13:01:10 2015 @@ -1901,7 +1901,26 @@ Target::GetScratchTypeSystemForLanguage if (language == eLanguageTypeMipsAssembler // GNU AS and LLVM use it for all assembly code || language == eLanguageTypeUnknown) { -language = eLanguageTypeC; +std::set languages_for_types; +std::set languages_for_expressions; + +Language::GetLanguagesSupportingTypeSystems(languages_for_types, languages_for_expressions); + +if (languages_for_expressions.count(eLanguageTypeC)) +{ +language = eLanguageTypeC; // LLDB's default. Override by setting the target language. +} +else +{ +if (languages_for_expressions.empty()) +{ +return nullptr; +} +else +{ +language = *languages_for_expressions.begin(); +} +} } return m_scratch_type_system_map.GetTypeSystemForLanguage(language, this, create_on_demand); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250753 - Added the concept of a Read-Eval-Print-Loop to LLDB.
Author: spyffe Date: Mon Oct 19 18:11:07 2015 New Revision: 250753 URL: http://llvm.org/viewvc/llvm-project?rev=250753&view=rev Log: Added the concept of a Read-Eval-Print-Loop to LLDB. A REPL takes over the command line and typically treats input as source code. REPLs can also do code completion. The REPL class allows its subclasses to implement the language-specific functionality without having to know about the IOHandler-specific internals. Also added a PluginManager-based way of getting to a REPL given a language and a target. Also brought in some utility code and expression options that are useful for REPLs, such as line offsets for expressions, ANSI terminal coloring of errors, and a few IOHandler convenience functions. Added: lldb/trunk/include/lldb/Expression/REPL.h lldb/trunk/source/Expression/REPL.cpp Modified: lldb/trunk/include/lldb/Core/Debugger.h lldb/trunk/include/lldb/Core/IOHandler.h lldb/trunk/include/lldb/Core/PluginManager.h lldb/trunk/include/lldb/Expression/UserExpression.h lldb/trunk/include/lldb/Host/File.h lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h lldb/trunk/include/lldb/Target/Target.h lldb/trunk/include/lldb/Utility/AnsiTerminal.h lldb/trunk/include/lldb/lldb-forward.h lldb/trunk/include/lldb/lldb-private-interfaces.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Core/PluginManager.cpp lldb/trunk/source/Expression/UserExpression.cpp lldb/trunk/source/Host/common/File.cpp lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Core/Debugger.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=250753&r1=250752&r2=250753&view=diff == --- lldb/trunk/include/lldb/Core/Debugger.h (original) +++ lldb/trunk/include/lldb/Core/Debugger.h Mon Oct 19 18:11:07 2015 @@ -203,6 +203,10 @@ public: bool IsTopIOHandler (const lldb::IOHandlerSP& reader_sp); + +bool +CheckTopIOHandlerTypes (IOHandler::Type top_type, +IOHandler::Type second_top_type); void PrintAsync (const char *s, size_t len, bool is_stdout); @@ -322,6 +326,24 @@ public: GetAutoOneLineSummaries () const; bool +GetAutoIndent () const; + +bool +SetAutoIndent (bool b); + +bool +GetPrintDecls () const; + +bool +SetPrintDecls (bool b); + +uint32_t +GetTabSize () const; + +bool +SetTabSize (uint32_t tab_size); + +bool GetEscapeNonPrintables () const; bool @@ -362,6 +384,7 @@ public: protected: friend class CommandInterpreter; +friend class REPL; bool StartEventHandlerThread(); @@ -373,11 +396,17 @@ protected: EventHandlerThread (lldb::thread_arg_t arg); bool +HasIOHandlerThread(); + +bool StartIOHandlerThread(); void StopIOHandlerThread(); +void +JoinIOHandlerThread(); + static lldb::thread_result_t IOHandlerThread (lldb::thread_arg_t arg); Modified: lldb/trunk/include/lldb/Core/IOHandler.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/IOHandler.h?rev=250753&r1=250752&r2=250753&view=diff == --- lldb/trunk/include/lldb/Core/IOHandler.h (original) +++ lldb/trunk/include/lldb/Core/IOHandler.h Mon Oct 19 18:11:07 2015 @@ -42,6 +42,7 @@ namespace lldb_private { Confirm, Curses, Expression, +REPL, ProcessIO, PythonInterpreter, PythonCode, Modified: lldb/trunk/include/lldb/Core/PluginManager.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=250753&r1=250752&r2=250753&view=diff == --- lldb/trunk/include/lldb/Core/PluginManager.h (original) +++ lldb/trunk/include/lldb/Core/PluginManager.h Mon Oct 19 18:11:07 2015 @@ -444,6 +444,23 @@ public: GetTypeSystemEnumerateSupportedLanguagesCallbackForPluginName (const ConstString &name); //-- +// REPL +//-- +static bool +RegisterPlugin (const ConstString &name, +const char *description, +REPLCreateInstance create_callback); + +static bool +UnregisterPlugin (REPLCreateInstance create_callback); + +static REPLCreateInstance +GetREPLCreateCallbackAtIndex (uint32_t idx); + +static REPLCreateInstance +GetREPLCreateCallbackForPluginName (const ConstString &name); + +//
[Lldb-commits] [lldb] r250755 - Added REPL.cpp to the relevant CMakeLists.txt
Author: spyffe Date: Mon Oct 19 18:18:49 2015 New Revision: 250755 URL: http://llvm.org/viewvc/llvm-project?rev=250755&view=rev Log: Added REPL.cpp to the relevant CMakeLists.txt Modified: lldb/trunk/source/Expression/CMakeLists.txt Modified: lldb/trunk/source/Expression/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/CMakeLists.txt?rev=250755&r1=250754&r2=250755&view=diff == --- lldb/trunk/source/Expression/CMakeLists.txt (original) +++ lldb/trunk/source/Expression/CMakeLists.txt Mon Oct 19 18:18:49 2015 @@ -9,6 +9,7 @@ add_lldb_library(lldbExpression IRInterpreter.cpp IRMemoryMap.cpp Materializer.cpp + REPL.cpp UserExpression.cpp UtilityFunction.cpp ) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250773 - Added support for the "--repl" argument to LLDB.
Author: spyffe Date: Mon Oct 19 19:23:46 2015 New Revision: 250773 URL: http://llvm.org/viewvc/llvm-project?rev=250773&view=rev Log: Added support for the "--repl" argument to LLDB. This makes LLDB launch and create a REPL, specifying no target so that the REPL can create one for itself. Also added the "--repl-language" option, which specifies the language to use. Plumbed the relevant arguments and errors through the REPL creation mechanism. Modified: lldb/trunk/include/lldb/API/SBDebugger.h lldb/trunk/include/lldb/Core/Debugger.h lldb/trunk/include/lldb/Expression/REPL.h lldb/trunk/include/lldb/Target/Target.h lldb/trunk/include/lldb/lldb-private-interfaces.h lldb/trunk/scripts/interface/SBDebugger.i lldb/trunk/source/API/SBDebugger.cpp lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Expression/REPL.cpp lldb/trunk/source/Target/Target.cpp lldb/trunk/tools/driver/Driver.cpp lldb/trunk/tools/driver/Driver.h Modified: lldb/trunk/include/lldb/API/SBDebugger.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDebugger.h?rev=250773&r1=250772&r2=250773&view=diff == --- lldb/trunk/include/lldb/API/SBDebugger.h (original) +++ lldb/trunk/include/lldb/API/SBDebugger.h Mon Oct 19 19:23:46 2015 @@ -329,6 +329,9 @@ public: int &num_errors, bool &quit_requested, bool &stopped_for_crash); + +SBError +RunREPL (lldb::LanguageType language, const char *repl_options); private: friend class SBCommandInterpreter; Modified: lldb/trunk/include/lldb/Core/Debugger.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=250773&r1=250772&r2=250773&view=diff == --- lldb/trunk/include/lldb/Core/Debugger.h (original) +++ lldb/trunk/include/lldb/Core/Debugger.h Mon Oct 19 19:23:46 2015 @@ -375,6 +375,9 @@ public: { return m_event_handler_thread.IsJoinable(); } + +Error +RunREPL (lldb::LanguageType language, const char *repl_options); // This is for use in the command interpreter, when you either want the selected target, or if no target // is present you want to prime the dummy target with entities that will be copied over to new targets. Modified: lldb/trunk/include/lldb/Expression/REPL.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/REPL.h?rev=250773&r1=250772&r2=250773&view=diff == --- lldb/trunk/include/lldb/Expression/REPL.h (original) +++ lldb/trunk/include/lldb/Expression/REPL.h Mon Oct 19 19:23:46 2015 @@ -37,8 +37,26 @@ public: virtual ~REPL(); +//-- +/// Get a REPL with an (optional) existing target, and (optional) extra arguments for the compiler. +/// +/// @param[out] error +/// If this language is supported but the REPL couldn't be created, this error is populated with the reason. +/// +/// @param[in] language +/// The language to create a REPL for. +/// +/// @param[in] target +/// If provided, the target to put the REPL inside. +/// +/// @param[in] repl_options +/// If provided, additional options for the compiler when parsing REPL expressions. +/// +/// @return +/// The range of the containing object in the target process. +//-- static lldb::REPLSP -Create (lldb::LanguageType language, Target *target); +Create (Error &Error, lldb::LanguageType language, Target *target, const char *repl_options); void SetFormatOptions (const OptionGroupFormat &options) Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=250773&r1=250772&r2=250773&view=diff == --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Mon Oct 19 19:23:46 2015 @@ -1568,7 +1568,7 @@ public: GetSearchFilterForModuleAndCUList (const FileSpecList *containingModules, const FileSpecList *containingSourceFiles); lldb::REPLSP -GetREPL (lldb::LanguageType, bool can_create); +GetREPL (Error &err, lldb::LanguageType language, const char *repl_options, bool can_create); protected: //-- Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250773&r1=250772&r2=250773&view=diff ===
[Lldb-commits] [lldb] r250780 - Added support to the expression command for dropping into the REPL at will.
Author: spyffe Date: Mon Oct 19 19:55:21 2015 New Revision: 250780 URL: http://llvm.org/viewvc/llvm-project?rev=250780&view=rev Log: Added support to the expression command for dropping into the REPL at will. "expr -r" does this. It also returns to a REPL if the LLDB command interpreter is neseted inside it, for example in cases where a REPL command resulted in a breakpoint being hit or a crash. Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp lldb/trunk/source/Commands/CommandObjectExpression.h Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=250780&r1=250779&r2=250780&view=diff == --- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Mon Oct 19 19:55:21 2015 @@ -19,6 +19,7 @@ #include "Plugins/ExpressionParser/Clang/ClangExpressionVariable.h" #include "lldb/Expression/UserExpression.h" #include "lldb/Expression/DWARFExpression.h" +#include "lldb/Expression/REPL.h" #include "lldb/Host/Host.h" #include "lldb/Host/StringConvert.h" #include "lldb/Core/Debugger.h" @@ -198,6 +199,7 @@ CommandObjectExpression::CommandObjectEx IOHandlerDelegate (IOHandlerDelegate::Completion::Expression), m_option_group (interpreter), m_format_options (eFormatDefault), +m_repl_option (LLDB_OPT_SET_1, false, "repl", 'r', "Drop into REPL", false, true), m_command_options (), m_expr_line_count (0), m_expr_lines () @@ -253,6 +255,7 @@ Examples: m_option_group.Append (&m_format_options, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_GDB_FMT, LLDB_OPT_SET_1); m_option_group.Append (&m_command_options); m_option_group.Append (&m_varobj_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1 | LLDB_OPT_SET_2); +m_option_group.Append (&m_repl_option, LLDB_OPT_SET_ALL, LLDB_OPT_SET_3); m_option_group.Finalize(); } @@ -502,8 +505,70 @@ CommandObjectExpression::DoExecute return false; } +if (m_repl_option.GetOptionValue().GetCurrentValue()) +{ +Target *target = m_interpreter.GetExecutionContext().GetTargetPtr(); +if (target) +{ +// Drop into REPL +m_expr_lines.clear(); +m_expr_line_count = 0; + +Debugger &debugger = target->GetDebugger(); + +// Check if the LLDB command interpreter is sitting on top of a REPL that +// launched it... +if (debugger.CheckTopIOHandlerTypes(IOHandler::Type::CommandInterpreter, IOHandler::Type::REPL)) +{ +// the LLDB command interpreter is sitting on top of a REPL that launched it, +// so just say the command interpreter is done and fall back to the existing REPL +m_interpreter.GetIOHandler(false)->SetIsDone(true); +} +else +{ +// We are launching the REPL on top of the current LLDB command interpreter, +// so just push one +bool initialize = false; +Error repl_error; +REPLSP repl_sp (target->GetREPL(repl_error, m_command_options.language, nullptr, false)); + +if (!repl_sp) +{ +initialize = true; +repl_sp = target->GetREPL(repl_error, m_command_options.language, nullptr, true); +if (!repl_error.Success()) +{ +result.SetError(repl_error); +return result.Succeeded(); +} +} + +if (repl_sp) +{ +if (initialize) +{ +repl_sp->SetCommandOptions(m_command_options); +repl_sp->SetFormatOptions(m_format_options); + repl_sp->SetValueObjectDisplayOptions(m_varobj_options); +} + +IOHandlerSP io_handler_sp (repl_sp->GetIOHandler()); + +io_handler_sp->SetIsDone(false); + +debugger.PushIOHandler(io_handler_sp); +} +else +
[Lldb-commits] [lldb] r250869 - When target is NULL, provide a debugger so that REPLs can use that to create
Author: spyffe Date: Tue Oct 20 19:28:44 2015 New Revision: 250869 URL: http://llvm.org/viewvc/llvm-project?rev=250869&view=rev Log: When target is NULL, provide a debugger so that REPLs can use that to create their own target. Modified: lldb/trunk/include/lldb/Expression/REPL.h lldb/trunk/include/lldb/lldb-private-interfaces.h lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Expression/REPL.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Expression/REPL.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/REPL.h?rev=250869&r1=250868&r2=250869&view=diff == --- lldb/trunk/include/lldb/Expression/REPL.h (original) +++ lldb/trunk/include/lldb/Expression/REPL.h Tue Oct 20 19:28:44 2015 @@ -38,7 +38,7 @@ public: virtual ~REPL(); //-- -/// Get a REPL with an (optional) existing target, and (optional) extra arguments for the compiler. +/// Get a REPL with an existing target (or, failing that, a debugger to use), and (optional) extra arguments for the compiler. /// /// @param[out] error /// If this language is supported but the REPL couldn't be created, this error is populated with the reason. @@ -46,6 +46,9 @@ public: /// @param[in] language /// The language to create a REPL for. /// +/// @param[in] debugger +/// If provided, and target is NULL, the debugger to use when setting up a top-level REPL. +/// /// @param[in] target /// If provided, the target to put the REPL inside. /// @@ -56,7 +59,7 @@ public: /// The range of the containing object in the target process. //-- static lldb::REPLSP -Create (Error &Error, lldb::LanguageType language, Target *target, const char *repl_options); +Create (Error &Error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options); void SetFormatOptions (const OptionGroupFormat &options) Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250869&r1=250868&r2=250869&view=diff == --- lldb/trunk/include/lldb/lldb-private-interfaces.h (original) +++ lldb/trunk/include/lldb/lldb-private-interfaces.h Tue Oct 20 19:28:44 2015 @@ -49,7 +49,7 @@ namespace lldb_private typedef lldb::InstrumentationRuntimeType (*InstrumentationRuntimeGetType) (); typedef lldb::InstrumentationRuntimeSP (*InstrumentationRuntimeCreateInstance) (const lldb::ProcessSP &process_sp); typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) (lldb::LanguageType language, Module *module, Target *target); -typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, lldb::LanguageType language, Target *target, const char *repl_options); +typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options); typedef void (*TypeSystemEnumerateSupportedLanguages) (std::set &languages_for_types, std::set &languages_for_expressions); typedef int (*ComparisonFunction)(const void *, const void *); typedef void (*DebuggerInitializeCallback)(Debugger &debugger); Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250869&r1=250868&r2=250869&view=diff == --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Tue Oct 20 19:28:44 2015 @@ -1813,7 +1813,7 @@ Debugger::RunREPL (LanguageType language Target *const target = nullptr; // passing in an empty target means the REPL must create one -REPLSP repl_sp(REPL::Create(err, language, target, repl_options)); +REPLSP repl_sp(REPL::Create(err, language, this, target, repl_options)); if (!err.Success()) { Modified: lldb/trunk/source/Expression/REPL.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/REPL.cpp?rev=250869&r1=250868&r2=250869&view=diff == --- lldb/trunk/source/Expression/REPL.cpp (original) +++ lldb/trunk/source/Expression/REPL.cpp Tue Oct 20 19:28:44 2015 @@ -23,14 +23,14 @@ using namespace lldb_private; lldb::REPLSP -REPL::Create(Error &err, lldb::LanguageType language, Target *target, const char *repl_options) +REPL::Create(Error &err, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options) { uint32_t idx = 0; lldb::REPLSP ret; while (REPLCreate
[Lldb-commits] [lldb] r250870 - When a REPL creates a new target for itself, it is that target's REPL.
Author: spyffe Date: Tue Oct 20 19:36:34 2015 New Revision: 250870 URL: http://llvm.org/viewvc/llvm-project?rev=250870&view=rev Log: When a REPL creates a new target for itself, it is that target's REPL. To allow that, I've added a SetREPL call to the Target, which allows a REPL that just created a target to install itself as the go-to REPL for the corresponding language. Modified: lldb/trunk/include/lldb/Target/Target.h lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=250870&r1=250869&r2=250870&view=diff == --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Tue Oct 20 19:36:34 2015 @@ -1569,6 +1569,9 @@ public: lldb::REPLSP GetREPL (Error &err, lldb::LanguageType language, const char *repl_options, bool can_create); + +void +SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp); protected: //-- Modified: lldb/trunk/source/Target/Target.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=250870&r1=250869&r2=250870&view=diff == --- lldb/trunk/source/Target/Target.cpp (original) +++ lldb/trunk/source/Target/Target.cpp Tue Oct 20 19:36:34 2015 @@ -56,6 +56,7 @@ #include "lldb/Target/SystemRuntime.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadSpec.h" +#include "lldb/Utility/LLDBAssert.h" using namespace lldb; using namespace lldb_private; @@ -251,6 +252,14 @@ Target::GetREPL (Error &err, lldb::Langu } void +Target::SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp) +{ +lldbassert(!m_repl_map.count(language)); + +m_repl_map[language] = repl_sp; +} + +void Target::Destroy() { Mutex::Locker locker (m_mutex); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r250913 - Made the REPL choose a default language if only one REPL can be chosen.
Author: spyffe Date: Wed Oct 21 12:43:18 2015 New Revision: 250913 URL: http://llvm.org/viewvc/llvm-project?rev=250913&view=rev Log: Made the REPL choose a default language if only one REPL can be chosen. This requires REPLs to enumerate the languages they support. Modified: lldb/trunk/include/lldb/Core/PluginManager.h lldb/trunk/include/lldb/Target/Language.h lldb/trunk/include/lldb/lldb-private-interfaces.h lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Core/PluginManager.cpp lldb/trunk/source/Target/Language.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Core/PluginManager.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=250913&r1=250912&r2=250913&view=diff == --- lldb/trunk/include/lldb/Core/PluginManager.h (original) +++ lldb/trunk/include/lldb/Core/PluginManager.h Wed Oct 21 12:43:18 2015 @@ -449,7 +449,8 @@ public: static bool RegisterPlugin (const ConstString &name, const char *description, -REPLCreateInstance create_callback); +REPLCreateInstance create_callback, +REPLEnumerateSupportedLanguages enumerate_languages_callback); static bool UnregisterPlugin (REPLCreateInstance create_callback); @@ -460,6 +461,12 @@ public: static REPLCreateInstance GetREPLCreateCallbackForPluginName (const ConstString &name); +static REPLEnumerateSupportedLanguages +GetREPLEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx); + +static REPLEnumerateSupportedLanguages +GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName (const ConstString &name); + //-- // Some plug-ins might register a DebuggerInitializeCallback // callback when registering the plug-in. After a new Debugger Modified: lldb/trunk/include/lldb/Target/Language.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=250913&r1=250912&r2=250913&view=diff == --- lldb/trunk/include/lldb/Target/Language.h (original) +++ lldb/trunk/include/lldb/Target/Language.h Wed Oct 21 12:43:18 2015 @@ -149,6 +149,9 @@ public: static void GetLanguagesSupportingTypeSystems (std::set &languages, std::set &languages_for_expressions); + +static void +GetLanguagesSupportingREPLs (std::set &languages); protected: //-- Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250913&r1=250912&r2=250913&view=diff == --- lldb/trunk/include/lldb/lldb-private-interfaces.h (original) +++ lldb/trunk/include/lldb/lldb-private-interfaces.h Wed Oct 21 12:43:18 2015 @@ -51,6 +51,7 @@ namespace lldb_private typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) (lldb::LanguageType language, Module *module, Target *target); typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options); typedef void (*TypeSystemEnumerateSupportedLanguages) (std::set &languages_for_types, std::set &languages_for_expressions); +typedef void (*REPLEnumerateSupportedLanguages) (std::set &languages); typedef int (*ComparisonFunction)(const void *, const void *); typedef void (*DebuggerInitializeCallback)(Debugger &debugger); Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250913&r1=250912&r2=250913&view=diff == --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Wed Oct 21 12:43:18 2015 @@ -1805,11 +1805,6 @@ Debugger::RunREPL (LanguageType language { Error err; FileSpec repl_executable; -if (language == eLanguageTypeUnknown) -{ -err.SetErrorString ("must specify a language for a REPL"); // TODO make it possible to specify a default language -return err; -} Target *const target = nullptr; // passing in an empty target means the REPL must create one Modified: lldb/trunk/source/Core/PluginManager.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=250913&r1=250912&r2=250913&view=diff == --- lldb/trunk/source/Core/PluginManager.cpp (original) +++ lldb/trunk/source/Core/PluginManager.cpp Wed Oct 21 12:
Re: [Lldb-commits] [lldb] r250913 - Made the REPL choose a default language if only one REPL can be chosen.
Yeah, this was a really lousy commit. I’m sorry I committed without checking whether it linked. Thanks for reverting. I will fix this and re-commit. Sean > On Oct 21, 2015, at 11:43 AM, Siva Chandra wrote: > > This breaks the build because of two things: > > 1. The function GetLanguagesSupportingREPLs is declared static in > Language.cpp, but Language.h has it declared as a static method. > 2. There is a declaration for a static method > GetREPLEnumerateSupportedLanguagesCallbackAtIndex in PluginManager, > but no definition anywhere. > > On Wed, Oct 21, 2015 at 10:43 AM, Sean Callanan via lldb-commits > wrote: >> Author: spyffe >> Date: Wed Oct 21 12:43:18 2015 >> New Revision: 250913 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=250913&view=rev >> Log: >> Made the REPL choose a default language if only one REPL can be chosen. >> This requires REPLs to enumerate the languages they support. >> >> Modified: >>lldb/trunk/include/lldb/Core/PluginManager.h >>lldb/trunk/include/lldb/Target/Language.h >>lldb/trunk/include/lldb/lldb-private-interfaces.h >>lldb/trunk/source/Core/Debugger.cpp >>lldb/trunk/source/Core/PluginManager.cpp >>lldb/trunk/source/Target/Language.cpp >>lldb/trunk/source/Target/Target.cpp >> >> Modified: lldb/trunk/include/lldb/Core/PluginManager.h >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=250913&r1=250912&r2=250913&view=diff >> == >> --- lldb/trunk/include/lldb/Core/PluginManager.h (original) >> +++ lldb/trunk/include/lldb/Core/PluginManager.h Wed Oct 21 12:43:18 2015 >> @@ -449,7 +449,8 @@ public: >> static bool >> RegisterPlugin (const ConstString &name, >> const char *description, >> -REPLCreateInstance create_callback); >> +REPLCreateInstance create_callback, >> +REPLEnumerateSupportedLanguages >> enumerate_languages_callback); >> >> static bool >> UnregisterPlugin (REPLCreateInstance create_callback); >> @@ -460,6 +461,12 @@ public: >> static REPLCreateInstance >> GetREPLCreateCallbackForPluginName (const ConstString &name); >> >> +static REPLEnumerateSupportedLanguages >> +GetREPLEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx); >> + >> +static REPLEnumerateSupportedLanguages >> +GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName (const >> ConstString &name); >> + >> //-- >> // Some plug-ins might register a DebuggerInitializeCallback >> // callback when registering the plug-in. After a new Debugger >> >> Modified: lldb/trunk/include/lldb/Target/Language.h >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=250913&r1=250912&r2=250913&view=diff >> == >> --- lldb/trunk/include/lldb/Target/Language.h (original) >> +++ lldb/trunk/include/lldb/Target/Language.h Wed Oct 21 12:43:18 2015 >> @@ -149,6 +149,9 @@ public: >> static void >> GetLanguagesSupportingTypeSystems (std::set >> &languages, >>std::set >> &languages_for_expressions); >> + >> +static void >> +GetLanguagesSupportingREPLs (std::set &languages); >> >> protected: >> //-- >> >> Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250913&r1=250912&r2=250913&view=diff >> == >> --- lldb/trunk/include/lldb/lldb-private-interfaces.h (original) >> +++ lldb/trunk/include/lldb/lldb-private-interfaces.h Wed Oct 21 12:43:18 >> 2015 >> @@ -51,6 +51,7 @@ namespace lldb_private >> typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) >> (lldb::LanguageType language, Module *module, Target *target); >> typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, >> lldb::LanguageType language, Debugger *debugger, Target *target, const char >> *repl_options); >> typedef void (*TypeSystemEnumerateSupportedLanguages) >&
[Lldb-commits] [lldb] r250928 - Fixed version of r250913, which actually implements all the static functions.
Author: spyffe Date: Wed Oct 21 14:14:33 2015 New Revision: 250928 URL: http://llvm.org/viewvc/llvm-project?rev=250928&view=rev Log: Fixed version of r250913, which actually implements all the static functions. Thanks to Siva Chandra and Oleksiy Vyalov for pouncing on this. Modified: lldb/trunk/include/lldb/Core/PluginManager.h lldb/trunk/include/lldb/Target/Language.h lldb/trunk/include/lldb/lldb-private-interfaces.h lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Core/PluginManager.cpp lldb/trunk/source/Target/Language.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Core/PluginManager.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/PluginManager.h?rev=250928&r1=250927&r2=250928&view=diff == --- lldb/trunk/include/lldb/Core/PluginManager.h (original) +++ lldb/trunk/include/lldb/Core/PluginManager.h Wed Oct 21 14:14:33 2015 @@ -449,7 +449,8 @@ public: static bool RegisterPlugin (const ConstString &name, const char *description, -REPLCreateInstance create_callback); +REPLCreateInstance create_callback, +REPLEnumerateSupportedLanguages enumerate_languages_callback); static bool UnregisterPlugin (REPLCreateInstance create_callback); @@ -460,6 +461,12 @@ public: static REPLCreateInstance GetREPLCreateCallbackForPluginName (const ConstString &name); +static REPLEnumerateSupportedLanguages +GetREPLEnumerateSupportedLanguagesCallbackAtIndex (uint32_t idx); + +static REPLEnumerateSupportedLanguages +GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName (const ConstString &name); + //-- // Some plug-ins might register a DebuggerInitializeCallback // callback when registering the plug-in. After a new Debugger Modified: lldb/trunk/include/lldb/Target/Language.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Language.h?rev=250928&r1=250927&r2=250928&view=diff == --- lldb/trunk/include/lldb/Target/Language.h (original) +++ lldb/trunk/include/lldb/Target/Language.h Wed Oct 21 14:14:33 2015 @@ -149,6 +149,9 @@ public: static void GetLanguagesSupportingTypeSystems (std::set &languages, std::set &languages_for_expressions); + +static void +GetLanguagesSupportingREPLs (std::set &languages); protected: //-- Modified: lldb/trunk/include/lldb/lldb-private-interfaces.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-interfaces.h?rev=250928&r1=250927&r2=250928&view=diff == --- lldb/trunk/include/lldb/lldb-private-interfaces.h (original) +++ lldb/trunk/include/lldb/lldb-private-interfaces.h Wed Oct 21 14:14:33 2015 @@ -51,6 +51,7 @@ namespace lldb_private typedef lldb::TypeSystemSP (*TypeSystemCreateInstance) (lldb::LanguageType language, Module *module, Target *target); typedef lldb::REPLSP (*REPLCreateInstance) (Error &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options); typedef void (*TypeSystemEnumerateSupportedLanguages) (std::set &languages_for_types, std::set &languages_for_expressions); +typedef void (*REPLEnumerateSupportedLanguages) (std::set &languages); typedef int (*ComparisonFunction)(const void *, const void *); typedef void (*DebuggerInitializeCallback)(Debugger &debugger); Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250928&r1=250927&r2=250928&view=diff == --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Wed Oct 21 14:14:33 2015 @@ -1805,11 +1805,6 @@ Debugger::RunREPL (LanguageType language { Error err; FileSpec repl_executable; -if (language == eLanguageTypeUnknown) -{ -err.SetErrorString ("must specify a language for a REPL"); // TODO make it possible to specify a default language -return err; -} Target *const target = nullptr; // passing in an empty target means the REPL must create one Modified: lldb/trunk/source/Core/PluginManager.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=250928&r1=250927&r2=250928&view=diff == --- lldb/trunk/source/Core/PluginManager.cpp (original) +++ lldb/trunk/source/Core/PluginManager.cpp Wed O
[Lldb-commits] [lldb] r250931 - Fix error handling when there are no REPLs installed.
Author: spyffe Date: Wed Oct 21 14:31:17 2015 New Revision: 250931 URL: http://llvm.org/viewvc/llvm-project?rev=250931&view=rev Log: Fix error handling when there are no REPLs installed. Before, in the absence of any configured REPLs, LLDB would act as if there were multiple possible REPL options, whereas actually no REPL language is supported. Now we make a better error. Modified: lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=250931&r1=250930&r2=250931&view=diff == --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Wed Oct 21 14:31:17 2015 @@ -1806,6 +1806,28 @@ Debugger::RunREPL (LanguageType language Error err; FileSpec repl_executable; +if (language == eLanguageTypeUnknown) +{ +std::set repl_languages; + +Language::GetLanguagesSupportingREPLs(repl_languages); + +if (repl_languages.size() == 1) +{ +language = *repl_languages.begin(); +} +else if (repl_languages.size() == 0) +{ +err.SetErrorStringWithFormat("LLDB isn't configured with support support for any REPLs."); +return err; +} +else +{ +err.SetErrorStringWithFormat("Multiple possible REPL languages. Please specify a language."); +return err; +} +} + Target *const target = nullptr; // passing in an empty target means the REPL must create one REPLSP repl_sp(REPL::Create(err, language, this, target, repl_options)); Modified: lldb/trunk/source/Target/Target.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=250931&r1=250930&r2=250931&view=diff == --- lldb/trunk/source/Target/Target.cpp (original) +++ lldb/trunk/source/Target/Target.cpp Wed Oct 21 14:31:17 2015 @@ -226,10 +226,15 @@ Target::GetREPL (Error &err, lldb::Langu { language = *repl_languages.begin(); } +else if (repl_languages.size() == 0) +{ +err.SetErrorStringWithFormat("LLDB isn't configured with support support for any REPLs."); +return REPLSP(); +} else { err.SetErrorStringWithFormat("Multiple possible REPL languages. Please specify a language."); -return REPLSP(); // must provide a language +return REPLSP(); } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251083 - Fixed a typo in r251080.
Author: spyffe Date: Thu Oct 22 19:37:54 2015 New Revision: 251083 URL: http://llvm.org/viewvc/llvm-project?rev=251083&view=rev Log: Fixed a typo in r251080. Modified: lldb/trunk/source/API/SBTypeSummary.cpp Modified: lldb/trunk/source/API/SBTypeSummary.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeSummary.cpp?rev=251083&r1=251082&r2=251083&view=diff == --- lldb/trunk/source/API/SBTypeSummary.cpp (original) +++ lldb/trunk/source/API/SBTypeSummary.cpp Thu Oct 22 19:37:54 2015 @@ -153,7 +153,7 @@ SBTypeSummary::CreateWithCallback (Forma TypeSummaryImplSP( cb ? new CXXFunctionSummaryFormat(options, [cb] (ValueObject& valobj, Stream& stm, const TypeSummaryOptions& opt) -> bool { -BStream stream; +SBStream stream; if (!cb(SBValue(valobj.GetSP()), SBTypeSummaryOptions(&opt), stream)) return false; stm.Write(stream.GetData(), stream.GetSize()); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider
This patch failed to compile. I fixed it with r251083. Sean > On Oct 22, 2015, at 5:05 PM, Phabricator via lldb-commits > wrote: > > +BStream stream; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13657: [lldb] char summary provider
spyffe added a subscriber: spyffe. spyffe added a comment. This patch failed to compile. I fixed it with r251083. Sean Repository: rL LLVM http://reviews.llvm.org/D13657 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251084 - Log information about sections that didn't make it into the target's memory.
Author: spyffe Date: Thu Oct 22 19:39:09 2015 New Revision: 251084 URL: http://llvm.org/viewvc/llvm-project?rev=251084&view=rev Log: Log information about sections that didn't make it into the target's memory. Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRExecutionUnit.cpp?rev=251084&r1=251083&r2=251084&view=diff == --- lldb/trunk/source/Expression/IRExecutionUnit.cpp (original) +++ lldb/trunk/source/Expression/IRExecutionUnit.cpp Thu Oct 22 19:39:09 2015 @@ -432,6 +432,13 @@ IRExecutionUnit::GetRunnableInfo(Error & my_extractor.PutToLog(log, 0, my_buffer.GetByteSize(), record.m_process_address, 16, DataExtractor::TypeUInt8); } } +else +{ +record.dump(log); + +DataExtractor my_extractor ((const void*)record.m_host_address, record.m_size, lldb::eByteOrderBig, 8); +my_extractor.PutToLog(log, 0, record.m_size, record.m_host_address, 16, DataExtractor::TypeUInt8); +} } } @@ -883,12 +890,13 @@ IRExecutionUnit::AllocationRecord::dump if (!log) return; -log->Printf("[0x%llx+0x%llx]->0x%llx (alignment %d, section ID %d)", +log->Printf("[0x%llx+0x%llx]->0x%llx (alignment %d, section ID %d, name %s)", (unsigned long long)m_host_address, (unsigned long long)m_size, (unsigned long long)m_process_address, (unsigned)m_alignment, -(unsigned)m_section_id); +(unsigned)m_section_id, +m_name.c_str()); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251151 - Fixed some issues with reporting "this" when the current function is not listed
Author: spyffe Date: Fri Oct 23 16:45:02 2015 New Revision: 251151 URL: http://llvm.org/viewvc/llvm-project?rev=251151&view=rev Log: Fixed some issues with reporting "this" when the current function is not listed in DWARF as a member of a class, but it has a "this" parameter. Specifically, *this needs to have the LLDB expression added as a method. This fixes TestWithLimitDebugInfo. Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp?rev=251151&r1=251150&r2=251151&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp Fri Oct 23 16:45:02 2015 @@ -1086,28 +1086,7 @@ ClangExpressionDeclMap::FindExternalVisi log->Printf(" CEDM::FEVD[%u] Adding type for $__lldb_class: %s", current_id, ast_dumper.GetCString()); } -TypeFromParser class_type = CopyClassType(class_user_type, current_id); - -if (!class_type.IsValid()) -return; - -TypeSourceInfo *type_source_info = m_ast_context->getTrivialTypeSourceInfo(QualType::getFromOpaquePtr(class_type.GetOpaqueQualType())); - -if (!type_source_info) -return; - -TypedefDecl *typedef_decl = TypedefDecl::Create(*m_ast_context, - m_ast_context->getTranslationUnitDecl(), - SourceLocation(), - SourceLocation(), - context.m_decl_name.getAsIdentifierInfo(), - type_source_info); - - -if (!typedef_decl) -return; - -context.AddNamedDecl(typedef_decl); +AddThisType(context, class_user_type, current_id); if (method_decl->isInstance()) { @@ -1143,20 +1122,17 @@ ClangExpressionDeclMap::FindExternalVisi if (!this_type) return; -CompilerType pointee_type = this_type->GetForwardCompilerType ().GetPointeeType(); +TypeFromUser pointee_type = this_type->GetForwardCompilerType ().GetPointeeType(); if (pointee_type.IsValid()) { if (log) { -ASTDumper ast_dumper(this_type->GetFullCompilerType ()); -log->Printf(" FEVD[%u] Adding type for $__lldb_objc_class: %s", current_id, ast_dumper.GetCString()); +ASTDumper ast_dumper(pointee_type); +log->Printf(" FEVD[%u] Adding type for $__lldb_class: %s", current_id, ast_dumper.GetCString()); } - -TypeFromUser class_user_type(pointee_type); -AddOneType(context, class_user_type, current_id); - - + +AddThisType(context, pointee_type, current_id); TypeFromUser this_user_type(this_type->GetFullCompilerType ()); m_struct_vars->m_object_pointer_type = this_user_type; return; @@ -2156,9 +2132,10 @@ ClangExpressionDeclMap::AddOneFunction ( } } -TypeFromParser -ClangExpressionDeclMap::CopyClassType(TypeFromUser &ut, - unsigned int current_id) +void +ClangExpressionDeclMap::AddThisType(NameSearchContext &context, +TypeFromUser &ut, +unsigned int current_id) { CompilerType copied_clang_type = GuardedCopyType(ut); @@ -2167,9 +2144,9 @@ ClangExpressionDeclMap::CopyClassType(Ty Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); if (log) -log->Printf("ClangExpressionDeclMap::CopyClassType - Couldn't import the type"); +log->Printf("ClangExpressionDeclMap::AddThisType - Couldn't import the type"); -return TypeFromParser(); +return; } if (copied_clang_type.IsAggregateType() && copied_clang_type.GetCompleteType ()) @@ -2204,7 +2181,31 @@ ClangExpressionDeclMap::CopyClassType(Ty is_artificial); } -return TypeFromParser(co
[Lldb-commits] [lldb] r251340 - Clang module compilation options need to be per-platform.
Author: spyffe Date: Mon Oct 26 15:33:24 2015 New Revision: 251340 URL: http://llvm.org/viewvc/llvm-project?rev=251340&view=rev Log: Clang module compilation options need to be per-platform. On UNIX (but not Darwin) the username needs to be respected when creating a temporary module directory, so that different users don't pollute each others' module caches. Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h lldb/trunk/source/Target/Platform.cpp Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp?rev=251340&r1=251339&r2=251340&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp Mon Oct 26 15:33:24 2015 @@ -641,18 +641,7 @@ ClangModulesDeclVendor::Create(Target &t compiler_invocation_arguments.push_back(ModuleImportBufferName); // Add additional search paths with { "-I", path } or { "-F", path } here. - -{ -llvm::SmallString<128> DefaultModuleCache; -const bool erased_on_reboot = false; -llvm::sys::path::system_temp_directory(erased_on_reboot, DefaultModuleCache); -llvm::sys::path::append(DefaultModuleCache, "org.llvm.clang"); -llvm::sys::path::append(DefaultModuleCache, "ModuleCache"); -std::string module_cache_argument("-fmodules-cache-path="); -module_cache_argument.append(DefaultModuleCache.str().str()); -compiler_invocation_arguments.push_back(module_cache_argument); -} - + FileSpecList &module_search_paths = target.GetClangModuleSearchPaths(); for (size_t spi = 0, spe = module_search_paths.GetSize(); spi < spe; ++spi) Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=251340&r1=251339&r2=251340&view=diff == --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original) +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Mon Oct 26 15:33:24 2015 @@ -35,6 +35,10 @@ #include "lldb/Target/Target.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/ADT/SmallString.h" +#include "llvm/Support/Path.h" + using namespace lldb; using namespace lldb_private; @@ -1476,6 +1480,17 @@ PlatformDarwin::AddClangModuleCompilatio apple_arguments.begin(), apple_arguments.end()); +{ +llvm::SmallString<128> DefaultModuleCache; +const bool erased_on_reboot = false; +llvm::sys::path::system_temp_directory(erased_on_reboot, DefaultModuleCache); +llvm::sys::path::append(DefaultModuleCache, "org.llvm.clang"); +llvm::sys::path::append(DefaultModuleCache, "ModuleCache"); +std::string module_cache_argument("-fmodules-cache-path="); +module_cache_argument.append(DefaultModuleCache.str().str()); +options.push_back(module_cache_argument); +} + StreamString minimum_version_option; uint32_t versions[3] = { 0, 0, 0 }; bool use_current_os_version = false; Modified: lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp?rev=251340&r1=251339&r2=251340&view=diff == --- lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp (original) +++ lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp Mon Oct 26 15:33:24 2015 @@ -27,6 +27,10 @@ #include "lldb/Target/Process.h" #include "lldb/Target/ProcessLaunchInfo.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/ADT/SmallString.h" +#include "llvm/Support/Path.h" + using namespace lldb; using namespace lldb_private; @@ -848,4 +852,64 @@ void PlatformPOSIX::CalculateTrapHandlerSymbolNames () { m_trap_handlers.push_back (ConstString ("_sigtramp")); -} +} + +static bool isAlphanumeric(const char c) +{ +return ((c >= '0' && c <= '9') || +(c >= 'a' && c <= 'z') || +(c >= 'A' && c <= 'Z')); +} + +static void appendUserToPath(llvm::SmallVectorImpl &Result) +{ +const char *username = getenv("LOGNAME"); + +if (username) +{ +// Validate that LoginName can be used in a path, and get its length. +size_t Len = 0; +for (const char
[Lldb-commits] [lldb] r251527 - Don't codesign lldbserver if debugserver codesigning is disabled, because it
Author: spyffe Date: Wed Oct 28 12:14:27 2015 New Revision: 251527 URL: http://llvm.org/viewvc/llvm-project?rev=251527&view=rev Log: Don't codesign lldbserver if debugserver codesigning is disabled, because it probably won't work. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=251527&r1=251526&r2=251527&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Oct 28 12:14:27 2015 @@ -6145,7 +6145,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if [ \"${CONFIGURATION}\" != BuildAndIntegration ]\nthen\ncodesign -f -s lldb_codesign \"${TARGET_BUILD_DIR}/${TARGET_NAME}\"\nfi\n"; + shellScript = "if [ \"${CONFIGURATION}\" != BuildAndIntegration ]\nthen\nif [ \"${DEBUGSERVER_USE_FROM_SYSTEM}\" == \"\" ]\nthen\nif [ \"${DEBUGSERVER_DISABLE_CODESIGN}\" == \"\" ]\n then\ncodesign -f -s lldb_codesign \"${TARGET_BUILD_DIR}/${TARGET_NAME}\"\nfi\nfi\nfi\n"; }; 940B04E21A89871F0045D5F7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r251550 - Removed an unecessary code-signing phase on lldb-tool.
Author: spyffe Date: Wed Oct 28 15:07:46 2015 New Revision: 251550 URL: http://llvm.org/viewvc/llvm-project?rev=251550&view=rev Log: Removed an unecessary code-signing phase on lldb-tool. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=251550&r1=251549&r2=251550&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Oct 28 15:07:46 2015 @@ -5944,7 +5944,6 @@ buildPhases = ( 26F5C26710F3D9A4009D5894 /* Sources */, 26F5C26810F3D9A4009D5894 /* Frameworks */, - 25ED0ED41A70979C00E3DA2E /* ShellScript */, ); buildRules = ( ); @@ -6061,19 +6060,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 25ED0ED41A70979C00E3DA2E /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if [ \"${CONFIGURATION}\" != BuildAndIntegration ]\nthen\ncodesign -f -s lldb_codesign \"${TARGET_BUILD_DIR}/${PRODUCT_NAME}\"\nfi"; - }; 261B5A7511C3FA6F00AABD0A /* Fixup Framework Headers */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r251732 - Harden this test case to do the right thing in the face of compiler changes
Enrico, > +@expectedFailureDarwin isn’t this commit supposed to fix the test? Why are you making it xfail? Sean ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252198 - Better validation when we think a directory might be Xcode.app.
Author: spyffe Date: Thu Nov 5 13:46:12 2015 New Revision: 252198 URL: http://llvm.org/viewvc/llvm-project?rev=252198&view=rev Log: Better validation when we think a directory might be Xcode.app. LLDB could otherwise get confused if it is (for example) in a root that is meant to install into an Xcode.app but hasn't been installed yet. That way Xcode can fall back to the real Xcode.app rather than trying to look for resources inside the root. Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=252198&r1=252197&r2=252198&view=diff == --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original) +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Thu Nov 5 13:46:12 2015 @@ -1225,7 +1225,16 @@ CheckPathForXcode(const FileSpec &fspec) if (pos != std::string::npos) { path_to_shlib.erase(pos + strlen(substr)); -return FileSpec(path_to_shlib.c_str(), false); +FileSpec ret (path_to_shlib.c_str(), false); + +FileSpec xcode_binary_path = ret; +xcode_binary_path.AppendPathComponent("MacOS"); +xcode_binary_path.AppendPathComponent("Xcode"); + +if (xcode_binary_path.Exists()) +{ +return ret; +} } } return FileSpec(); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252351 - Fixed a problem where a test case referred to a
Author: spyffe Date: Fri Nov 6 16:05:47 2015 New Revision: 252351 URL: http://llvm.org/viewvc/llvm-project?rev=252351&view=rev Log: Fixed a problem where a test case referred to a wrongly-capitalized header. Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/myclass.m Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/myclass.m URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/myclass.m?rev=252351&r1=252350&r2=252351&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/myclass.m (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/myclass.m Fri Nov 6 16:05:47 2015 @@ -1,5 +1,5 @@ #import -#import "MyClass.h" +#import "myclass.h" @implementation MyClass { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252354 - Fixed another issue with wrong case in #import.
Author: spyffe Date: Fri Nov 6 16:43:55 2015 New Revision: 252354 URL: http://llvm.org/viewvc/llvm-project?rev=252354&view=rev Log: Fixed another issue with wrong case in #import. Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/repro.m Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/repro.m URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/repro.m?rev=252354&r1=252353&r2=252354&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/repro.m (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/repro.m Fri Nov 6 16:43:55 2015 @@ -1,5 +1,5 @@ #import -#import "MyClass.h" +#import "myclass.h" int main() { id object = [MyClass new]; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252655 - Fixed a bug where the size of a type was used instead of the size of a pointer.
Author: spyffe Date: Tue Nov 10 15:48:05 2015 New Revision: 252655 URL: http://llvm.org/viewvc/llvm-project?rev=252655&view=rev Log: Fixed a bug where the size of a type was used instead of the size of a pointer. Modified: lldb/trunk/source/Expression/Materializer.cpp Modified: lldb/trunk/source/Expression/Materializer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/Materializer.cpp?rev=252655&r1=252654&r2=252655&view=diff == --- lldb/trunk/source/Expression/Materializer.cpp (original) +++ lldb/trunk/source/Expression/Materializer.cpp Tue Nov 10 15:48:05 2015 @@ -112,7 +112,7 @@ public: m_persistent_variable_sp->GetName(), mem, eAddressTypeLoad, - m_persistent_variable_sp->GetByteSize()); + map.GetAddressByteSize()); // Clear the flag if the variable will never be deallocated. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252657 - Updated a relative path in Makefile.rules to reflect the new testsuite location.
Author: spyffe Date: Tue Nov 10 15:56:04 2015 New Revision: 252657 URL: http://llvm.org/viewvc/llvm-project?rev=252657&view=rev Log: Updated a relative path in Makefile.rules to reflect the new testsuite location. Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=252657&r1=252656&r2=252657&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original) +++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Nov 10 15:56:04 2015 @@ -28,7 +28,7 @@ # SHELL = /bin/sh -x THIS_FILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST/ -LLDB_BASE_DIR := $(THIS_FILE_DIR)../../ +LLDB_BASE_DIR := $(THIS_FILE_DIR)../../../../../ #-- ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r252665 - Made the ClangASTImporter into a shared pointer, eliminating a race condition.
Author: spyffe Date: Tue Nov 10 16:54:42 2015 New Revision: 252665 URL: http://llvm.org/viewvc/llvm-project?rev=252665&view=rev Log: Made the ClangASTImporter into a shared pointer, eliminating a race condition. It used to be a unique pointer, and there could be a case where ClangASTSource held onto a copy of the pointer but Target::Destroy destroyed the unique pointer in the mean time. I also ensured that there is a validity check on the target (which confirms that a ClangASTImporter can be generated) before the target's shared pointer is copied into ClangASTSource. This race condition caused a crash if Target::Destroy was called and then later the target objecct was deleted. Modified: lldb/trunk/include/lldb/Target/Target.h lldb/trunk/include/lldb/lldb-forward.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp lldb/trunk/source/Symbol/ClangASTContext.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=252665&r1=252664&r2=252665&view=diff == --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Tue Nov 10 16:54:42 2015 @@ -1287,7 +1287,7 @@ public: ClangASTContext * GetScratchClangASTContext(bool create_on_demand=true); -ClangASTImporter * +lldb::ClangASTImporterSP GetClangASTImporter(); //-- @@ -1568,7 +1568,7 @@ protected: typedef std::map REPLMap; REPLMap m_repl_map; -lldb::ClangASTImporterUP m_ast_importer_ap; +lldb::ClangASTImporterSP m_ast_importer_sp; lldb::ClangModulesDeclVendorUP m_clang_modules_decl_vendor_ap; lldb::SourceManagerUP m_source_manager_ap; Modified: lldb/trunk/include/lldb/lldb-forward.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=252665&r1=252664&r2=252665&view=diff == --- lldb/trunk/include/lldb/lldb-forward.h (original) +++ lldb/trunk/include/lldb/lldb-forward.h Tue Nov 10 16:54:42 2015 @@ -310,7 +310,7 @@ namespace lldb { typedef std::shared_ptr BreakpointResolverSP; typedef std::shared_ptr BroadcasterSP; typedef std::unique_ptr ClangASTContextUP; -typedef std::unique_ptr ClangASTImporterUP; +typedef std::shared_ptr ClangASTImporterSP; typedef std::unique_ptr ClangModulesDeclVendorUP; typedef std::unique_ptr ClangPersistentVariablesUP; typedef std::shared_ptr UserExpressionSP; Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp?rev=252665&r1=252664&r2=252665&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp Tue Nov 10 16:54:42 2015 @@ -57,7 +57,7 @@ namespace { ClangASTSource::~ClangASTSource() { -m_ast_importer->ForgetDestination(m_ast_context); +m_ast_importer_sp->ForgetDestination(m_ast_context); // We are in the process of destruction, don't create clang ast context on demand // by passing false to Target::GetScratchClangASTContext(create_on_demand). @@ -72,7 +72,7 @@ ClangASTSource::~ClangASTSource() return; if (m_ast_context != scratch_ast_context) -m_ast_importer->ForgetSource(scratch_ast_context, m_ast_context); +m_ast_importer_sp->ForgetSource(scratch_ast_context, m_ast_context); } void @@ -221,7 +221,7 @@ ClangASTSource::CompleteType (TagDecl *t m_active_lexical_decls.insert(tag_decl); ScopedLexicalDeclEraser eraser(m_active_lexical_decls, tag_decl); -if (!m_ast_importer->CompleteTagDecl (tag_decl)) +if (!m_ast_importer_sp->CompleteTagDecl (tag_decl)) { // We couldn't complete the type. Maybe there's a definition // somewhere else that can be completed. @@ -235,7 +235,7 @@ ClangASTSource::CompleteType (TagDecl *t if (const NamespaceDecl *namespace_context = dyn_cast(decl_ctx)) { -ClangASTImporter::NamespaceMapSP namespace_map = m_ast_importer->GetNamespaceMap(namespace_context); +ClangASTImporter::NamespaceMapSP namespace_map = m_ast_importer_sp->GetNamespaceMap(namespace_context); if (log && log->GetVerbose()) log->Printf(" CTD[%u] Inspecting namespace map %p (%d entries)", @@ -283,7 +283,7 @@ ClangASTSource::CompleteType (Tag
[Lldb-commits] [lldb] r253101 - Fixed a testcase problem where disassembly would fail for nameless functions.
Author: spyffe Date: Fri Nov 13 17:00:33 2015 New Revision: 253101 URL: http://llvm.org/viewvc/llvm-project?rev=253101&view=rev Log: Fixed a testcase problem where disassembly would fail for nameless functions. Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py?rev=253101&r1=253100&r2=253101&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py Fri Nov 13 17:00:33 2015 @@ -56,7 +56,8 @@ class StdCXXDisassembleTestCase(TestBase for i in range(depth - 1): frame = thread.GetFrameAtIndex(i) function = frame.GetFunction() -self.runCmd("disassemble -n '%s'" % function.GetName()) +if function.GetName(): +self.runCmd("disassemble -n '%s'" % function.GetName()) lib_stdcxx = "FAILHORRIBLYHERE" # Iterate through the available modules, looking for stdc++ library... ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r253112 - Always initialize expression variables' flags field.
Author: spyffe Date: Fri Nov 13 19:05:33 2015 New Revision: 253112 URL: http://llvm.org/viewvc/llvm-project?rev=253112&view=rev Log: Always initialize expression variables' flags field. Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h Modified: lldb/trunk/include/lldb/Expression/ExpressionVariable.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ExpressionVariable.h?rev=253112&r1=253111&r2=253112&view=diff == --- lldb/trunk/include/lldb/Expression/ExpressionVariable.h (original) +++ lldb/trunk/include/lldb/Expression/ExpressionVariable.h Fri Nov 13 19:05:33 2015 @@ -43,6 +43,7 @@ public: LLVMCastKind getKind() const { return m_kind; } ExpressionVariable(LLVMCastKind kind) : +m_flags(0), m_kind(kind) { } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r253732 - Newer versions of the ObjC runtime have an extra field in objc_opt_t.
Author: spyffe Date: Fri Nov 20 16:59:57 2015 New Revision: 253732 URL: http://llvm.org/viewvc/llvm-project?rev=253732&view=rev Log: Newer versions of the ObjC runtime have an extra field in objc_opt_t. Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=253732&r1=253731&r2=253732&view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Fri Nov 20 16:59:57 2015 @@ -207,6 +207,14 @@ struct objc_opt_t { int32_t clsopt_offset; }; +struct objc_opt_v14_t { +uint32_t version; +uint32_t flags; +int32_t selopt_offset; +int32_t headeropt_offset; +int32_t clsopt_offset; +}; + struct ClassInfo { Class isa; @@ -225,16 +233,34 @@ __lldb_apple_objc_v2_get_shared_cache_cl if (objc_opt_ro_ptr) { const objc_opt_t *objc_opt = (objc_opt_t *)objc_opt_ro_ptr; -DEBUG_PRINTF ("objc_opt->version = %u\n", objc_opt->version); -DEBUG_PRINTF ("objc_opt->selopt_offset = %d\n", objc_opt->selopt_offset); -DEBUG_PRINTF ("objc_opt->headeropt_offset = %d\n", objc_opt->headeropt_offset); -DEBUG_PRINTF ("objc_opt->clsopt_offset = %d\n", objc_opt->clsopt_offset); -if (objc_opt->version == 12 || objc_opt->version == 13) +const objc_opt_v14_t* objc_opt_v14 = (objc_opt_v14_t*)objc_opt_ro_ptr; +const bool is_v14_format = objc_opt->version >= 14; +if (is_v14_format) +{ +DEBUG_PRINTF ("objc_opt->version = %u\n", objc_opt_v14->version); +DEBUG_PRINTF ("objc_opt->flags = %u\n", objc_opt_v14->flags); +DEBUG_PRINTF ("objc_opt->selopt_offset = %d\n", objc_opt_v14->selopt_offset); +DEBUG_PRINTF ("objc_opt->headeropt_offset = %d\n", objc_opt_v14->headeropt_offset); +DEBUG_PRINTF ("objc_opt->clsopt_offset = %d\n", objc_opt_v14->clsopt_offset); +} +else +{ +DEBUG_PRINTF ("objc_opt->version = %u\n", objc_opt->version); +DEBUG_PRINTF ("objc_opt->selopt_offset = %d\n", objc_opt->selopt_offset); +DEBUG_PRINTF ("objc_opt->headeropt_offset = %d\n", objc_opt->headeropt_offset); +DEBUG_PRINTF ("objc_opt->clsopt_offset = %d\n", objc_opt->clsopt_offset); +} +if (objc_opt->version == 12 || objc_opt->version == 13 || objc_opt->version == 14) { -const objc_clsopt_t* clsopt = (const objc_clsopt_t*)((uint8_t *)objc_opt + objc_opt->clsopt_offset); +const objc_clsopt_t* clsopt = NULL; +if (is_v14_format) +clsopt = (const objc_clsopt_t*)((uint8_t *)objc_opt_v14 + objc_opt_v14->clsopt_offset); +else +clsopt = (const objc_clsopt_t*)((uint8_t *)objc_opt + objc_opt->clsopt_offset); const size_t max_class_infos = class_infos_byte_size/sizeof(ClassInfo); ClassInfo *class_infos = (ClassInfo *)class_infos_ptr; int32_t invalidEntryOffset = 0; +// this is safe to do because the version field order is invariant if (objc_opt->version == 12) invalidEntryOffset = 16; const uint8_t *checkbytes = &clsopt->tab[clsopt->mask+1]; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r255090 - When printing warnings, the repeat_key should be
Author: spyffe Date: Tue Dec 8 19:25:01 2015 New Revision: 255090 URL: http://llvm.org/viewvc/llvm-project?rev=255090&view=rev Log: When printing warnings, the repeat_key should be const void * because the data is never accessed, the pointer is the only useful piece of data. Modified: lldb/trunk/include/lldb/Target/Process.h lldb/trunk/source/Target/Process.cpp Modified: lldb/trunk/include/lldb/Target/Process.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=255090&r1=255089&r2=255090&view=diff == --- lldb/trunk/include/lldb/Target/Process.h (original) +++ lldb/trunk/include/lldb/Target/Process.h Tue Dec 8 19:25:01 2015 @@ -3201,7 +3201,7 @@ protected: /// printf style format string //-- void -PrintWarning (uint64_t warning_type, void *repeat_key, const char *fmt, ...) __attribute__((format(printf, 4, 5))); +PrintWarning (uint64_t warning_type, const void *repeat_key, const char *fmt, ...) __attribute__((format(printf, 4, 5))); //-- // NextEventAction provides a way to register an action on the next @@ -3286,7 +3286,7 @@ protected: // Type definitions //-- typedef std::map LanguageRuntimeCollection; -typedef std::unordered_set WarningsPointerSet; +typedef std::unordered_set WarningsPointerSet; typedef std::map WarningsCollection; struct PreResumeCallbackAndBaton Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=255090&r1=255089&r2=255090&view=diff == --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Tue Dec 8 19:25:01 2015 @@ -6400,7 +6400,7 @@ Process::ModulesDidLoad (ModuleList &mod } void -Process::PrintWarning (uint64_t warning_type, void *repeat_key, const char *fmt, ...) +Process::PrintWarning (uint64_t warning_type, const void *repeat_key, const char *fmt, ...) { bool print_warning = true; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r255358 - DisassemblerLLVMC now gets the disassembler comments for an instruction
Author: spyffe Date: Fri Dec 11 13:10:04 2015 New Revision: 255358 URL: http://llvm.org/viewvc/llvm-project?rev=255358&view=rev Log: DisassemblerLLVMC now gets the disassembler comments for an instruction and appends them to our list of comments (which can additionally include things like decoded addresses). Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=255358&r1=255357&r2=255358&view=diff == --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original) +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Fri Dec 11 13:10:04 2015 @@ -280,7 +280,8 @@ public: if (m_opcode.GetData(data)) { -char out_string[512]; +std::string out_string; +std::string comment_string; DisassemblerLLVMC &llvm_disasm = GetDisassemblerLLVMC(); @@ -331,7 +332,12 @@ public: if (inst_size > 0) { mc_disasm_ptr->SetStyle(use_hex_immediates, hex_style); -mc_disasm_ptr->PrintMCInst(inst, out_string, sizeof(out_string)); +mc_disasm_ptr->PrintMCInst(inst, out_string, comment_string); + +if (!comment_string.empty()) +{ +AppendComment(comment_string); +} } llvm_disasm.Unlock(); @@ -413,10 +419,10 @@ public: RegularExpression::Match matches(3); -if (s_regex.Execute(out_string, &matches)) +if (s_regex.Execute(out_string.c_str(), &matches)) { -matches.GetMatchAtIndex(out_string, 1, m_opcode_name); -matches.GetMatchAtIndex(out_string, 2, m_mnemonics); +matches.GetMatchAtIndex(out_string.c_str(), 1, m_opcode_name); +matches.GetMatchAtIndex(out_string.c_str(), 2, m_mnemonics); } } } @@ -543,21 +549,25 @@ DisassemblerLLVMC::LLVMCDisassembler::Ge return 0; } -uint64_t +void DisassemblerLLVMC::LLVMCDisassembler::PrintMCInst (llvm::MCInst &mc_inst, - char *dst, - size_t dst_len) + std::string &inst_string, + std::string &comments_string) { -llvm::StringRef unused_annotations; -llvm::SmallString<64> inst_string; -llvm::raw_svector_ostream inst_stream(inst_string); -m_instr_printer_ap->printInst (&mc_inst, inst_stream, unused_annotations, - *m_subtarget_info_ap); -const size_t output_size = std::min(dst_len - 1, inst_string.size()); -std::memcpy(dst, inst_string.data(), output_size); -dst[output_size] = '\0'; +llvm::raw_string_ostream inst_stream(inst_string); +llvm::raw_string_ostream comments_stream(comments_string); -return output_size; +m_instr_printer_ap->setCommentStream(comments_stream); +m_instr_printer_ap->printInst (&mc_inst, inst_stream, llvm::StringRef(), *m_subtarget_info_ap); +m_instr_printer_ap->setCommentStream(llvm::nulls()); +comments_stream.flush(); + +static std::string g_newlines("\r\n"); + +for (size_t newline_pos = 0; (newline_pos = comments_string.find_first_of(g_newlines, newline_pos)) != comments_string.npos; /**/) +{ +comments_string.replace(comments_string.begin() + newline_pos, comments_string.begin() + newline_pos + 1, 1, ' '); +} } void Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h?rev=255358&r1=255357&r2=255358&view=diff == --- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h (original) +++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h Fri Dec 11 13:10:04 2015 @@ -51,7 +51,7 @@ class DisassemblerLLVMC : public lldb_pr ~LLVMCDisassembler(); uint64_t GetMCInst (const uint8_t *opcode_data, size_t opcode_data_len, lldb::addr_t pc, llvm::MCInst &mc_inst); -uint64_t PrintMCInst (llvm::MCInst &mc_inst, char *output_buffer, size_t out_buffer_len); +void PrintMCInst (llvm::MCInst &mc_inst, std::string &inst_string, std::string &comments_string); void SetStyle (bool use_hex_immed, HexImmediateStyle hex_style); bool CanBranch (llvm::MCInst &mc_inst); bool HasDelaySlot (llvm::MCIns
[Lldb-commits] [lldb] r267768 - Added a testcase for the IR interpreter, ensuring that it behaves like the JIT.
Author: spyffe Date: Wed Apr 27 14:37:42 2016 New Revision: 267768 URL: http://llvm.org/viewvc/llvm-project?rev=267768&view=rev Log: Added a testcase for the IR interpreter, ensuring that it behaves like the JIT. Added: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/ lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c Added: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile?rev=267768&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile (added) +++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/Makefile Wed Apr 27 14:37:42 2016 @@ -0,0 +1,7 @@ +LEVEL = ../../make + +default: a.out + +C_SOURCES := main.c + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py?rev=267768&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py (added) +++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py Wed Apr 27 14:37:42 2016 @@ -0,0 +1,70 @@ +""" +Test the IR interpreter +""" + +from __future__ import print_function + +import unittest2 + +import os, time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class IRInterpreterTestCase(TestBase): + +mydir = TestBase.compute_mydir(__file__) + +def setUp(self): +# Call super's setUp(). +TestBase.setUp(self) +# Find the line number to break for main.c. +self.line = line_number('main.c', +'// Set breakpoint here') + +# Disable confirmation prompt to avoid infinite wait +self.runCmd("settings set auto-confirm true") +self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm")) + +def build_and_run(self): +"""Test the IR interpreter""" +self.build() + +self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) + +lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=False) + +self.runCmd("run", RUN_SUCCEEDED) + +@add_test_categories(['pyapi']) +def test_ir_interpreter(self): +self.build_and_run() + +options = lldb.SBExpressionOptions() +options.SetLanguage(lldb.eLanguageTypeC_plus_plus) + +set_up_expressions = ["int $i = 9", "int $j = 3", "int $k = 5"] + +expressions = ["$i + $j", + "$i - $j", + "$i * $j", + "$i / $j", + "$i % $k", + "$i << $j", + "$i & $j", + "$i | $j", + "$i ^ $j"] + +for expression in set_up_expressions: +self.frame().EvaluateExpression(expression, options) + +for expression in expressions: +interp_expression = expression +jit_expression = "(int)getpid(); " + expression + +interp_result = self.frame().EvaluateExpression(interp_expression, options).GetValueAsSigned() +jit_result = self.frame().EvaluateExpression(jit_expression, options).GetValueAsSigned() + +self.assertEqual(interp_result, jit_result, "While evaluating " + expression) + Added: lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c?rev=267768&view=auto == --- lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c (added) +++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/main.c Wed Apr 27 14:37:42 2016 @@ -0,0 +1,7 @@ +#include + +int main() +{ +printf("This is a dummy\n"); // Set breakpoint here +return 0; +} ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits