[Lldb-commits] [PATCH] D42990: Add CMAKE_CFG_INTDIR as part of the include path for the default test compiler.
labath accepted this revision. labath added a comment. This revision is now accepted and ready to land. looks good. Technically, this is a property of the cmake generator (VS projects), and not the host system (windows), but I get what you mean.. Repository: rL LLVM https://reviews.llvm.org/D42990 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D42994: Stop passing -fPIC to lldb tests on Windows
labath added a comment. In https://reviews.llvm.org/D42994#999891, @zturner wrote: > In the future when you upload diffs can you include context? (i.e. `git diff > -U99`). It's nice to be able to see the surrounding code when I'm > looking at a diff. > > Is there ever a case where you would want to build a shared library without > `-fPIC`? I'm wondering if we should just update the common `Makefile.rules` > and if `DYLIB_NAME` is set (or something else indicating that this is a > shared library), then we put the logic about `-fPIC` in that common file. > Then people wouldn't have to remember to get this right in the future. Adding -fPIC by default sounds like a great idea. Building a shared library without it will probably break compilation, but if some test still wants to try it, it can be turned off with `-fno-PIC`. Repository: rL LLVM https://reviews.llvm.org/D42994 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r324472 - Remove function DW_DSC_value_to_name
Author: labath Date: Wed Feb 7 03:13:21 2018 New Revision: 324472 URL: http://llvm.org/viewvc/llvm-project?rev=324472&view=rev Log: Remove function DW_DSC_value_to_name It is unused, and the underlying llvm function has been removed as well. Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.h Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp?rev=324472&r1=324471&r2=324472&view=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp Wed Feb 7 03:13:21 2018 @@ -473,16 +473,6 @@ const char *DW_ORD_value_to_name(uint32_ return llvmstr.data(); } -const char *DW_DSC_value_to_name(uint32_t val) { - static char invalid[100]; - llvm::StringRef llvmstr = llvm::dwarf::DiscriminantString(val); - if (llvmstr.empty()) { -snprintf(invalid, sizeof(invalid), "Unknown DW_DSC constant: 0x%x", val); -return invalid; - } - return llvmstr.data(); -} - const char *DW_LNS_value_to_name(uint32_t val) { static char invalid[100]; llvm::StringRef llvmstr = llvm::dwarf::LNStandardString(val); Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.h?rev=324472&r1=324471&r2=324472&view=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.h (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.h Wed Feb 7 03:13:21 2018 @@ -58,8 +58,6 @@ const char *DW_INL_value_to_name(uint32_ const char *DW_ORD_value_to_name(uint32_t val); -const char *DW_DSC_value_to_name(uint32_t val); - const char *DW_LNS_value_to_name(uint32_t val); const char *DW_LNE_value_to_name(uint32_t val); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43024: [test] Enable test category for inline tests.
JDevlieghere created this revision. JDevlieghere added reviewers: vsk, davide, labath. Herald added a subscriber: llvm-commits. Inlined tests have a test function that is actually an instance method, which requires a slightly different approach when it comes to setting the category attribute. The attribute must be set on the actual function, rather than on a particular instance. Repository: rL LLVM https://reviews.llvm.org/D43024 Files: lldb/packages/Python/lldbsuite/test/decorators.py Index: lldb/packages/Python/lldbsuite/test/decorators.py === --- lldb/packages/Python/lldbsuite/test/decorators.py +++ lldb/packages/Python/lldbsuite/test/decorators.py @@ -4,6 +4,7 @@ # System modules from distutils.version import LooseVersion, StrictVersion from functools import wraps +import inspect import os import platform import re @@ -305,7 +306,11 @@ "@add_test_categories can only be used to decorate a test method") if hasattr(func, "categories"): cat.extend(func.categories) -func.categories = cat +# For instance methods, the attribute must be set on the actual function. +if inspect.ismethod(func): +func.__func__.categories = cat +else: +func.categories = cat return func return impl @@ -518,7 +523,7 @@ 'LLDB.h') if os.path.exists(header): return None - + header = os.path.join( os.environ["LLDB_SRC"], "include", Index: lldb/packages/Python/lldbsuite/test/decorators.py === --- lldb/packages/Python/lldbsuite/test/decorators.py +++ lldb/packages/Python/lldbsuite/test/decorators.py @@ -4,6 +4,7 @@ # System modules from distutils.version import LooseVersion, StrictVersion from functools import wraps +import inspect import os import platform import re @@ -305,7 +306,11 @@ "@add_test_categories can only be used to decorate a test method") if hasattr(func, "categories"): cat.extend(func.categories) -func.categories = cat +# For instance methods, the attribute must be set on the actual function. +if inspect.ismethod(func): +func.__func__.categories = cat +else: +func.categories = cat return func return impl @@ -518,7 +523,7 @@ 'LLDB.h') if os.path.exists(header): return None - + header = os.path.join( os.environ["LLDB_SRC"], "include", ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r324488 - [test] Enable setting category for inline tests.
Author: jdevlieghere Date: Wed Feb 7 08:10:59 2018 New Revision: 324488 URL: http://llvm.org/viewvc/llvm-project?rev=324488&view=rev Log: [test] Enable setting category for inline tests. Inlined tests have a test function that is actually an instance method, which requires a slightly different approach when it comes to setting the category attribute. The attribute must be set on the actual function, rather than on a particular instance. Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.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=324488&r1=324487&r2=324488&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Wed Feb 7 08:10:59 2018 @@ -4,6 +4,7 @@ from __future__ import print_function # System modules from distutils.version import LooseVersion, StrictVersion from functools import wraps +import inspect import os import platform import re @@ -305,7 +306,11 @@ def add_test_categories(cat): "@add_test_categories can only be used to decorate a test method") if hasattr(func, "categories"): cat.extend(func.categories) -func.categories = cat +# For instance methods, the attribute must be set on the actual function. +if inspect.ismethod(func): +func.__func__.categories = cat +else: +func.categories = cat return func return impl @@ -518,7 +523,7 @@ def skipIfNoSBHeaders(func): 'LLDB.h') if os.path.exists(header): return None - + header = os.path.join( os.environ["LLDB_SRC"], "include", ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43024: [test] Enable test category for inline tests.
davide accepted this revision. davide added a comment. This revision is now accepted and ready to land. thanks for fixing this. Comment at: lldb/packages/Python/lldbsuite/test/decorators.py:526 return None - + header = os.path.join( We should consider clang-formatting this file altogether. Repository: rL LLVM https://reviews.llvm.org/D43024 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43024: [test] Enable test category for inline tests.
JDevlieghere closed this revision. JDevlieghere added a comment. Forgot to add the differential to the commit message. Landed in https://reviews.llvm.org/rL324488 Repository: rL LLVM https://reviews.llvm.org/D43024 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43024: [test] Enable test category for inline tests.
labath added inline comments. Comment at: lldb/packages/Python/lldbsuite/test/decorators.py:307-308 "@add_test_categories can only be used to decorate a test method") if hasattr(func, "categories"): cat.extend(func.categories) +# For instance methods, the attribute must be set on the actual function. These two lines look like they need to be fixed as well. Comment at: lldb/packages/Python/lldbsuite/test/decorators.py:526 return None - + header = os.path.join( davide wrote: > We should consider clang-formatting this file altogether. The current (weird) formatting is the result of running `autopep8` as a part of the huge refactor some time ago... Repository: rL LLVM https://reviews.llvm.org/D43024 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43024: [test] Enable test category for inline tests.
JDevlieghere updated this revision to Diff 133220. JDevlieghere added a comment. The change in r324488 dropped the existing category attribute in for instance methods. This patch corrects that. https://reviews.llvm.org/D43024 Files: lldb/packages/Python/lldbsuite/test/decorators.py Index: lldb/packages/Python/lldbsuite/test/decorators.py === --- lldb/packages/Python/lldbsuite/test/decorators.py +++ lldb/packages/Python/lldbsuite/test/decorators.py @@ -304,13 +304,16 @@ if isinstance(func, type) and issubclass(func, unittest2.TestCase): raise Exception( "@add_test_categories can only be used to decorate a test method") -if hasattr(func, "categories"): -cat.extend(func.categories) -# For instance methods, the attribute must be set on the actual function. -if inspect.ismethod(func): -func.__func__.categories = cat -else: -func.categories = cat + +# Update or set the categories attribute. For instance methods, the +# attribute must be set on the actual function. +func_for_attr = func +if inspect.ismethod(func_for_attr): +func_for_attr = func.__func__ +if hasattr(func_for_attr, "categories"): +cat.extend(func_for_attr.categories) +setattr(func_for_attr, "categories", cat) + return func return impl Index: lldb/packages/Python/lldbsuite/test/decorators.py === --- lldb/packages/Python/lldbsuite/test/decorators.py +++ lldb/packages/Python/lldbsuite/test/decorators.py @@ -304,13 +304,16 @@ if isinstance(func, type) and issubclass(func, unittest2.TestCase): raise Exception( "@add_test_categories can only be used to decorate a test method") -if hasattr(func, "categories"): -cat.extend(func.categories) -# For instance methods, the attribute must be set on the actual function. -if inspect.ismethod(func): -func.__func__.categories = cat -else: -func.categories = cat + +# Update or set the categories attribute. For instance methods, the +# attribute must be set on the actual function. +func_for_attr = func +if inspect.ismethod(func_for_attr): +func_for_attr = func.__func__ +if hasattr(func_for_attr, "categories"): +cat.extend(func_for_attr.categories) +setattr(func_for_attr, "categories", cat) + return func return impl ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D42959: Rewrite the flaky test_restart_bug test in a more deterministic way
owenpshaw added a comment. Looks good to me https://reviews.llvm.org/D42959 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r324492 - [test] Don't drop existing categories for methods.
Author: jdevlieghere Date: Wed Feb 7 09:34:46 2018 New Revision: 324492 URL: http://llvm.org/viewvc/llvm-project?rev=324492&view=rev Log: [test] Don't drop existing categories for methods. The change in r324488 dropped the existing category attribute in for instance methods. This patch corrects that. Differential revision: https://reviews.llvm.org/D43024 Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.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=324492&r1=324491&r2=324492&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Wed Feb 7 09:34:46 2018 @@ -304,13 +304,16 @@ def add_test_categories(cat): if isinstance(func, type) and issubclass(func, unittest2.TestCase): raise Exception( "@add_test_categories can only be used to decorate a test method") -if hasattr(func, "categories"): -cat.extend(func.categories) -# For instance methods, the attribute must be set on the actual function. -if inspect.ismethod(func): -func.__func__.categories = cat -else: -func.categories = cat + +# Update or set the categories attribute. For instance methods, the +# attribute must be set on the actual function. +func_for_attr = func +if inspect.ismethod(func_for_attr): +func_for_attr = func.__func__ +if hasattr(func_for_attr, "categories"): +cat.extend(func_for_attr.categories) +setattr(func_for_attr, "categories", cat) + return func return impl ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43024: [test] Enable test category for inline tests.
vsk accepted this revision. vsk added a comment. This lgtm Jonas, thank you! https://reviews.llvm.org/D43024 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43024: [test] Enable test category for inline tests.
vsk reopened this revision. vsk added a comment. This revision is now accepted and ready to land. Ah, I see the first part landed in https://reviews.llvm.org/rL324488 and this is a follow-up. https://reviews.llvm.org/D43024 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r324509 - Remove an errant ^S
Author: jingham Date: Wed Feb 7 12:09:13 2018 New Revision: 324509 URL: http://llvm.org/viewvc/llvm-project?rev=324509&view=rev Log: Remove an errant ^S (still can't get over those Emacs habits...) Modified: lldb/trunk/scripts/interface/SBThread.i Modified: lldb/trunk/scripts/interface/SBThread.i URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/interface/SBThread.i?rev=324509&r1=324508&r2=324509&view=diff == --- lldb/trunk/scripts/interface/SBThread.i (original) +++ lldb/trunk/scripts/interface/SBThread.i Wed Feb 7 12:09:13 2018 @@ -329,7 +329,7 @@ public: //-- /// Get the description strings for this thread that match what the /// lldb driver will present, using the thread-format (stop_format==false) -/// or thread-stop-format (stop_format = true). +/// or thread-stop-format (stop_format = true). //-- ") GetDescription; bool GetDescription(lldb::SBStream &description, bool stop_format) const; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D42990: Add CMAKE_CFG_INTDIR as part of the include path for the default test compiler.
asmith added a comment. Thanks! Have updated the commit message to clarify. Repository: rL LLVM https://reviews.llvm.org/D42990 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43024: [test] Enable test category for inline tests.
JDevlieghere closed this revision. JDevlieghere added a comment. Jup. Sorry for making it so confusing. Because Pavel's reply was here it seemed sensible to update the diff. Landed in https://reviews.llvm.org/rL324492 https://reviews.llvm.org/D43024 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
davide created this revision. davide added reviewers: aprantl, vsk, friss, labath, zturner, jingham, jasonmolenda. This is an experiment to improve out lldb testing capabilities and making them more similar to the one used in LLVM. Example: davide@Davidinos-Mac-Pro ~/w/l/b/bin> ./lldb-test autocomplete "target cr" create davide@Davidinos-Mac-Pro ~/w/l/b/bin> ./lldb-test autocomplete "target " create delete list modules select stop-hook symbols variable This allows the output to be FileCheck'ed, and has the advantage that it doesn't depend on python to be executed. It also removes a bunch of boilerplate the current autocompletion tests have. Any feedback on this is appreciated, before I write the actual FileCheck tests. https://reviews.llvm.org/D43048 Files: lldb/tools/lldb-test/lldb-test.cpp Index: lldb/tools/lldb-test/lldb-test.cpp === --- lldb/tools/lldb-test/lldb-test.cpp +++ lldb/tools/lldb-test/lldb-test.cpp @@ -15,6 +15,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" #include "lldb/Initialization/SystemLifetimeManager.h" +#include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ClangASTImporter.h" #include "lldb/Utility/DataExtractor.h" @@ -32,10 +33,16 @@ using namespace llvm; namespace opts { +cl::SubCommand AutoCompleteSubCommand("autocomplete", "Test LLDB autocomplete"); cl::SubCommand ModuleSubcommand("module-sections", "Display LLDB Module Information"); cl::SubCommand SymbolsSubcommand("symbols", "Dump symbols for an object file"); +namespace autocomplete { +cl::list Input(cl::Positional, cl::desc("input patterns"), +cl::Required, cl::sub(AutoCompleteSubCommand)); +} + namespace module { cl::opt SectionContents("contents", cl::desc("Dump each section's contents"), @@ -52,6 +59,22 @@ static llvm::ManagedStatic DebuggerLifetime; +static void autocompleteCommand(Debugger &Dbg) { + assert(opts::autocomplete::Input.length() == 1 && "Incorret number of args"); + std::string InputStr = opts::autocomplete::Input[0]; + lldb_private::StringList Results; + CommandInterpreter &CI = Dbg.GetCommandInterpreter(); + unsigned Matches = CI.HandleCompletion( + InputStr.c_str(), InputStr.c_str() + InputStr.size(), + InputStr.c_str() + InputStr.size(), 0 /* match_start_point */, + -1 /* max_return_elements */, Results); + for (unsigned I = 1; I <= Matches; ++I) { +const char *Match = Results.GetStringAtIndex(I); +llvm::outs() << Match << "\n"; +llvm::outs().flush(); + } +} + static void dumpSymbols(Debugger &Dbg) { for (const auto &File : opts::symbols::InputFilenames) { ModuleSpec Spec{FileSpec(File, false)}; @@ -116,10 +139,13 @@ auto Dbg = lldb_private::Debugger::CreateInstance(); - if (opts::ModuleSubcommand) + if (opts::AutoCompleteSubCommand) { +autocompleteCommand(*Dbg); + } else if (opts::ModuleSubcommand) { dumpModules(*Dbg); - else if (opts::SymbolsSubcommand) + } else if (opts::SymbolsSubcommand) { dumpSymbols(*Dbg); + } DebuggerLifetime->Terminate(); return 0; Index: lldb/tools/lldb-test/lldb-test.cpp === --- lldb/tools/lldb-test/lldb-test.cpp +++ lldb/tools/lldb-test/lldb-test.cpp @@ -15,6 +15,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" #include "lldb/Initialization/SystemLifetimeManager.h" +#include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ClangASTImporter.h" #include "lldb/Utility/DataExtractor.h" @@ -32,10 +33,16 @@ using namespace llvm; namespace opts { +cl::SubCommand AutoCompleteSubCommand("autocomplete", "Test LLDB autocomplete"); cl::SubCommand ModuleSubcommand("module-sections", "Display LLDB Module Information"); cl::SubCommand SymbolsSubcommand("symbols", "Dump symbols for an object file"); +namespace autocomplete { +cl::list Input(cl::Positional, cl::desc("input patterns"), +cl::Required, cl::sub(AutoCompleteSubCommand)); +} + namespace module { cl::opt SectionContents("contents", cl::desc("Dump each section's contents"), @@ -52,6 +59,22 @@ static llvm::ManagedStatic DebuggerLifetime; +static void autocompleteCommand(Debugger &Dbg) { + assert(opts::autocomplete::Input.length() == 1 && "Incorret number of args"); + std::string InputStr = opts::autocomplete::Input[0]; + lldb_private::StringList Results; + CommandInterpreter &CI = Dbg.GetCommandInterpreter(); + unsigned Matches = CI.HandleCompletion( + InputStr.c_str(), InputStr.c_str() + InputStr.size(), + InputStr.c_str() + InputStr.size(), 0 /* match_start_point */, + -1 /* max_return_elements */, Resul
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
vsk added a comment. The general direction lgtm, I'd be happy if we could replace interactive autocomplete tests with this. https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
davide added a comment. You can take a look at the `test/testcases/functionalities/completion/TestCompletion.py` for the python equivalent. I find the potential FileCheck'ed version much easier to read/write/understand. I'm possibly biased having worked many years on LLVM, hence I'm asking for general feedback. https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
zturner added a comment. In the future, we could add options to the `autocomplete` subcommand that would allow specification of a target, and things like cursor position to maximize testability. In general though, I like the approach. It's not hard to imagine 50+ tests being written just for autocomplete this way. https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
zturner added a comment. By the way, I'd suggest printing indices in front of each match and including those in the FileCheck tests. Otherwise we could miss completions that sneak in. https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
jingham added a comment. The current auto-completer tests aren't interactive - they do exactly the same thing your command does, but from Python. It's fine if you want to add tests but please don't remove the current tests since they directly test what the SB clients use. This will only allow you to test some of the auto-completers, for instance you don't have symbols so you can't test the symbol completer. But since the symbol commands in this lldb-test have some way to feed symbols in maybe you can crib that. I think you'll also need to make a target and some other bits as well. As you start adding these you might find that this becomes onerous, but that will be an interesting experiment. You didn't get the HandleCompletion API quite right. That's my fault this isn't well documented. The way it works is that if all the potential matches share a common substring, then the 0th element of the result contains the common substring. If there is no common substring, then the possible matches will be stored from element 1 on in the Results list. If you want examples take a closer look at how the Python test does it. https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
davide added a comment. In https://reviews.llvm.org/D43048#1001287, @jingham wrote: > The current auto-completer tests aren't interactive - they do exactly the > same thing your command does, but from Python. It's fine if you want to add > tests but please don't remove the current tests since they directly test what > the SB clients use. This is a drop-in replacement for the other test. I'm not sure why we need to keep the other test, but I'll let others comment. > This will only allow you to test some of the auto-completers, for instance > you don't have symbols so you can't test the symbol completer. But since the > symbol commands in this lldb-test have some way to feed symbols in maybe you > can crib that. I think you'll also need to make a target and some other bits > as well. As you start adding these you might find that this becomes onerous, > but that will be an interesting experiment. I voluntarily left that as as follow up. > You didn't get the HandleCompletion API quite right. That's my fault this > isn't well documented. The way it works is that if all the potential matches > share a common substring, then the 0th element of the result contains the > common substring. If there is no common substring, then the possible matches > will be stored from element 1 on in the Results list. If you want examples > take a closer look at how the Python test does it. The API is a little confusing. There are multiple issues IMHO: 1. We shouldn't really discriminate based on the position of the elements of the list, as it's easy to get them wrong, as I did. Instead, the API might return a, let's say, pair, where the first element is the common substring and the second element is a list containing etc.. 2. We pass strings for the second and third argument (cursor/end), when we should just pass offsets 3. The return value is N and the list contains N +1 values. This is very error prone. So, I think this might call for a better API? Also, please note that I read the API and was aware of the oddities, just decided to defer the discussion to another day. I think my usage of the API is correct, as I don't necessarily care about the common substring, if any. https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
davide added a comment. In https://reviews.llvm.org/D43048#1001293, @davide wrote: > In https://reviews.llvm.org/D43048#1001287, @jingham wrote: > > > The current auto-completer tests aren't interactive - they do exactly the > > same thing your command does, but from Python. It's fine if you want to > > add tests but please don't remove the current tests since they directly > > test what the SB clients use. > > > This is a drop-in replacement for the other test. I'm not sure why we need to > keep the other test, but I'll let others comment. > > > This will only allow you to test some of the auto-completers, for instance > > you don't have symbols so you can't test the symbol completer. But since > > the symbol commands in this lldb-test have some way to feed symbols in > > maybe you can crib that. I think you'll also need to make a target and > > some other bits as well. As you start adding these you might find that > > this becomes onerous, but that will be an interesting experiment. > > I voluntarily left that as as follow up. > > > You didn't get the HandleCompletion API quite right. That's my fault this > > isn't well documented. The way it works is that if all the potential > > matches share a common substring, then the 0th element of the result > > contains the common substring. If there is no common substring, then the > > possible matches will be stored from element 1 on in the Results list. If > > you want examples take a closer look at how the Python test does it. > > The API is a little confusing. > There are multiple issues IMHO: > > 1. We shouldn't really discriminate based on the position of the elements of > the list, as it's easy to get them wrong, as I did. Instead, the API might > return a, let's say, pair, where the first element is the common substring > and the second element is a list containing etc.. > 2. We pass strings for the second and third argument (cursor/end), when we > should just pass offsets > 3. The return value is N and the list contains N +1 values. This is very > error prone. Also, there's a bit of overengineering in the API. As far as I can tell, max_return_elements only supports `-1`, so that argument is bogus (at least, this is what the comment says, but comment and code could go out of sync, so). https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
davide added a comment. In https://reviews.llvm.org/D43048#1001311, @davide wrote: > In https://reviews.llvm.org/D43048#1001283, @zturner wrote: > > > By the way, I'd suggest printing indices in front of each match and > > including those in the FileCheck tests. Otherwise we could miss > > completions that sneak in. > > > Instead, or in addition, we might dump the number of matches so that it if > changes we notice? (and use CHECK-NEXT). Anyway, your comment about adding indices is fine, I'll probably just add them. https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
davide added a comment. In https://reviews.llvm.org/D43048#1001283, @zturner wrote: > By the way, I'd suggest printing indices in front of each match and including > those in the FileCheck tests. Otherwise we could miss completions that sneak > in. Instead, or in addition, we might dump the number of matches so that it if changes we notice? https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
zturner added a comment. Number of matches might be sufficient, but it might be nice to know if the ordering of matches changes for some reason. Unless there's a specific reason we want to allow an unstable order, enforcing a stable order seems desirable just on principle. https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
zturner added a comment. On the issue of keeping the other test, I think when an SB API method is basically a pass-through to a private method, then having a test of the SB API method that verifies "did the correct native method get called" is useful if for no other reason than to verify the correctness of the SWIG binding generation. If you've tested that the API method invokes the correct native method, and you've tested the native method directly with a large amount of inputs, then that's sufficient overall coverage IMO https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
jingham requested changes to this revision. jingham added a comment. This revision now requires changes to proceed. You do care about the common match string. When the lldb driver handles completion, if the common match string is not null, we append that to the line at the cursor position, then present the matches if there is more than one. So the common match string also has to be tested. The ability to page the completion requests in the API would be useful for instance in symbol completion where you can get lots of matches, but if you only plan to display the first page you'd rather not pay the cost to go find them all. I put that in the SB API's because I didn't want to have to add another one when I got around to implementing this. When I get around to this I'll fix the docs... But you could remove that from the lldb private version if you're so motivated. I'll still remember I intended to extend it this way, even if nobody else will see that. We can't return a std::pair across the SB API's, but we could make the common match be another parameter. There was some reason this seemed logical to me at the time, but I must admit I can't remember why now. It is in practice easy to use, however. You append element 0 to the cursor position, then print the rest of the completions if num_matches is > 1. Again, feel free to switch the lldb_private API if it bugs you. An additional test in the Python testsuite is: def test_target_create_dash_co(self): """Test that 'target create --co' completes to 'target variable --core '.""" self.complete_from_to('target create --co', 'target create --core ') So I still don't see why the file check method is preferable. But to each his own, I guess. https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
Same reason that people use perl for heavy text processing, R for scientific programming, python for rapid iteration. It’s what they’re built for. When something is built for a very focused specific problem domain, the problems in that domain can be expressed very concisely and naturally. In the current python test there’s 4-6 lines of Python boilerplate for every 2-3 lines of test “meat”. And it’s all code, making matters even worse. A FileCheck test will have approximately 0 lines of text that aren’t part of the “meat” of the test, and on top of that it can poke at every low level detail of a system, not just those that are blessed with an api On Wed, Feb 7, 2018 at 5:29 PM Jim Ingham via Phabricator < revi...@reviews.llvm.org> wrote: > jingham requested changes to this revision. > jingham added a comment. > This revision now requires changes to proceed. > > You do care about the common match string. When the lldb driver handles > completion, if the common match string is not null, we append that to the > line at the cursor position, then present the matches if there is more than > one. So the common match string also has to be tested. > > The ability to page the completion requests in the API would be useful for > instance in symbol completion where you can get lots of matches, but if you > only plan to display the first page you'd rather not pay the cost to go > find them all. I put that in the SB API's because I didn't want to have to > add another one when I got around to implementing this. When I get around > to this I'll fix the docs... But you could remove that from the lldb > private version if you're so motivated. I'll still remember I intended to > extend it this way, even if nobody else will see that. > > We can't return a std::pair across the SB API's, but we could make the > common match be another parameter. There was some reason this seemed > logical to me at the time, but I must admit I can't remember why now. It > is in practice easy to use, however. You append element 0 to the cursor > position, then print the rest of the completions if num_matches is > 1. > Again, feel free to switch the lldb_private API if it bugs you. > > An additional test in the Python testsuite is: > > def test_target_create_dash_co(self): > """Test that 'target create --co' completes to 'target variable > --core '.""" > self.complete_from_to('target create --co', 'target create --core ') > > So I still don't see why the file check method is preferable. But to each > his own, I guess. > > > https://reviews.llvm.org/D43048 > > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
Also, failures that are easy to reproduce are easy to debug. When a test fails this way, you get a command line that can reproduce the problem that can be debugged directly without having to debug across the python boundary. I find that very helpful personally On Wed, Feb 7, 2018 at 5:48 PM Zachary Turner wrote: > Same reason that people use perl for heavy text processing, R for > scientific programming, python for rapid iteration. It’s what they’re built > for. When something is built for a very focused specific problem domain, > the problems in that domain can be expressed very concisely and naturally. > > In the current python test there’s 4-6 lines of Python boilerplate for > every 2-3 lines of test “meat”. And it’s all code, making matters even > worse. > > A FileCheck test will have approximately 0 lines of text that aren’t part > of the “meat” of the test, and on top of that it can poke at every low > level detail of a system, not just those that are blessed with an api > > On Wed, Feb 7, 2018 at 5:29 PM Jim Ingham via Phabricator < > revi...@reviews.llvm.org> wrote: > >> jingham requested changes to this revision. >> jingham added a comment. >> This revision now requires changes to proceed. >> >> You do care about the common match string. When the lldb driver handles >> completion, if the common match string is not null, we append that to the >> line at the cursor position, then present the matches if there is more than >> one. So the common match string also has to be tested. >> >> The ability to page the completion requests in the API would be useful >> for instance in symbol completion where you can get lots of matches, but if >> you only plan to display the first page you'd rather not pay the cost to go >> find them all. I put that in the SB API's because I didn't want to have to >> add another one when I got around to implementing this. When I get around >> to this I'll fix the docs... But you could remove that from the lldb >> private version if you're so motivated. I'll still remember I intended to >> extend it this way, even if nobody else will see that. >> >> We can't return a std::pair across the SB API's, but we could make the >> common match be another parameter. There was some reason this seemed >> logical to me at the time, but I must admit I can't remember why now. It >> is in practice easy to use, however. You append element 0 to the cursor >> position, then print the rest of the completions if num_matches is > 1. >> Again, feel free to switch the lldb_private API if it bugs you. >> >> An additional test in the Python testsuite is: >> >> def test_target_create_dash_co(self): >> """Test that 'target create --co' completes to 'target variable >> --core '.""" >> self.complete_from_to('target create --co', 'target create --core ') >> >> So I still don't see why the file check method is preferable. But to >> each his own, I guess. >> >> >> https://reviews.llvm.org/D43048 >> >> >> >> ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
jingham added a comment. If a dotest test fails, you go to the Failure-whatever.log, take the last line, add a -d to it, and run it. It suspends itself, then you attach to the Python instance with the debugger. https://reviews.llvm.org/D43048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
Yes but debugging across several api calls is annoying, and the command line in the log file doesn’t ever work for me On Wed, Feb 7, 2018 at 6:07 PM Jim Ingham via Phabricator < revi...@reviews.llvm.org> wrote: > jingham added a comment. > > If a dotest test fails, you go to the Failure-whatever.log, take the last > line, add a -d to it, and run it. It suspends itself, then you attach to > the Python instance with the debugger. > > > https://reviews.llvm.org/D43048 > > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D42994: Stop passing -fPIC to lldb tests on Windows
asmith updated this revision to Diff 133354. asmith edited the summary of this revision. https://reviews.llvm.org/D42994 Files: packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile packages/Python/lldbsuite/test/functionalities/load_unload/a.mk packages/Python/lldbsuite/test/functionalities/load_unload/b.mk packages/Python/lldbsuite/test/functionalities/load_unload/c.mk packages/Python/lldbsuite/test/functionalities/load_unload/d.mk packages/Python/lldbsuite/test/functionalities/load_unload/hidden/Makefile packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/Makefile packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk packages/Python/lldbsuite/test/lang/c/shared_lib/Makefile packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/Makefile packages/Python/lldbsuite/test/lang/c/tls_globals/Makefile packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk packages/Python/lldbsuite/test/lldbtest.py packages/Python/lldbsuite/test/make/Makefile.rules packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py Index: packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py === --- packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py +++ packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py @@ -17,19 +17,17 @@ def test_read_memory_c_string(self): """Test corner case behavior of SBProcess::ReadCStringFromMemory""" self.build() - self.dbg.SetAsync(False) +self.dbg.SetAsync(False) self.main_source = "main.c" -self.main_source_path = os.path.join(self.getSourceDir(), - self.main_source) - self.main_source_spec = lldb.SBFileSpec(self.main_source_path) - self.exe = self.getBuildArtifact("read-mem-cstring") +self.main_source_spec = lldb.SBFileSpec(self.main_source) +self.exe = os.path.join(os.getcwd(), "read-mem-cstring") (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( self, 'breakpoint here', self.main_source_spec, None, self.exe) - frame = thread.GetFrameAtIndex(0) - +frame = thread.GetFrameAtIndex(0) + err = lldb.SBError() empty_str_addr = frame.FindVariable("empty_string").GetValueAsUnsigned(err) Index: packages/Python/lldbsuite/test/make/Makefile.rules === --- packages/Python/lldbsuite/test/make/Makefile.rules +++ packages/Python/lldbsuite/test/make/Makefile.rules @@ -235,6 +235,11 @@ CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) endif +ifneq "$(OS)" "Windows_NT" + CFLAGS += -fPIC + CXXFLAGS += -fPIC +endif + ifeq "$(MAKE_DWO)" "YES" CFLAGS += -gsplit-dwarf endif Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -1478,10 +1478,10 @@ d = { 'DYLIB_CXX_SOURCES': sources, 'DYLIB_NAME': lib_name, -'CFLAGS_EXTRAS': "%s -I%s -fPIC" % (stdflag, -os.path.join( -os.environ["LLDB_SRC"], -"include")), +'CFLAGS_EXTRAS': "%s -I%s " % (stdflag, + os.path.join( + os.environ["LLDB_SRC"], + "include")), 'LD_EXTRAS': "-shared -l%s\liblldb.lib" % self.os.environ["LLDB_IMPLIB_DIR"]} if self.TraceOn(): print( Index: packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk === --- packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk +++ packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk @@ -4,6 +4,4 @@ DYLIB_CXX_SOURCES := b.cpp DYLIB_ONLY := YES -CXXFLAGS += -fPIC - include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk === --- packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk +++ packages/Python/lldbsuite/test/la
[Lldb-commits] [PATCH] D43059: Add implementation for MSCV in CPlusPlusLanguage::IsCPPMangledName
asmith created this revision. asmith added reviewers: zturner, lldb-commits. Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D43059 Files: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Index: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp === --- source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -256,6 +256,9 @@ // this is a C++ mangled name, but we can put that off till there is actually // more than one // we care about. +#if defined(_MSC_VER) + return (name != nullptr && name[0] == '?'); +#endif return (name != nullptr && name[0] == '_' && name[1] == 'Z'); } Index: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp === --- source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -256,6 +256,9 @@ // this is a C++ mangled name, but we can put that off till there is actually // more than one // we care about. +#if defined(_MSC_VER) + return (name != nullptr && name[0] == '?'); +#endif return (name != nullptr && name[0] == '_' && name[1] == 'Z'); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r324558 - Deactivate TestTargetSymbolsBuildidCase if host is windows
Author: eugene Date: Wed Feb 7 19:05:47 2018 New Revision: 324558 URL: http://llvm.org/viewvc/llvm-project?rev=324558&view=rev Log: Deactivate TestTargetSymbolsBuildidCase if host is windows Makefile has unix magic and thus not working on windows. Modified: lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py Modified: lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py?rev=324558&r1=324557&r2=324558&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/linux/buildidcase/TestTargetSymbolsBuildidCase.py Wed Feb 7 19:05:47 2018 @@ -14,6 +14,7 @@ class TestTargetSymbolsBuildidCase(TestB @no_debug_info_test # Prevent the genaration of the dwarf version of this test @skipUnlessPlatform(['linux']) +@skipIf(hostoslist=['windows']) def test_target_symbols_buildid_case(self): self.build(clean=True) exe = self.getBuildArtifact("stripped.out") Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py?rev=324558&r1=324557&r2=324558&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py Wed Feb 7 19:05:47 2018 @@ -109,7 +109,7 @@ def getHostPlatform(): # Attempts to return a platform name matching a target Triple platform. if sys.platform.startswith('linux'): return 'linux' -elif sys.platform.startswith('win32'): +elif sys.platform.startswith('win32') or sys.platform.startswith('cygwin'): return 'windows' elif sys.platform.startswith('darwin'): return 'darwin' ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43061: [docs] Update docs for cmake options LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER
asmith created this revision. asmith added reviewers: zturner, lldb-commits. Herald added a subscriber: llvm-commits. LLDB_TEST_COMPILER is not a valid option for CMake for LLDB. There are instead two properties LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER. Update the documents accordingly to reflect the correct information. Repository: rL LLVM https://reviews.llvm.org/D43061 Files: www/build.html www/test.html Index: www/test.html === --- www/test.html +++ www/test.html @@ -39,8 +39,8 @@ The easiest way to run the LLDB test suite is to use the check-lldb build target. By default, the check-lldb target builds the test programs with the same compiler that was used to build LLDB. To build the tests with a different - compiler, you can set the LLDB_TEST_COMPILER CMake variable. It is possible to - customize the architecture of the test binaries and compiler used by appending -A + compiler, you can set the LLDB_TEST_C_COMPILER or the LLDB_TEST_CXX_COMPILER CMake variables. + It is possible to customize the architecture of the test binaries and compiler used by appending -A and -C options respectively to the CMake variable LLDB_TEST_USER_ARGS. For example, to test LLDB against 32-bit binaries built with a custom version of clang, do: Index: www/build.html === --- www/build.html +++ www/build.html @@ -116,14 +116,14 @@ the PYTHONHOME environment variable if it is specified). -LLDB_TEST_COMPILER: The test suite needs to be able to find a copy of clang.exe that it can use to compile -inferior programs. Note that MSVC is not supported here, it must be a path to a clang executable. -Note that using a release clang.exe is strongly recommended here, as it will make the test suite run much faster. +LLDB_TEST_C_COMPILER or LLDB_TEST_CXX_COMPILER: The test suite needs to be able to find a copy of clang.exe +that it can use to compile inferior programs. Note that MSVC is not supported here, it must be a path to a +clang executable. Note that using a release clang.exe is strongly recommended here, as it will make the test suite run much faster. This can be a path to any recent clang.exe, including one you built yourself. Sample command line: -cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 -DPYTHON_HOME=C:\Python35 -DLLDB_TEST_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe ..\..\llvm +cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 -DPYTHON_HOME=C:\Python35 -DLLDB_TEST_C_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe ..\..\llvm Working with both Ninja and MSVC Compiling with ninja is both faster and simpler than compiling with MSVC, but chances are you still want Index: www/test.html === --- www/test.html +++ www/test.html @@ -39,8 +39,8 @@ The easiest way to run the LLDB test suite is to use the check-lldb build target. By default, the check-lldb target builds the test programs with the same compiler that was used to build LLDB. To build the tests with a different - compiler, you can set the LLDB_TEST_COMPILER CMake variable. It is possible to - customize the architecture of the test binaries and compiler used by appending -A + compiler, you can set the LLDB_TEST_C_COMPILER or the LLDB_TEST_CXX_COMPILER CMake variables. + It is possible to customize the architecture of the test binaries and compiler used by appending -A and -C options respectively to the CMake variable LLDB_TEST_USER_ARGS. For example, to test LLDB against 32-bit binaries built with a custom version of clang, do: Index: www/build.html === --- www/build.html +++ www/build.html @@ -116,14 +116,14 @@ the PYTHONHOME environment variable if it is specified). -LLDB_TEST_COMPILER: The test suite needs to be able to find a copy of clang.exe that it can use to compile -inferior programs. Note that MSVC is not supported here, it must be a path to a clang executable. -Note that using a release clang.exe is strongly recommended here, as it will make the test suite run much faster. +LLDB_TEST_C_COMPILER or LLDB_TEST_CXX_COMPILER: The test suite needs to be able to find a copy of clang.exe +
[Lldb-commits] [PATCH] D42994: Stop passing -fPIC to lldb tests on Windows
asmith updated this revision to Diff 133362. asmith edited the summary of this revision. https://reviews.llvm.org/D42994 Files: packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile packages/Python/lldbsuite/test/functionalities/load_unload/a.mk packages/Python/lldbsuite/test/functionalities/load_unload/b.mk packages/Python/lldbsuite/test/functionalities/load_unload/c.mk packages/Python/lldbsuite/test/functionalities/load_unload/d.mk packages/Python/lldbsuite/test/functionalities/load_unload/hidden/Makefile packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/Makefile packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk packages/Python/lldbsuite/test/lang/c/shared_lib/Makefile packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/Makefile packages/Python/lldbsuite/test/lang/c/tls_globals/Makefile packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk packages/Python/lldbsuite/test/lldbtest.py packages/Python/lldbsuite/test/make/Makefile.rules packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py Index: packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py === --- packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py +++ packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py @@ -17,19 +17,19 @@ def test_read_memory_c_string(self): """Test corner case behavior of SBProcess::ReadCStringFromMemory""" self.build() - self.dbg.SetAsync(False) +self.dbg.SetAsync(False) self.main_source = "main.c" self.main_source_path = os.path.join(self.getSourceDir(), self.main_source) - self.main_source_spec = lldb.SBFileSpec(self.main_source_path) - self.exe = self.getBuildArtifact("read-mem-cstring") +self.main_source_spec = lldb.SBFileSpec(self.main_source_path) +self.exe = self.getBuildArtifact("read-mem-cstring") (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( self, 'breakpoint here', self.main_source_spec, None, self.exe) - frame = thread.GetFrameAtIndex(0) - +frame = thread.GetFrameAtIndex(0) + err = lldb.SBError() empty_str_addr = frame.FindVariable("empty_string").GetValueAsUnsigned(err) Index: packages/Python/lldbsuite/test/make/Makefile.rules === --- packages/Python/lldbsuite/test/make/Makefile.rules +++ packages/Python/lldbsuite/test/make/Makefile.rules @@ -235,6 +235,11 @@ CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) endif +ifneq "$(OS)" "Windows_NT" + CFLAGS += -fPIC + CXXFLAGS += -fPIC +endif + ifeq "$(MAKE_DWO)" "YES" CFLAGS += -gsplit-dwarf endif Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -1478,10 +1478,10 @@ d = { 'DYLIB_CXX_SOURCES': sources, 'DYLIB_NAME': lib_name, -'CFLAGS_EXTRAS': "%s -I%s -fPIC" % (stdflag, -os.path.join( -os.environ["LLDB_SRC"], -"include")), +'CFLAGS_EXTRAS': "%s -I%s " % (stdflag, + os.path.join( + os.environ["LLDB_SRC"], + "include")), 'LD_EXTRAS': "-shared -l%s\liblldb.lib" % self.os.environ["LLDB_IMPLIB_DIR"]} if self.TraceOn(): print( Index: packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk === --- packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk +++ packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk @@ -4,6 +4,4 @@ DYLIB_CXX_SOURCES := b.cpp DYLIB_ONLY := YES -CXXFLAGS += -fPIC - include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk === --- packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk +++ packages/Python/lldbsuite/test/l
Re: [Lldb-commits] [PATCH] D43061: [docs] Update docs for cmake options LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER
Looks good. Stuff like this feel free to just commit On Wed, Feb 7, 2018 at 7:53 PM Aaron Smith via Phabricator < revi...@reviews.llvm.org> wrote: > asmith created this revision. > asmith added reviewers: zturner, lldb-commits. > Herald added a subscriber: llvm-commits. > > LLDB_TEST_COMPILER is not a valid option for CMake for LLDB. There are > instead two properties LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER. > Update the documents accordingly to reflect the correct information. > > > Repository: > rL LLVM > > https://reviews.llvm.org/D43061 > > Files: > www/build.html > www/test.html > > > Index: www/test.html > === > --- www/test.html > +++ www/test.html > @@ -39,8 +39,8 @@ >The easiest way to run the LLDB test suite is to use the > check-lldb build >target. By default, the check-lldb target builds > the test programs with >the same compiler that was used to build LLDB. To build the > tests with a different > - compiler, you can set the > LLDB_TEST_COMPILER CMake variable. It is possible to > - customize the architecture of the test binaries and > compiler used by appending -A > + compiler, you can set the > LLDB_TEST_C_COMPILER or the > LLDB_TEST_CXX_COMPILER CMake variables. > + It is possible to customize the architecture of the test > binaries and compiler used by appending -A >and -C options respectively to the CMake variable > LLDB_TEST_USER_ARGS. For >example, to test LLDB against 32-bit binaries >built with a custom version of clang, do: > Index: www/build.html > === > --- www/build.html > +++ www/build.html > @@ -116,14 +116,14 @@ > the PYTHONHOME environment variable if it is specified). > > > -LLDB_TEST_COMPILER: The test suite needs to be > able to find a copy of clang.exe that it can use to compile > -inferior programs. Note that MSVC is not supported here, > it must be a path to a clang executable. > -Note that using a release clang.exe is strongly > recommended here, as it will make the test suite run much faster. > +LLDB_TEST_C_COMPILER or > LLDB_TEST_CXX_COMPILER: The test suite needs to be able to find a > copy of clang.exe > +that it can use to compile inferior programs. Note that > MSVC is not supported here, it must be a path to a > +clang executable. Note that using a release clang.exe is > strongly recommended here, as it will make the test suite run much faster. > This can be a path to any recent clang.exe, including one > you built yourself. > > > Sample command line: > -cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 > -DPYTHON_HOME=C:\Python35 > -DLLDB_TEST_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe > ..\..\llvm > +cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 > -DPYTHON_HOME=C:\Python35 > -DLLDB_TEST_C_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe > ..\..\llvm > Working with both Ninja and MSVC > >Compiling with ninja is both faster and > simpler than compiling with MSVC, but chances are you still want > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
> On Feb 7, 2018, at 6:40 PM, Zachary Turner wrote: > and the command line in the log file doesn’t ever work for me' That's a bug. Can you show me an example where this breaks for you? I'd like to investigate this. -- adrian ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43061: [docs] Update docs for cmake options LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL324564: [docs] Update docs for cmake options LLDB_TEST_C_COMPILER and… (authored by asmith, committed by ). Changed prior to commit: https://reviews.llvm.org/D43061?vs=133361&id=133368#toc Repository: rL LLVM https://reviews.llvm.org/D43061 Files: lldb/trunk/www/build.html lldb/trunk/www/test.html Index: lldb/trunk/www/build.html === --- lldb/trunk/www/build.html +++ lldb/trunk/www/build.html @@ -116,14 +116,14 @@ the PYTHONHOME environment variable if it is specified). -LLDB_TEST_COMPILER: The test suite needs to be able to find a copy of clang.exe that it can use to compile -inferior programs. Note that MSVC is not supported here, it must be a path to a clang executable. -Note that using a release clang.exe is strongly recommended here, as it will make the test suite run much faster. +LLDB_TEST_C_COMPILER or LLDB_TEST_CXX_COMPILER: The test suite needs to be able to find a copy of clang.exe +that it can use to compile inferior programs. Note that MSVC is not supported here, it must be a path to a +clang executable. Note that using a release clang.exe is strongly recommended here, as it will make the test suite run much faster. This can be a path to any recent clang.exe, including one you built yourself. Sample command line: -cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 -DPYTHON_HOME=C:\Python35 -DLLDB_TEST_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe ..\..\llvm +cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 -DPYTHON_HOME=C:\Python35 -DLLDB_TEST_C_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe ..\..\llvm Working with both Ninja and MSVC Compiling with ninja is both faster and simpler than compiling with MSVC, but chances are you still want Index: lldb/trunk/www/test.html === --- lldb/trunk/www/test.html +++ lldb/trunk/www/test.html @@ -39,8 +39,8 @@ The easiest way to run the LLDB test suite is to use the check-lldb build target. By default, the check-lldb target builds the test programs with the same compiler that was used to build LLDB. To build the tests with a different - compiler, you can set the LLDB_TEST_COMPILER CMake variable. It is possible to - customize the architecture of the test binaries and compiler used by appending -A + compiler, you can set the LLDB_TEST_C_COMPILER or the LLDB_TEST_CXX_COMPILER CMake variables. + It is possible to customize the architecture of the test binaries and compiler used by appending -A and -C options respectively to the CMake variable LLDB_TEST_USER_ARGS. For example, to test LLDB against 32-bit binaries built with a custom version of clang, do: Index: lldb/trunk/www/build.html === --- lldb/trunk/www/build.html +++ lldb/trunk/www/build.html @@ -116,14 +116,14 @@ the PYTHONHOME environment variable if it is specified). -LLDB_TEST_COMPILER: The test suite needs to be able to find a copy of clang.exe that it can use to compile -inferior programs. Note that MSVC is not supported here, it must be a path to a clang executable. -Note that using a release clang.exe is strongly recommended here, as it will make the test suite run much faster. +LLDB_TEST_C_COMPILER or LLDB_TEST_CXX_COMPILER: The test suite needs to be able to find a copy of clang.exe +that it can use to compile inferior programs. Note that MSVC is not supported here, it must be a path to a +clang executable. Note that using a release clang.exe is strongly recommended here, as it will make the test suite run much faster. This can be a path to any recent clang.exe, including one you built yourself. Sample command line: -cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 -DPYTHON_HOME=C:\Python35 -DLLDB_TEST_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe ..\..\llvm +cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 -DPYTHON_HOME=C:\Python35 -DLLDB_TEST_C_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe ..\..\llvm Working with both Ninja and MSVC Compiling with ninja is both faster and simpler than compil
Re: [Lldb-commits] [PATCH] D43048: [lldb-test/WIP] Allow a way to test autocompletion
On Wed, Feb 7, 2018 at 8:20 PM, Adrian Prantl wrote: > > > > On Feb 7, 2018, at 6:40 PM, Zachary Turner wrote: > > > and the command line in the log file doesn’t ever work for me' > > That's a bug. Can you show me an example where this breaks for you? I'd > like to investigate this. > > -- adrian Adrian, I think I reported this issue a while ago, but I haven't checked whether it still reproduces. You might take a look at the original bug if you get a chance https://bugs.llvm.org/show_bug.cgi?id=35037 Thanks! -- Davide ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D43059: Add implementation for MSVC in CPlusPlusLanguage::IsCPPMangledName
davide added a comment. Can you add a unittest for this? :) Repository: rL LLVM https://reviews.llvm.org/D43059 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits