[Lldb-commits] [PATCH] D65677: [VirtualFileSystem] Support encoding working directories in a VFS mapping.

2019-08-28 Thread Sam McCall via Phabricator via lldb-commits
sammccall added a comment.

In D65677#1627576 , @JDevlieghere 
wrote:

> After some brainstorming I've identified a few other approaches that should 
> better reflect the transience of the current working directory:
>
> - We can modify the VFS to have a notion of //search paths//. The 
> `adjustPath` function could iterate over the search paths until it finds an 
> absolute path that exists. If none exist we'd return the same path we return 
> today. This would be the most general approach.
> - We could create a new virtual file system that we put on top of the 
> RedirectingFileSystem which does something similar to what I've described 
> above. This would require us to override every function that calls 
> `adjustPath`, so it would be pretty heavyweight and rather inflexible.
>
>   I'd like to get your feedback before I start implementing these. What do 
> you think? Is there another approach that's worth considering?


I'm really sorry for missing this comment, I was out sick and missed the email.

> I'd like to get your feedback before I start implementing these.

Honestly, this still seems way too complicated and this doesn't seem like a 
feature that needs to be part of VFS.

>   What do you think? Is there another approach that's worth considering?

Per my previous comment, what goes wrong if you try to make the working 
directory a sibling of VFS (within the reproducer container) rather than a 
child of it (within shared infrastructure)?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65677/new/

https://reviews.llvm.org/D65677



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66863: [lldb] Unify target checking in CommandObject

2019-08-28 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added a reviewer: labath.
Herald added subscribers: lldb-commits, abidh.
Herald added a project: LLDB.

We currently have several CommandObjects that manually reimplement the checking 
for a selected target
or a target in the execution context (which is the selected target when they 
are invoked). This patch removes
all these checks and replaces them by setting the eCommandRequiresTarget flag 
that Pavel suggested. With
this flag we are doing the same check but without having to duplicate this code 
in all these CommandObjects.

I also added a `GetSelectedTarget()` variant of the 
`GetSelectedOrDummyTarget()` function to the
CommandObject that checks that the flag is set and then returns a reference to 
the target. I didn't rewrite
all the `target` variables from `Target *` to `Target &` in this patch as last 
time this change caused a lot of merge
conflicts in Swift and I would prefer having that in a separate NFC commit.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66863

Files:
  lldb/include/lldb/Interpreter/CommandObject.h
  lldb/source/Commands/CommandObjectBreakpointCommand.cpp
  lldb/source/Commands/CommandObjectDisassemble.cpp
  lldb/source/Commands/CommandObjectProcess.cpp
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Commands/CommandObjectThread.cpp
  lldb/source/Commands/CommandObjectWatchpoint.cpp
  lldb/source/Commands/CommandObjectWatchpointCommand.cpp
  lldb/source/Interpreter/CommandObject.cpp

Index: lldb/source/Interpreter/CommandObject.cpp
===
--- lldb/source/Interpreter/CommandObject.cpp
+++ lldb/source/Interpreter/CommandObject.cpp
@@ -925,6 +925,12 @@
   return *m_interpreter.GetDebugger().GetSelectedOrDummyTarget(prefer_dummy);
 }
 
+Target &CommandObject::GetSelectedTarget() {
+  assert(m_flags.AllSet(eCommandRequiresTarget) &&
+ "GetSelectedTarget called from object that may have no target");
+  return *m_interpreter.GetDebugger().GetSelectedTarget();
+}
+
 Thread *CommandObject::GetDefaultThread() {
   Thread *thread_to_use = m_exe_ctx.GetThreadPtr();
   if (thread_to_use)
Index: lldb/source/Commands/CommandObjectWatchpointCommand.cpp
===
--- lldb/source/Commands/CommandObjectWatchpointCommand.cpp
+++ lldb/source/Commands/CommandObjectWatchpointCommand.cpp
@@ -59,7 +59,7 @@
   : CommandObjectParsed(interpreter, "add",
 "Add a set of LLDB commands to a watchpoint, to be "
 "executed whenever the watchpoint is hit.",
-nullptr),
+nullptr, eCommandRequiresTarget),
 IOHandlerDelegateMultiline("DONE",
IOHandlerDelegate::Completion::LLDBCommand),
 m_options() {
@@ -389,14 +389,7 @@
 
 protected:
   bool DoExecute(Args &command, CommandReturnObject &result) override {
-Target *target = GetDebugger().GetSelectedTarget().get();
-
-if (target == nullptr) {
-  result.AppendError("There is not a current executable; there are no "
- "watchpoints to which to add commands");
-  result.SetStatus(eReturnStatusFailed);
-  return false;
-}
+Target *target = &GetSelectedTarget();
 
 const WatchpointList &watchpoints = target->GetWatchpointList();
 size_t num_watchpoints = watchpoints.GetSize();
@@ -486,7 +479,7 @@
   CommandObjectWatchpointCommandDelete(CommandInterpreter &interpreter)
   : CommandObjectParsed(interpreter, "delete",
 "Delete the set of commands from a watchpoint.",
-nullptr) {
+nullptr, eCommandRequiresTarget) {
 CommandArgumentEntry arg;
 CommandArgumentData wp_id_arg;
 
@@ -506,14 +499,7 @@
 
 protected:
   bool DoExecute(Args &command, CommandReturnObject &result) override {
-Target *target = GetDebugger().GetSelectedTarget().get();
-
-if (target == nullptr) {
-  result.AppendError("There is not a current executable; there are no "
- "watchpoints from which to delete commands");
-  result.SetStatus(eReturnStatusFailed);
-  return false;
-}
+Target *target = &GetSelectedTarget();
 
 const WatchpointList &watchpoints = target->GetWatchpointList();
 size_t num_watchpoints = watchpoints.GetSize();
@@ -562,10 +548,11 @@
 class CommandObjectWatchpointCommandList : public CommandObjectParsed {
 public:
   CommandObjectWatchpointCommandList(CommandInterpreter &interpreter)
-  : CommandObjectParsed(interpreter, "list", "List the script or set of "
- "commands to be executed when "
- "the watchpoint is hit.",
-nullptr) {
+  : CommandObjectParsed(interpreter, "list",
+  

[Lldb-commits] [lldb] r370174 - [lldb][NFC] Update documentation of Handle[Argument]Completion

2019-08-28 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 28 02:02:32 2019
New Revision: 370174

URL: http://llvm.org/viewvc/llvm-project?rev=370174&view=rev
Log:
[lldb][NFC] Update documentation of Handle[Argument]Completion

We no longer have return values or any of the mentioned arguments
in these functions since the introduction of CompletionRequest.

Modified:
lldb/trunk/include/lldb/Interpreter/CommandObject.h

Modified: lldb/trunk/include/lldb/Interpreter/CommandObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandObject.h?rev=370174&r1=370173&r2=370174&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandObject.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandObject.h Wed Aug 28 02:02:32 2019
@@ -228,25 +228,15 @@ public:
   ///
   /// \param[in/out] request
   ///The completion request that needs to be answered.
-  ///
-  /// FIXME: This is the wrong return value, since we also need to make a
-  /// distinction between
-  /// total number of matches, and the window the user wants returned.
   virtual void HandleCompletion(CompletionRequest &request);
 
-  /// The input array contains a parsed version of the line.  The insertion
-  /// point is given by cursor_index (the index in input of the word containing
-  /// the cursor) and cursor_char_position (the position of the cursor in that
-  /// word.)
+  /// The input array contains a parsed version of the line.
+  ///
   /// We've constructed the map of options and their arguments as well if that
   /// is helpful for the completion.
   ///
   /// \param[in/out] request
   ///The completion request that needs to be answered.
-  ///
-  /// FIXME: This is the wrong return value, since we also need to make a
-  /// distinction between
-  /// total number of matches, and the window the user wants returned.
   virtual void
   HandleArgumentCompletion(CompletionRequest &request,
OptionElementVector &opt_element_vector) {}


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370179 - [lldb][NFC] Get rid of C-strings in HandleOptionCompletion

2019-08-28 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 28 02:32:30 2019
New Revision: 370179

URL: http://llvm.org/viewvc/llvm-project?rev=370179&view=rev
Log:
[lldb][NFC] Get rid of C-strings in HandleOptionCompletion

Modified:
lldb/trunk/source/Interpreter/Options.cpp

Modified: lldb/trunk/source/Interpreter/Options.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=370179&r1=370178&r2=370179&view=diff
==
--- lldb/trunk/source/Interpreter/Options.cpp (original)
+++ lldb/trunk/source/Interpreter/Options.cpp Wed Aug 28 02:32:30 2019
@@ -652,8 +652,7 @@ bool Options::HandleOptionCompletion(Com
 
   auto opt_defs = GetDefinitions();
 
-  std::string cur_opt_std_str = request.GetCursorArgumentPrefix().str();
-  const char *cur_opt_str = cur_opt_std_str.c_str();
+  llvm::StringRef cur_opt_str = request.GetCursorArgumentPrefix();
 
   for (size_t i = 0; i < opt_element_vector.size(); i++) {
 int opt_pos = opt_element_vector[i].opt_pos;
@@ -667,7 +666,7 @@ bool Options::HandleOptionCompletion(Com
 // FIXME: We should scan the other options provided and only complete
 // options
 // within the option group they belong to.
-char opt_str[3] = {'-', 'a', '\0'};
+std::string opt_str = "-a";
 
 for (auto &def : opt_defs) {
   if (!def.short_option)
@@ -685,7 +684,7 @@ bool Options::HandleOptionCompletion(Com
 
   full_name.erase(full_name.begin() + 2, full_name.end());
   full_name.append(def.long_option);
-  request.AddCompletion(full_name.c_str());
+  request.AddCompletion(full_name);
 }
 return true;
   } else if (opt_defs_index != OptionArgElement::eUnrecognizedArg) {
@@ -693,17 +692,13 @@ bool Options::HandleOptionCompletion(Com
 // anyway (getopt_long_only is happy with shortest unique string, but
 // it's still a nice thing to do.)  Otherwise return The string so the
 // upper level code will know this is a full match and add the " ".
-if (cur_opt_str && strlen(cur_opt_str) > 2 && cur_opt_str[0] == '-' &&
-cur_opt_str[1] == '-' &&
-strcmp(opt_defs[opt_defs_index].long_option, cur_opt_str) != 0) {
-  std::string full_name("--");
-  full_name.append(opt_defs[opt_defs_index].long_option);
-  request.AddCompletion(full_name.c_str());
+llvm::StringRef long_option = opt_defs[opt_defs_index].long_option;
+if (cur_opt_str.startswith("--") && cur_opt_str != long_option) {
+  request.AddCompletion("--" + long_option.str());
   return true;
-} else {
+} else
   request.AddCompletion(request.GetCursorArgument());
-  return true;
-}
+return true;
   } else {
 // FIXME - not handling wrong options yet:
 // Check to see if they are writing a long option & complete it.
@@ -712,16 +707,15 @@ bool Options::HandleOptionCompletion(Com
 // that are not unique up to this point.  getopt_long_only does
 // shortest unique match for long options already.
 
-if (cur_opt_str && strlen(cur_opt_str) > 2 && cur_opt_str[0] == '-' &&
-cur_opt_str[1] == '-') {
+if (cur_opt_str.startswith("--")) {
   for (auto &def : opt_defs) {
 if (!def.long_option)
   continue;
 
-if (strstr(def.long_option, cur_opt_str + 2) == def.long_option) {
+if (cur_opt_str.startswith(def.long_option)) {
   std::string full_name("--");
   full_name.append(def.long_option);
-  request.AddCompletion(full_name.c_str());
+  request.AddCompletion(full_name);
 }
   }
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370185 - [lldb] Fix and test completion for ambiguous long options

2019-08-28 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 28 03:17:23 2019
New Revision: 370185

URL: http://llvm.org/viewvc/llvm-project?rev=370185&view=rev
Log:
[lldb] Fix and test completion for ambiguous long options

The refactoring patch for the option completion broke the completion
for ambiguous long options. As this feature was also untested (as
testing ambiguous options with the current test methods is impossible),
I just noticed now. This patch restores the old behavior and adds a
test for this feature.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
lldb/trunk/source/Interpreter/Options.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py?rev=370185&r1=370184&r2=370185&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 Wed Aug 28 03:17:23 2019
@@ -91,6 +91,13 @@ class CommandLineCompletionTestCase(Test
'arm64'])
 
 @skipIfFreeBSD  # timing out on the FreeBSD buildbot
+def test_ambiguous_long_opt(self):
+self.completions_match('breakpoint modify --th',
+   ['--thread-id',
+'--thread-index',
+'--thread-name'])
+
+@skipIfFreeBSD  # timing out on the FreeBSD buildbot
 def test_plugin_load(self):
 self.complete_from_to('plugin load ', [])
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=370185&r1=370184&r2=370185&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Wed Aug 28 03:17:23 
2019
@@ -2194,6 +2194,16 @@ class TestBase(Base):
 compare_string, msg=COMPLETION_MSG(
 str_input, p, match_strings), exe=False, patterns=[p])
 
+def completions_match(self, command, completions):
+"""Checks that the completions for the given command are equal to the
+given list of completions"""
+interp = self.dbg.GetCommandInterpreter()
+match_strings = lldb.SBStringList()
+interp.HandleCompletion(command, len(command), 0, -1, match_strings)
+# match_strings is a 1-indexed list, so we have to slice...
+self.assertItemsEqual(completions, list(match_strings)[1:],
+  "List of returned completion is wrong")
+
 def filecheck(
 self,
 command,

Modified: lldb/trunk/source/Interpreter/Options.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=370185&r1=370184&r2=370185&view=diff
==
--- lldb/trunk/source/Interpreter/Options.cpp (original)
+++ lldb/trunk/source/Interpreter/Options.cpp Wed Aug 28 03:17:23 2019
@@ -706,17 +706,11 @@ bool Options::HandleOptionCompletion(Com
 // elements
 // that are not unique up to this point.  getopt_long_only does
 // shortest unique match for long options already.
-
-if (cur_opt_str.startswith("--")) {
+if (cur_opt_str.consume_front("--")) {
   for (auto &def : opt_defs) {
-if (!def.long_option)
-  continue;
-
-if (cur_opt_str.startswith(def.long_option)) {
-  std::string full_name("--");
-  full_name.append(def.long_option);
-  request.AddCompletion(full_name);
-}
+llvm::StringRef long_option(def.long_option);
+if (long_option.startswith(cur_opt_str))
+  request.AddCompletion("--" + long_option.str());
   }
 }
 return true;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370186 - [lldb][NFC] Test custom C++ operators

2019-08-28 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 28 04:18:47 2019
New Revision: 370186

URL: http://llvm.org/viewvc/llvm-project?rev=370186&view=rev
Log:
[lldb][NFC] Test custom C++ operators

Added:
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/Makefile

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/TestCppOperators.py
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp

Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/Makefile?rev=370186&view=auto
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/Makefile 
(added)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/Makefile Wed 
Aug 28 04:18:47 2019
@@ -0,0 +1,3 @@
+LEVEL = ../../../make
+CXX_SOURCES := main.cpp
+include $(LEVEL)/Makefile.rules

Added: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/TestCppOperators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/TestCppOperators.py?rev=370186&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/TestCppOperators.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/TestCppOperators.py
 Wed Aug 28 04:18:47 2019
@@ -0,0 +1,5 @@
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
+
+lldbinline.MakeInlineTest(__file__, globals(),
+  lldbinline.expectedFailureAll(oslist=["windows"]))

Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp?rev=370186&view=auto
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp 
(added)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp Wed 
Aug 28 04:18:47 2019
@@ -0,0 +1,142 @@
+struct B { int dummy = 2324; };
+struct C {
+  B b;
+  B* operator->() { return &b; }
+  int operator->*(int) { return 2; }
+  int operator+(int) { return 44; }
+  int operator+=(int) { return 42; }
+  int operator++(int) { return 123; }
+  int operator++() { return 1234; }
+  int operator-(int) { return 34; }
+  int operator-=(int) { return 32; }
+  int operator--() { return 321; }
+  int operator--(int) { return 4321; }
+
+  int operator*(int) { return 51; }
+  int operator*=(int) { return 52; }
+  int operator%(int) { return 53; }
+  int operator%=(int) { return 54; }
+  int operator/(int) { return 55; }
+  int operator/=(int) { return 56; }
+  int operator^(int) { return 57; }
+  int operator^=(int) { return 58; }
+
+  int operator|(int) { return 61; }
+  int operator|=(int) { return 62; }
+  int operator||(int) { return 63; }
+  int operator&(int) { return 64; }
+  int operator&=(int) { return 65; }
+  int operator&&(int) { return 66; }
+
+  int operator~() { return 71; }
+  int operator!() { return 72; }
+  int operator!=(int) { return 73; }
+  int operator=(int) { return 74; }
+  int operator==(int) { return 75; }
+
+  int operator<(int) { return 81; }
+  int operator<<(int) { return 82; }
+  int operator<=(int) { return 83; }
+  int operator<<=(int) { return 84; }
+  int operator>(int) { return 85; }
+  int operator>>(int) { return 86; }
+  int operator>=(int) { return 87; }
+  int operator>>=(int) { return 88; }
+
+  int operator[](int) { return 91; }
+  int operator()(int) { return 92; }
+};
+
+int main(int argc, char **argv) {
+  C c;
+  int result = c->dummy;
+  result = c->*4;
+  result += c+1;
+  result += c+=1;
+  result += c++;
+  result += ++c;
+  result += c-1;
+  result += c-=1;
+  result += c--;
+  result += --c;
+
+  result += c * 4;
+  result += c *= 4;
+  result += c % 4;
+  result += c %= 4;
+  result += c / 4;
+  result += c /= 4;
+  result += c ^ 4;
+  result += c ^= 4;
+
+  result += c | 4;
+  result += c |= 4;
+  result += c || 4;
+  result += c & 4;
+  result += c &= 4;
+  result += c && 4;
+
+  result += ~c;
+  result += !c;
+  result += c!=1;
+  result += c=2;
+  result += c==2;
+
+  result += c<2;
+  result += c<<2;
+  result += c<=2;
+  result += c<<=2;
+  result += c>2;
+  result += c>>2;
+  result += c>=2;
+  result += c>>=2;
+
+  result += c(1);
+  result += c[1];
+  //% self.expect("expr c->dummy", endstr=" 2324\n")
+  //% self.expect("expr c->*2", endstr=" 2\n")
+  //% self.expect("expr c + 44", endstr=" 44\n")
+  //% self.expect("expr c += 42", endstr=" 42\n")
+  //% self.expect("expr c++", endstr=" 123\n")
+  //% self.expect("expr ++c", endstr=" 1234\n")
+
+  //% self.expect("expr c - 34", endstr=" 34\n")
+  //% self.expect(

[Lldb-commits] [lldb] r370194 - [lldb][NFC] Extend operator test case with conversion operators

2019-08-28 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 28 05:14:39 2019
New Revision: 370194

URL: http://llvm.org/viewvc/llvm-project?rev=370194&view=rev
Log:
[lldb][NFC] Extend operator test case with conversion operators

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp?rev=370194&r1=370193&r2=370194&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp Wed 
Aug 28 05:14:39 2019
@@ -45,6 +45,9 @@ struct C {
 
   int operator[](int) { return 91; }
   int operator()(int) { return 92; }
+
+  operator int() { return 11; }
+  operator long() { return 12; }
 };
 
 int main(int argc, char **argv) {
@@ -93,6 +96,10 @@ int main(int argc, char **argv) {
 
   result += c(1);
   result += c[1];
+
+  result += static_cast(c);
+  result += static_cast(c);
+
   //% self.expect("expr c->dummy", endstr=" 2324\n")
   //% self.expect("expr c->*2", endstr=" 2\n")
   //% self.expect("expr c + 44", endstr=" 44\n")
@@ -138,5 +145,7 @@ int main(int argc, char **argv) {
 
   //% self.expect("expr c(1)", endstr=" 91\n")
   //% self.expect("expr c[1]", endstr=" 92\n")
+  //% self.expect("expr static_cast", endstr=" 11\n")
+  //% self.expect("expr static_cast", endstr=" 12\n")
   return 0;
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370195 - [lldb][NFC] Actually run all expects in lang/cpp/operators

2019-08-28 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 28 05:32:58 2019
New Revision: 370195

URL: http://llvm.org/viewvc/llvm-project?rev=370195&view=rev
Log:
[lldb][NFC] Actually run all expects in lang/cpp/operators

Apparently inline tests stop running anything after an empty line
behind an self.expect, which is a very good approach that could
never cause people to write tests that never run.

This patch removes all the empty lines so that all this test
is actually run. Also fixes the broken expects that only passed
because they weren't run before.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp?rev=370195&r1=370194&r2=370195&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp Wed 
Aug 28 05:32:58 2019
@@ -43,8 +43,8 @@ struct C {
   int operator>=(int) { return 87; }
   int operator>>=(int) { return 88; }
 
-  int operator[](int) { return 91; }
-  int operator()(int) { return 92; }
+  int operator()(int) { return 91; }
+  int operator[](int) { return 92; }
 
   operator int() { return 11; }
   operator long() { return 12; }
@@ -106,12 +106,10 @@ int main(int argc, char **argv) {
   //% self.expect("expr c += 42", endstr=" 42\n")
   //% self.expect("expr c++", endstr=" 123\n")
   //% self.expect("expr ++c", endstr=" 1234\n")
-
   //% self.expect("expr c - 34", endstr=" 34\n")
   //% self.expect("expr c -= 32", endstr=" 32\n")
-  //% self.expect("expr c--", endstr=" 321\n")
-  //% self.expect("expr --c", endstr=" 4321\n")
-
+  //% self.expect("expr c--", endstr=" 4321\n")
+  //% self.expect("expr --c", endstr=" 321\n")
   //% self.expect("expr c * 3", endstr=" 51\n")
   //% self.expect("expr c *= 3", endstr=" 52\n")
   //% self.expect("expr c % 3", endstr=" 53\n")
@@ -120,20 +118,17 @@ int main(int argc, char **argv) {
   //% self.expect("expr c /= 3", endstr=" 56\n")
   //% self.expect("expr c ^ 3", endstr=" 57\n")
   //% self.expect("expr c ^= 3", endstr=" 58\n")
-
   //% self.expect("expr c | 3", endstr=" 61\n")
   //% self.expect("expr c |= 3", endstr=" 62\n")
   //% self.expect("expr c || 3", endstr=" 63\n")
   //% self.expect("expr c & 3", endstr=" 64\n")
   //% self.expect("expr c &= 3", endstr=" 65\n")
   //% self.expect("expr c && 3", endstr=" 66\n")
-
   //% self.expect("expr ~c", endstr=" 71\n")
   //% self.expect("expr !c", endstr=" 72\n")
   //% self.expect("expr c!=1", endstr=" 73\n")
   //% self.expect("expr c=1", endstr=" 74\n")
   //% self.expect("expr c==1", endstr=" 75\n")
-
   //% self.expect("expr c<1", endstr=" 81\n")
   //% self.expect("expr c<<1", endstr=" 82\n")
   //% self.expect("expr c<=1", endstr=" 83\n")
@@ -142,10 +137,9 @@ int main(int argc, char **argv) {
   //% self.expect("expr c>>1", endstr=" 86\n")
   //% self.expect("expr c>=1", endstr=" 87\n")
   //% self.expect("expr c>>=1", endstr=" 88\n")
-
   //% self.expect("expr c(1)", endstr=" 91\n")
   //% self.expect("expr c[1]", endstr=" 92\n")
-  //% self.expect("expr static_cast", endstr=" 11\n")
-  //% self.expect("expr static_cast", endstr=" 12\n")
+  //% self.expect("expr static_cast(c)", endstr=" 11\n")
+  //% self.expect("expr static_cast(c)", endstr=" 12\n")
   return 0;
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370199 - [lldb][NFC] Test named operators like new and function names that might confuse LLDB

2019-08-28 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 28 06:33:52 2019
New Revision: 370199

URL: http://llvm.org/viewvc/llvm-project?rev=370199&view=rev
Log:
[lldb][NFC] Test named operators like new and function names that might confuse 
LLDB

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp?rev=370199&r1=370198&r2=370199&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp Wed 
Aug 28 06:33:52 2019
@@ -1,5 +1,10 @@
+#include 
+
 struct B { int dummy = 2324; };
 struct C {
+  void *operator new(size_t size) { C* r = ::new C; r->custom_new = true; 
return r; }
+
+  bool custom_new = false;
   B b;
   B* operator->() { return &b; }
   int operator->*(int) { return 2; }
@@ -48,6 +53,11 @@ struct C {
 
   operator int() { return 11; }
   operator long() { return 12; }
+
+  // Make sure this doesn't collide with
+  // the real operator int.
+  int operatorint() { return 13; }
+  int operatornew() { return 14; }
 };
 
 int main(int argc, char **argv) {
@@ -99,6 +109,10 @@ int main(int argc, char **argv) {
 
   result += static_cast(c);
   result += static_cast(c);
+  result += c.operatorint();
+  result += c.operatornew();
+
+  C *c2 = new C();
 
   //% self.expect("expr c->dummy", endstr=" 2324\n")
   //% self.expect("expr c->*2", endstr=" 2\n")
@@ -141,5 +155,9 @@ int main(int argc, char **argv) {
   //% self.expect("expr c[1]", endstr=" 92\n")
   //% self.expect("expr static_cast(c)", endstr=" 11\n")
   //% self.expect("expr static_cast(c)", endstr=" 12\n")
+  //% self.expect("expr c.operatorint()", endstr=" 13\n")
+  //% self.expect("expr c.operatornew()", endstr=" 14\n")
+  //% self.expect("expr (new C)->custom_new", endstr=" true\n")
+  delete c2;
   return 0;
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370201 - [lldb][NFC] Refactor and document ClangASTContext::IsOperator

2019-08-28 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 28 06:46:01 2019
New Revision: 370201

URL: http://llvm.org/viewvc/llvm-project?rev=370201&view=rev
Log:
[lldb][NFC] Refactor and document ClangASTContext::IsOperator

Should make it clearer what actually is going on in there.

Modified:
lldb/trunk/include/lldb/Symbol/ClangASTContext.h
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=370201&r1=370200&r2=370201&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Wed Aug 28 06:46:01 2019
@@ -249,7 +249,7 @@ public:
   &type_fields,
   bool packed = false);
 
-  static bool IsOperator(const char *name,
+  static bool IsOperator(llvm::StringRef name,
  clang::OverloadedOperatorKind &op_kind);
 
   // Structure, Unions, Classes

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=370201&r1=370200&r2=370201&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Aug 28 06:46:01 2019
@@ -336,219 +336,82 @@ static ClangASTMap &GetASTMap() {
   return *g_map_ptr;
 }
 
-bool ClangASTContext::IsOperator(const char *name,
+bool ClangASTContext::IsOperator(llvm::StringRef name,
  clang::OverloadedOperatorKind &op_kind) {
-  if (name == nullptr || name[0] == '\0')
+  // All operators have to start with "operator".
+  if (!name.consume_front("operator"))
 return false;
 
-#define OPERATOR_PREFIX "operator"
-#define OPERATOR_PREFIX_LENGTH (sizeof(OPERATOR_PREFIX) - 1)
-
-  const char *post_op_name = nullptr;
-
-  bool no_space = true;
-
-  if (::strncmp(name, OPERATOR_PREFIX, OPERATOR_PREFIX_LENGTH))
-return false;
-
-  post_op_name = name + OPERATOR_PREFIX_LENGTH;
-
-  if (post_op_name[0] == ' ') {
-post_op_name++;
-no_space = false;
-  }
-
-#undef OPERATOR_PREFIX
-#undef OPERATOR_PREFIX_LENGTH
-
-  // This is an operator, set the overloaded operator kind to invalid in case
-  // this is a conversion operator...
-  op_kind = clang::NUM_OVERLOADED_OPERATORS;
-
-  switch (post_op_name[0]) {
-  default:
-if (no_space)
-  return false;
-break;
-  case 'n':
-if (no_space)
-  return false;
-if (strcmp(post_op_name, "new") == 0)
-  op_kind = clang::OO_New;
-else if (strcmp(post_op_name, "new[]") == 0)
-  op_kind = clang::OO_Array_New;
-break;
-
-  case 'd':
-if (no_space)
-  return false;
-if (strcmp(post_op_name, "delete") == 0)
-  op_kind = clang::OO_Delete;
-else if (strcmp(post_op_name, "delete[]") == 0)
-  op_kind = clang::OO_Array_Delete;
-break;
-
-  case '+':
-if (post_op_name[1] == '\0')
-  op_kind = clang::OO_Plus;
-else if (post_op_name[2] == '\0') {
-  if (post_op_name[1] == '=')
-op_kind = clang::OO_PlusEqual;
-  else if (post_op_name[1] == '+')
-op_kind = clang::OO_PlusPlus;
-}
-break;
-
-  case '-':
-if (post_op_name[1] == '\0')
-  op_kind = clang::OO_Minus;
-else if (post_op_name[2] == '\0') {
-  switch (post_op_name[1]) {
-  case '=':
-op_kind = clang::OO_MinusEqual;
-break;
-  case '-':
-op_kind = clang::OO_MinusMinus;
-break;
-  case '>':
-op_kind = clang::OO_Arrow;
-break;
-  }
-} else if (post_op_name[3] == '\0') {
-  if (post_op_name[2] == '*')
-op_kind = clang::OO_ArrowStar;
-  break;
-}
-break;
-
-  case '*':
-if (post_op_name[1] == '\0')
-  op_kind = clang::OO_Star;
-else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-  op_kind = clang::OO_StarEqual;
-break;
-
-  case '/':
-if (post_op_name[1] == '\0')
-  op_kind = clang::OO_Slash;
-else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-  op_kind = clang::OO_SlashEqual;
-break;
-
-  case '%':
-if (post_op_name[1] == '\0')
-  op_kind = clang::OO_Percent;
-else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-  op_kind = clang::OO_PercentEqual;
-break;
-
-  case '^':
-if (post_op_name[1] == '\0')
-  op_kind = clang::OO_Caret;
-else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-  op_kind = clang::OO_CaretEqual;
-break;
-
-  case '&':
-if (post_op_name[1] == '\0')
-  op_kind = clang::OO_Amp;
-else if (post_op_name[2] == '\0') {
-  switch (post_op_name[1]) {
-  case '=':
-op_kind = clang::OO_AmpEqual;
-break;
-  case '&':
-op_kind = clang::OO_AmpAmp;
-break;
-  }
-   

[Lldb-commits] [PATCH] D66858: POSIX DYLD: add workaround for android L loader

2019-08-28 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks. I'm going to clean the diff downstream.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66858/new/

https://reviews.llvm.org/D66858



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D65677: [VirtualFileSystem] Support encoding working directories in a VFS mapping.

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D65677#1648506 , @sammccall wrote:

> In D65677#1627576 , @JDevlieghere 
> wrote:
>
> > After some brainstorming I've identified a few other approaches that should 
> > better reflect the transience of the current working directory:
> >
> > - We can modify the VFS to have a notion of //search paths//. The 
> > `adjustPath` function could iterate over the search paths until it finds an 
> > absolute path that exists. If none exist we'd return the same path we 
> > return today. This would be the most general approach.
> > - We could create a new virtual file system that we put on top of the 
> > RedirectingFileSystem which does something similar to what I've described 
> > above. This would require us to override every function that calls 
> > `adjustPath`, so it would be pretty heavyweight and rather inflexible.
> >
> >   I'd like to get your feedback before I start implementing these. What do 
> > you think? Is there another approach that's worth considering?
>
>
> I'm really sorry for missing this comment, I was out sick and missed the 
> email.
>
> > I'd like to get your feedback before I start implementing these.
>
> Honestly, this still seems way too complicated and this doesn't seem like a 
> feature that needs to be part of VFS.


It's funny you say that, because the code to resolve relative paths is almost 
identical to the thing you added for supporting different working directories 
in different threads. :-)

>>   What do you think? Is there another approach that's worth considering?
> 
> Per my previous comment, what goes wrong if you try to make the working 
> directory a sibling of VFS (within the reproducer container) rather than a 
> child of it (within shared infrastructure)?

Oops, seems like I didn't see your question either :-) Please clarify what you 
mean by sibling and child. Do you mean that the working directories are part of 
the mapping or that the redirecting file system knows about it? I don't care 
where we store the entries, I'm happy to have a separate YAML mapping that only 
the LLDB reproducers know about. However, I do need the underlying logic to be 
part of the (redirecting) VFS. Just like clang, LLDB is agnostic to the VFS, so 
this whole thing should be transparent. The only reason I didn't keep them 
separate is because then you need a way to tell the redirecting file system 
about the working directories, which means you need to get the concrete VFS, 
i.e. casting the VFS to a RedirectingVFS, which I try to avoid.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65677/new/

https://reviews.llvm.org/D65677



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66863: [lldb] Unify target checking in CommandObject

2019-08-28 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth added a comment.

I support anything that reduces the code path differences between user-entered 
commands and their SBAPI counterparts.  Thanks for doing this!


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66863/new/

https://reviews.llvm.org/D66863



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D65677: [VirtualFileSystem] Support encoding working directories in a VFS mapping.

2019-08-28 Thread Sam McCall via Phabricator via lldb-commits
sammccall added a comment.

In D65677#1649291 , @JDevlieghere 
wrote:

> In D65677#1648506 , @sammccall wrote:
>
> > In D65677#1627576 , @JDevlieghere 
> > wrote:
> >
> > > After some brainstorming I've identified a few other approaches that 
> > > should better reflect the transience of the current working directory:
> > >
> > > - We can modify the VFS to have a notion of //search paths//. The 
> > > `adjustPath` function could iterate over the search paths until it finds 
> > > an absolute path that exists. If none exist we'd return the same path we 
> > > return today. This would be the most general approach.
> > > - We could create a new virtual file system that we put on top of the 
> > > RedirectingFileSystem which does something similar to what I've described 
> > > above. This would require us to override every function that calls 
> > > `adjustPath`, so it would be pretty heavyweight and rather inflexible.
> > >
> > >   I'd like to get your feedback before I start implementing these. What 
> > > do you think? Is there another approach that's worth considering?
> >
> >
> > I'm really sorry for missing this comment, I was out sick and missed the 
> > email.
> >
> > > I'd like to get your feedback before I start implementing these.
> >
> > Honestly, this still seems way too complicated and this doesn't seem like a 
> > feature that needs to be part of VFS.
>
>
> It's funny you say that, because the code to resolve relative paths is almost 
> identical to the thing you added for supporting different working directories 
> in different threads. :-)


Right! I think the key distinction is that there wasn't any functional change 
to the APIs, because the abstraction didn't change.
(There was a second factory function, which basically lets callers choose 
between the two implementations that have different sets of bugs)

>>>   What do you think? Is there another approach that's worth considering?
>> 
>> Per my previous comment, what goes wrong if you try to make the working 
>> directory a sibling of VFS (within the reproducer container) rather than a 
>> child of it (within shared infrastructure)?
> 
> Oops, seems like I didn't see your question either :-) Please clarify what 
> you mean by sibling and child. Do you mean that the working directories are 
> part of the mapping or that the redirecting file system knows about it? I 
> don't care where we store the entries, I'm happy to have a separate YAML 
> mapping that only the LLDB reproducers know about. However, I do need the 
> underlying logic to be part of the (redirecting) VFS. Just like clang, LLDB 
> is agnostic to the VFS, so this whole thing should be transparent. The only 
> reason I didn't keep them separate is because then you need a way to tell the 
> redirecting file system about the working directories, which means you need 
> to get the concrete VFS, i.e. casting the VFS to a RedirectingVFS, which I 
> try to avoid.

I mean why can't you just call `setCurrentWorkingDirectory` before starting? 
something like this:

  struct Reproducer { string FSYaml; string CWD; ... };
  void run(Reproducer &R) {
auto* FS = RedirectingFileSystem::create(R.FSYaml, ...);
FS->setCurrentWorkingDirectory(R.CWD);
runLLDBWith(FS, ...);
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65677/new/

https://reviews.llvm.org/D65677



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370226 - [dotest] Remove -q (quiet) flag.

2019-08-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 28 09:28:58 2019
New Revision: 370226

URL: http://llvm.org/viewvc/llvm-project?rev=370226&view=rev
Log:
[dotest] Remove -q (quiet) flag.

This patch removes the -q (quiet) flag and changing the default
behavior. Currently the flag serves two purposes that are somewhat
contradictory, as illustrated by the difference between the argument
name (quiet) and the configuration flag (parsable). On the one hand it
reduces output, but on the other hand it prints more output, like the
result of individual tests. My proposal is to guard the extra output
behind the verbose flag and always print the individual test results.

Differential revision: https://reviews.llvm.org/D66837

Modified:
lldb/trunk/docs/resources/test.rst
lldb/trunk/lit/Suite/lit.cfg
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
lldb/trunk/packages/Python/lldbsuite/test/test_result.py
lldb/trunk/utils/lldb-dotest/lldb-dotest.in

Modified: lldb/trunk/docs/resources/test.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/resources/test.rst?rev=370226&r1=370225&r2=370226&view=diff
==
--- lldb/trunk/docs/resources/test.rst (original)
+++ lldb/trunk/docs/resources/test.rst Wed Aug 28 09:28:58 2019
@@ -144,8 +144,6 @@ A quick guide to getting started with PT
 
 ::
 
-   # quiet mode
-   -q
--arch=i686
# Path to debug lldb.exe
--executable D:/src/llvmbuild/ninja/bin/lldb.exe
@@ -163,7 +161,7 @@ A quick guide to getting started with PT
 
 ::
 
-   -q --arch=i686 --executable D:/src/llvmbuild/ninja/bin/lldb.exe -s 
D:/src/llvmbuild/ninja/lldb-test-traces -u CXXFLAGS -u CFLAGS 
--enable-crash-dialog -C d:\src\llvmbuild\ninja_release\bin\clang.exe -p 
TestPaths.py D:\src\llvm\tools\lldb\packages\Python\lldbsuite\test 
--no-multiprocess
+   --arch=i686 --executable D:/src/llvmbuild/ninja/bin/lldb.exe -s 
D:/src/llvmbuild/ninja/lldb-test-traces -u CXXFLAGS -u CFLAGS 
--enable-crash-dialog -C d:\src\llvmbuild\ninja_release\bin\clang.exe -p 
TestPaths.py D:\src\llvm\tools\lldb\packages\Python\lldbsuite\test 
--no-multiprocess
 
 
 

Modified: lldb/trunk/lit/Suite/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lit.cfg?rev=370226&r1=370225&r2=370226&view=diff
==
--- lldb/trunk/lit/Suite/lit.cfg (original)
+++ lldb/trunk/lit/Suite/lit.cfg Wed Aug 28 09:28:58 2019
@@ -56,7 +56,7 @@ if 'DYLD_INSERT_LIBRARIES' in os.environ
   .format(platform.system()))
 
 # Build dotest command.
-dotest_cmd = [config.dotest_path, '-q']
+dotest_cmd = [config.dotest_path]
 dotest_cmd.extend(config.dotest_args_str.split(';'))
 
 # We don't want to force users passing arguments to lit to use `;` as a

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=370226&r1=370225&r2=370226&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Wed Aug 28 
09:28:58 2019
@@ -57,10 +57,6 @@ cflags_extras = ''
 # The filters (testclass.testmethod) used to admit tests into our test suite.
 filters = []
 
-# Parsable mode silences headers, and any other output this script might 
generate, and instead
-# prints machine-readable output similar to what clang tests produce.
-parsable = False
-
 # The regular expression pattern to match against eligible filenames as
 # our test cases.
 regexp = None

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=370226&r1=370225&r2=370226&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Aug 28 09:28:58 2019
@@ -252,7 +252,7 @@ def parseOptionsAndInitTestdirs():
 if args.set_inferior_env_vars:
 lldbtest_config.inferior_env = ' '.join(args.set_inferior_env_vars)
 
-# only print the args if being verbose (and parsable is off)
+# Only print the args if being verbose.
 if args.v and not args.q:
 print(sys.argv)
 
@@ -393,9 +393,6 @@ def parseOptionsAndInitTestdirs():
 usage(parser)
 configuration.regexp = args.p
 
-if args.q:
-configuration.parsable = True
-
 if args.s:
 if args.s.startswith('-'):
 usage(parser)
@@ -1268,7 +1265,7 @@ def run_suite():
 #
 checkCompiler()
 
-if not configuration.parsable:
+if configuration.

[Lldb-commits] [lldb] r370227 - [TestCppOperators] Enable TestCppOperators on Windows.

2019-08-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 28 09:29:00 2019
New Revision: 370227

URL: http://llvm.org/viewvc/llvm-project?rev=370227&view=rev
Log:
[TestCppOperators] Enable TestCppOperators on Windows.

This test is passing on the Windows bot:

Unexpected Passing Tests (1):
lldb-Suite :: lang/cpp/operators/TestCppOperators.py

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/TestCppOperators.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/TestCppOperators.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/TestCppOperators.py?rev=370227&r1=370226&r2=370227&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/TestCppOperators.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/TestCppOperators.py
 Wed Aug 28 09:29:00 2019
@@ -1,5 +1,4 @@
 from lldbsuite.test import lldbinline
 from lldbsuite.test import decorators
 
-lldbinline.MakeInlineTest(__file__, globals(),
-  lldbinline.expectedFailureAll(oslist=["windows"]))
+lldbinline.MakeInlineTest(__file__, globals())


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66837: [dotest] Remove -q (quiet) flag.

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
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 rL370226: [dotest] Remove -q (quiet) flag. (authored by 
JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66837?vs=217514&id=217674#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66837/new/

https://reviews.llvm.org/D66837

Files:
  lldb/trunk/docs/resources/test.rst
  lldb/trunk/lit/Suite/lit.cfg
  lldb/trunk/packages/Python/lldbsuite/test/configuration.py
  lldb/trunk/packages/Python/lldbsuite/test/dotest.py
  lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
  lldb/trunk/packages/Python/lldbsuite/test/test_result.py
  lldb/trunk/utils/lldb-dotest/lldb-dotest.in

Index: lldb/trunk/docs/resources/test.rst
===
--- lldb/trunk/docs/resources/test.rst
+++ lldb/trunk/docs/resources/test.rst
@@ -144,8 +144,6 @@
 
 ::
 
-   # quiet mode
-   -q
--arch=i686
# Path to debug lldb.exe
--executable D:/src/llvmbuild/ninja/bin/lldb.exe
@@ -163,7 +161,7 @@
 
 ::
 
-   -q --arch=i686 --executable D:/src/llvmbuild/ninja/bin/lldb.exe -s D:/src/llvmbuild/ninja/lldb-test-traces -u CXXFLAGS -u CFLAGS --enable-crash-dialog -C d:\src\llvmbuild\ninja_release\bin\clang.exe -p TestPaths.py D:\src\llvm\tools\lldb\packages\Python\lldbsuite\test --no-multiprocess
+   --arch=i686 --executable D:/src/llvmbuild/ninja/bin/lldb.exe -s D:/src/llvmbuild/ninja/lldb-test-traces -u CXXFLAGS -u CFLAGS --enable-crash-dialog -C d:\src\llvmbuild\ninja_release\bin\clang.exe -p TestPaths.py D:\src\llvm\tools\lldb\packages\Python\lldbsuite\test --no-multiprocess
 
 
 
Index: lldb/trunk/lit/Suite/lit.cfg
===
--- lldb/trunk/lit/Suite/lit.cfg
+++ lldb/trunk/lit/Suite/lit.cfg
@@ -56,7 +56,7 @@
   .format(platform.system()))
 
 # Build dotest command.
-dotest_cmd = [config.dotest_path, '-q']
+dotest_cmd = [config.dotest_path]
 dotest_cmd.extend(config.dotest_args_str.split(';'))
 
 # We don't want to force users passing arguments to lit to use `;` as a
Index: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py
@@ -57,10 +57,6 @@
 # The filters (testclass.testmethod) used to admit tests into our test suite.
 filters = []
 
-# Parsable mode silences headers, and any other output this script might generate, and instead
-# prints machine-readable output similar to what clang tests produce.
-parsable = False
-
 # The regular expression pattern to match against eligible filenames as
 # our test cases.
 regexp = None
Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -252,7 +252,7 @@
 if args.set_inferior_env_vars:
 lldbtest_config.inferior_env = ' '.join(args.set_inferior_env_vars)
 
-# only print the args if being verbose (and parsable is off)
+# Only print the args if being verbose.
 if args.v and not args.q:
 print(sys.argv)
 
@@ -393,9 +393,6 @@
 usage(parser)
 configuration.regexp = args.p
 
-if args.q:
-configuration.parsable = True
-
 if args.s:
 if args.s.startswith('-'):
 usage(parser)
@@ -1268,7 +1265,7 @@
 #
 checkCompiler()
 
-if not configuration.parsable:
+if configuration.verbose:
 print("compiler=%s" % configuration.compiler)
 
 # Iterating over all possible architecture and compiler combinations.
@@ -1286,27 +1283,22 @@
 configPostfix = configString.translate(tbl)
 
 # Output the configuration.
-if not configuration.parsable:
+if configuration.verbose:
 sys.stderr.write("\nConfiguration: " + configString + "\n")
 
 # First, write out the number of collected test cases.
-if not configuration.parsable:
+if configuration.verbose:
 sys.stderr.write(configuration.separator + "\n")
 sys.stderr.write(
 "Collected %d test%s\n\n" %
 (configuration.suite.countTestCases(),
  configuration.suite.countTestCases() != 1 and "s" or ""))
 
-if configuration.parsable:
-v = 0
-else:
-v = configuration.verbose
-
 # Invoke the test runner.
 if configuration.count == 1:
 result = unittest2.TextTestRunner(
 stream=sys.stderr,
-verbosity=v,
+verbosity=configuration.verbose,
 resultclass=test_result.LLDBTestResult).run(
  

Re: [Lldb-commits] [lldb] r370199 - [lldb][NFC] Test named operators like new and function names that might confuse LLDB

2019-08-28 Thread Shafik Yaghmour via lldb-commits
This test seems to be missing at least the address-of, delete and the comma 
operator in this test. Probably should cover array delete and new as well.

> On Aug 28, 2019, at 6:33 AM, Raphael Isemann via lldb-commits 
>  wrote:
> 
> Author: teemperor
> Date: Wed Aug 28 06:33:52 2019
> New Revision: 370199
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=370199&view=rev
> Log:
> [lldb][NFC] Test named operators like new and function names that might 
> confuse LLDB
> 
> Modified:
>lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp
> 
> Modified: 
> lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp?rev=370199&r1=370198&r2=370199&view=diff
> ==
> --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp 
> (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/operators/main.cpp Wed 
> Aug 28 06:33:52 2019
> @@ -1,5 +1,10 @@
> +#include 
> +
> struct B { int dummy = 2324; };
> struct C {
> +  void *operator new(size_t size) { C* r = ::new C; r->custom_new = true; 
> return r; }
> +
> +  bool custom_new = false;
>   B b;
>   B* operator->() { return &b; }
>   int operator->*(int) { return 2; }
> @@ -48,6 +53,11 @@ struct C {
> 
>   operator int() { return 11; }
>   operator long() { return 12; }
> +
> +  // Make sure this doesn't collide with
> +  // the real operator int.
> +  int operatorint() { return 13; }
> +  int operatornew() { return 14; }
> };
> 
> int main(int argc, char **argv) {
> @@ -99,6 +109,10 @@ int main(int argc, char **argv) {
> 
>   result += static_cast(c);
>   result += static_cast(c);
> +  result += c.operatorint();
> +  result += c.operatornew();
> +
> +  C *c2 = new C();
> 
>   //% self.expect("expr c->dummy", endstr=" 2324\n")
>   //% self.expect("expr c->*2", endstr=" 2\n")
> @@ -141,5 +155,9 @@ int main(int argc, char **argv) {
>   //% self.expect("expr c[1]", endstr=" 92\n")
>   //% self.expect("expr static_cast(c)", endstr=" 11\n")
>   //% self.expect("expr static_cast(c)", endstr=" 12\n")
> +  //% self.expect("expr c.operatorint()", endstr=" 13\n")
> +  //% self.expect("expr c.operatornew()", endstr=" 14\n")
> +  //% self.expect("expr (new C)->custom_new", endstr=" true\n")
> +  delete c2;
>   return 0;
> }
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66893: [dotest] Don't try to guess the llvm binary dir.

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: davide, jasonmolenda.
Herald added a subscriber: teemperor.
Herald added a project: LLDB.

Now that all supported build systems create a valid `dotest.py` invocation, we 
no longer need to guess the directory where any of the tools live. The current 
logic is also incomplete: it doesn't try to find any other tools than 
FileCheck, such as dsymutil for example. Finally, if no FileCheck is provided, 
we should simply warn and skip these tests, but that's not part of this patch.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66893

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py


Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -295,13 +295,6 @@
 # target. However, when invoking dotest.py directly, a valid 
--filecheck
 # option needs to be given.
 configuration.filecheck = os.path.abspath(args.filecheck)
-else:
-outputPaths = get_llvm_bin_dirs()
-for outputPath in outputPaths:
-candidatePath = os.path.join(outputPath, 'FileCheck')
-if is_exe(candidatePath):
-configuration.filecheck = candidatePath
-break
 
 if not configuration.get_filecheck_path():
 logging.warning('No valid FileCheck executable; some tests may 
fail...')
@@ -552,34 +545,6 @@
 
 return result
 
-def get_llvm_bin_dirs():
-"""
-Returns an array of paths that may have the llvm/clang/etc binaries
-in them, relative to this current file.
-Returns an empty array if none are found.
-"""
-result = []
-
-lldb_root_path = os.path.join(
-os.path.dirname(__file__), "..", "..", "..", "..")
-paths_to_try = [
-"llvm-build/Release+Asserts/x86_64/bin",
-"llvm-build/Debug+Asserts/x86_64/bin",
-"llvm-build/Release/x86_64/bin",
-"llvm-build/Debug/x86_64/bin",
-"llvm-build/Ninja-DebugAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-DebugAssert+asan/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-ReleaseAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-ReleaseAssert+asan/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-RelWithDebInfoAssert+asan/llvm-macosx-x86_64/bin",
-]
-for p in paths_to_try:
-path = os.path.join(lldb_root_path, p)
-if os.path.exists(path):
-result.append(path)
-
-return result
 
 def setupSysPath():
 """


Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -295,13 +295,6 @@
 # target. However, when invoking dotest.py directly, a valid --filecheck
 # option needs to be given.
 configuration.filecheck = os.path.abspath(args.filecheck)
-else:
-outputPaths = get_llvm_bin_dirs()
-for outputPath in outputPaths:
-candidatePath = os.path.join(outputPath, 'FileCheck')
-if is_exe(candidatePath):
-configuration.filecheck = candidatePath
-break
 
 if not configuration.get_filecheck_path():
 logging.warning('No valid FileCheck executable; some tests may fail...')
@@ -552,34 +545,6 @@
 
 return result
 
-def get_llvm_bin_dirs():
-"""
-Returns an array of paths that may have the llvm/clang/etc binaries
-in them, relative to this current file.
-Returns an empty array if none are found.
-"""
-result = []
-
-lldb_root_path = os.path.join(
-os.path.dirname(__file__), "..", "..", "..", "..")
-paths_to_try = [
-"llvm-build/Release+Asserts/x86_64/bin",
-"llvm-build/Debug+Asserts/x86_64/bin",
-"llvm-build/Release/x86_64/bin",
-"llvm-build/Debug/x86_64/bin",
-"llvm-build/Ninja-DebugAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-DebugAssert+asan/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-ReleaseAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-ReleaseAssert+asan/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-RelWithDebInfoAssert+asan/llvm-macosx-x86_64/bin",
-]
-for p in paths_to_try:
-path = os.path.join(lldb_root_path, p)
-if os.path.exists(path):
-result.append(path)
-
-return result
 
 def setupSysPath():
 """
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66893: [dotest] Don't try to guess the llvm binary dir.

2019-08-28 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66893/new/

https://reviews.llvm.org/D66893



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370231 - [dotest] Don't spend time replacing spaces in print output.

2019-08-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 28 10:06:26 2019
New Revision: 370231

URL: http://llvm.org/viewvc/llvm-project?rev=370231&view=rev
Log:
[dotest] Don't spend time replacing spaces in print output.

Replacing all spaces with dashes seems like a lot of needless work for a
string that's just printed.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=370231&r1=370230&r2=370231&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Aug 28 10:06:26 2019
@@ -1274,14 +1274,6 @@ def run_suite():
 configString = "arch=%s compiler=%s" % (configuration.arch,
 configuration.compiler)
 
-# Translate ' ' to '-' for pathname component.
-if six.PY2:
-import string
-tbl = string.maketrans(' ', '-')
-else:
-tbl = str.maketrans(' ', '-')
-configPostfix = configString.translate(tbl)
-
 # Output the configuration.
 if configuration.verbose:
 sys.stderr.write("\nConfiguration: " + configString + "\n")


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370232 - [dotest] Don't try to guess the llvm binary dir.

2019-08-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 28 10:06:28 2019
New Revision: 370232

URL: http://llvm.org/viewvc/llvm-project?rev=370232&view=rev
Log:
[dotest] Don't try to guess the llvm binary dir.

Now that all supported build systems create a valid dotest.py
invocation, we no longer need to guess the directory where any of the
llvm tools live. Additionally, the current logic is incomplete: it
doesn't try to find any other tools than FileCheck, such as dsymutil for
example.

If no FileCheck is provided, we should print a warning and skip the
tests that need it, but that's not part of this patch.

Differential revision: https://reviews.llvm.org/D66893

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=370232&r1=370231&r2=370232&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Aug 28 10:06:28 2019
@@ -295,13 +295,6 @@ def parseOptionsAndInitTestdirs():
 # target. However, when invoking dotest.py directly, a valid 
--filecheck
 # option needs to be given.
 configuration.filecheck = os.path.abspath(args.filecheck)
-else:
-outputPaths = get_llvm_bin_dirs()
-for outputPath in outputPaths:
-candidatePath = os.path.join(outputPath, 'FileCheck')
-if is_exe(candidatePath):
-configuration.filecheck = candidatePath
-break
 
 if not configuration.get_filecheck_path():
 logging.warning('No valid FileCheck executable; some tests may 
fail...')
@@ -552,34 +545,6 @@ def getOutputPaths(lldbRootDirectory):
 
 return result
 
-def get_llvm_bin_dirs():
-"""
-Returns an array of paths that may have the llvm/clang/etc binaries
-in them, relative to this current file.
-Returns an empty array if none are found.
-"""
-result = []
-
-lldb_root_path = os.path.join(
-os.path.dirname(__file__), "..", "..", "..", "..")
-paths_to_try = [
-"llvm-build/Release+Asserts/x86_64/bin",
-"llvm-build/Debug+Asserts/x86_64/bin",
-"llvm-build/Release/x86_64/bin",
-"llvm-build/Debug/x86_64/bin",
-"llvm-build/Ninja-DebugAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-DebugAssert+asan/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-ReleaseAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-ReleaseAssert+asan/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-RelWithDebInfoAssert+asan/llvm-macosx-x86_64/bin",
-]
-for p in paths_to_try:
-path = os.path.join(lldb_root_path, p)
-if os.path.exists(path):
-result.append(path)
-
-return result
 
 def setupSysPath():
 """


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66863: [lldb] Unify target checking in CommandObject

2019-08-28 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.
Herald added a subscriber: JDevlieghere.

The whole command flags was a late addition, but we were using it for new 
commands and "when you touch it" kind of changes.  That seems to have stalled 
the conversion, so thanks for completing this!

As a minor style thing, prior to this change CommandObjectThreadStepUntil 
required a thread, but didn't require a process explicitly, because you can't 
have a thread without a process.  You also can't have a thread without a target 
since you can't have a process without a target.  But your change means that if 
I specify that I require a thread I now ALSO have to require a target 
explicitly or I will get an assert calling GetSelectedTarget.  That seems a 
little awkward to me (especially since you still don't have to require a 
process...)  It would be better if eCommandRequiresThread implied 
eCommandRequiresProcess & eCommandRequiresTarget.  That would keep these 
definitions less noisy.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66863/new/

https://reviews.llvm.org/D66863



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66893: [dotest] Don't try to guess the llvm binary dir.

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370232: [dotest] Don't try to guess the llvm binary 
dir. (authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66893?vs=217677&id=217680#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66893/new/

https://reviews.llvm.org/D66893

Files:
  lldb/trunk/packages/Python/lldbsuite/test/dotest.py


Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -295,13 +295,6 @@
 # target. However, when invoking dotest.py directly, a valid 
--filecheck
 # option needs to be given.
 configuration.filecheck = os.path.abspath(args.filecheck)
-else:
-outputPaths = get_llvm_bin_dirs()
-for outputPath in outputPaths:
-candidatePath = os.path.join(outputPath, 'FileCheck')
-if is_exe(candidatePath):
-configuration.filecheck = candidatePath
-break
 
 if not configuration.get_filecheck_path():
 logging.warning('No valid FileCheck executable; some tests may 
fail...')
@@ -552,34 +545,6 @@
 
 return result
 
-def get_llvm_bin_dirs():
-"""
-Returns an array of paths that may have the llvm/clang/etc binaries
-in them, relative to this current file.
-Returns an empty array if none are found.
-"""
-result = []
-
-lldb_root_path = os.path.join(
-os.path.dirname(__file__), "..", "..", "..", "..")
-paths_to_try = [
-"llvm-build/Release+Asserts/x86_64/bin",
-"llvm-build/Debug+Asserts/x86_64/bin",
-"llvm-build/Release/x86_64/bin",
-"llvm-build/Debug/x86_64/bin",
-"llvm-build/Ninja-DebugAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-DebugAssert+asan/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-ReleaseAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-ReleaseAssert+asan/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-RelWithDebInfoAssert+asan/llvm-macosx-x86_64/bin",
-]
-for p in paths_to_try:
-path = os.path.join(lldb_root_path, p)
-if os.path.exists(path):
-result.append(path)
-
-return result
 
 def setupSysPath():
 """


Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -295,13 +295,6 @@
 # target. However, when invoking dotest.py directly, a valid --filecheck
 # option needs to be given.
 configuration.filecheck = os.path.abspath(args.filecheck)
-else:
-outputPaths = get_llvm_bin_dirs()
-for outputPath in outputPaths:
-candidatePath = os.path.join(outputPath, 'FileCheck')
-if is_exe(candidatePath):
-configuration.filecheck = candidatePath
-break
 
 if not configuration.get_filecheck_path():
 logging.warning('No valid FileCheck executable; some tests may fail...')
@@ -552,34 +545,6 @@
 
 return result
 
-def get_llvm_bin_dirs():
-"""
-Returns an array of paths that may have the llvm/clang/etc binaries
-in them, relative to this current file.
-Returns an empty array if none are found.
-"""
-result = []
-
-lldb_root_path = os.path.join(
-os.path.dirname(__file__), "..", "..", "..", "..")
-paths_to_try = [
-"llvm-build/Release+Asserts/x86_64/bin",
-"llvm-build/Debug+Asserts/x86_64/bin",
-"llvm-build/Release/x86_64/bin",
-"llvm-build/Debug/x86_64/bin",
-"llvm-build/Ninja-DebugAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-DebugAssert+asan/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-ReleaseAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-ReleaseAssert+asan/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/bin",
-"llvm-build/Ninja-RelWithDebInfoAssert+asan/llvm-macosx-x86_64/bin",
-]
-for p in paths_to_try:
-path = os.path.join(lldb_root_path, p)
-if os.path.exists(path):
-result.append(path)
-
-return result
 
 def setupSysPath():
 """
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66896: [dotest] Don't try to guess the lldb binary & python dir.

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: davide, jasonmolenda.
Herald added a subscriber: teemperor.
Herald added a project: LLDB.

Now that all supported build systems create a valid dotest.py
invocation, we no longer need to guess the location of the 
lldb binary and Python directory.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66896

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py

Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -467,28 +467,6 @@
 lldbtest_config.codesign_identity = args.codesign_identity
 
 
-def getXcodeOutputPaths(lldbRootDirectory):
-result = []
-
-# These are for xcode build directories.
-xcode3_build_dir = ['build']
-xcode4_build_dir = ['build', 'lldb', 'Build', 'Products']
-
-configurations = [
-['Debug'],
-['DebugClang'],
-['Release'],
-['BuildAndIntegration']]
-xcode_build_dirs = [xcode3_build_dir, xcode4_build_dir]
-for configuration in configurations:
-for xcode_build_dir in xcode_build_dirs:
-outputPath = os.path.join(
-lldbRootDirectory, *(xcode_build_dir + configuration))
-result.append(outputPath)
-
-return result
-
-
 def setupTestResults():
 """Sets up test results-related objects based on arg settings."""
 # Setup the results formatter configuration.
@@ -515,37 +493,6 @@
 atexit.register(formatter_spec.cleanup_func)
 
 
-def getOutputPaths(lldbRootDirectory):
-"""
-Returns typical build output paths for the lldb executable
-
-lldbDirectory - path to the root of the lldb svn/git repo
-"""
-result = []
-
-if sys.platform == 'darwin':
-result.extend(getXcodeOutputPaths(lldbRootDirectory))
-
-# cmake builds?  look for build or build/host folder next to llvm directory
-# lldb is located in llvm/tools/lldb so we need to go up three levels
-llvmParentDir = os.path.abspath(
-os.path.join(
-lldbRootDirectory,
-os.pardir,
-os.pardir,
-os.pardir))
-result.append(os.path.join(llvmParentDir, 'build', 'bin'))
-result.append(os.path.join(llvmParentDir, 'build', 'host', 'bin'))
-
-# some cmake developers keep their build directory beside their lldb
-# directory
-lldbParentDir = os.path.abspath(os.path.join(lldbRootDirectory, os.pardir))
-result.append(os.path.join(lldbParentDir, 'build', 'bin'))
-result.append(os.path.join(lldbParentDir, 'build', 'host', 'bin'))
-
-return result
-
-
 def setupSysPath():
 """
 Add LLDB.framework/Resources/Python to the search paths for modules.
@@ -603,14 +550,6 @@
 if "LLDB_EXEC" in os.environ:
 lldbtest_config.lldbExec = os.environ["LLDB_EXEC"]
 
-if not lldbtest_config.lldbExec:
-outputPaths = getOutputPaths(lldbRootDirectory)
-for outputPath in outputPaths:
-candidatePath = os.path.join(outputPath, 'lldb')
-if is_exe(candidatePath):
-lldbtest_config.lldbExec = candidatePath
-break
-
 if not lldbtest_config.lldbExec:
 # Last, check the path
 lldbtest_config.lldbExec = which('lldb')
@@ -696,39 +635,23 @@
 lldbPythonDir, '..', '..')
 
 if not lldbPythonDir:
-if platform.system() == "Darwin":
-python_resource_dir = ['LLDB.framework', 'Resources', 'Python']
-outputPaths = getXcodeOutputPaths(lldbRootDirectory)
-for outputPath in outputPaths:
-candidatePath = os.path.join(
-outputPath, *python_resource_dir)
-if os.path.isfile(
-os.path.join(
-candidatePath,
-init_in_python_dir)):
-lldbPythonDir = candidatePath
-break
-
-if not lldbPythonDir:
-print("lldb.py is not found, some tests may fail.")
-else:
-print(
-"Unable to load lldb extension module.  Possible reasons for this include:")
-print("  1) LLDB was built with LLDB_DISABLE_PYTHON=1")
-print(
-"  2) PYTHONPATH and PYTHONHOME are not set correctly.  PYTHONHOME should refer to")
-print(
-" the version of Python that LLDB built and linked against, and PYTHONPATH")
-print(
-" should contain the Lib directory for the same python distro, as well as the")
-print(" location of LLDB\'s site-packages folder.")
-print(
-"  3) A different version of Python than that 

[Lldb-commits] [PATCH] D66858: POSIX DYLD: add workaround for android L loader

2019-08-28 Thread Alex Langford via Phabricator via lldb-commits
xiaobai accepted this revision.
xiaobai added a comment.
Herald added a subscriber: JDevlieghere.

LGTM, small typo tho




Comment at: source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp:553
+  // reported.  Attempt to discover it based on the load address of the object
+  // file.
+  if (entry.base_addr == 0) {

`lirbary` -> `library`


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66858/new/

https://reviews.llvm.org/D66858



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370234 - [dotest] Don't try to guess the lldb binary & python dir.

2019-08-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 28 10:38:48 2019
New Revision: 370234

URL: http://llvm.org/viewvc/llvm-project?rev=370234&view=rev
Log:
[dotest] Don't try to guess the lldb binary & python dir.

Now that all supported build systems create a valid dotest.py
invocation, we no longer need to guess the location of the lldb binary
and Python directory.

Differential revision: https://reviews.llvm.org/D66896

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=370234&r1=370233&r2=370234&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Aug 28 10:38:48 2019
@@ -467,28 +467,6 @@ def parseOptionsAndInitTestdirs():
 lldbtest_config.codesign_identity = args.codesign_identity
 
 
-def getXcodeOutputPaths(lldbRootDirectory):
-result = []
-
-# These are for xcode build directories.
-xcode3_build_dir = ['build']
-xcode4_build_dir = ['build', 'lldb', 'Build', 'Products']
-
-configurations = [
-['Debug'],
-['DebugClang'],
-['Release'],
-['BuildAndIntegration']]
-xcode_build_dirs = [xcode3_build_dir, xcode4_build_dir]
-for configuration in configurations:
-for xcode_build_dir in xcode_build_dirs:
-outputPath = os.path.join(
-lldbRootDirectory, *(xcode_build_dir + configuration))
-result.append(outputPath)
-
-return result
-
-
 def setupTestResults():
 """Sets up test results-related objects based on arg settings."""
 # Setup the results formatter configuration.
@@ -515,37 +493,6 @@ def setupTestResults():
 atexit.register(formatter_spec.cleanup_func)
 
 
-def getOutputPaths(lldbRootDirectory):
-"""
-Returns typical build output paths for the lldb executable
-
-lldbDirectory - path to the root of the lldb svn/git repo
-"""
-result = []
-
-if sys.platform == 'darwin':
-result.extend(getXcodeOutputPaths(lldbRootDirectory))
-
-# cmake builds?  look for build or build/host folder next to llvm directory
-# lldb is located in llvm/tools/lldb so we need to go up three levels
-llvmParentDir = os.path.abspath(
-os.path.join(
-lldbRootDirectory,
-os.pardir,
-os.pardir,
-os.pardir))
-result.append(os.path.join(llvmParentDir, 'build', 'bin'))
-result.append(os.path.join(llvmParentDir, 'build', 'host', 'bin'))
-
-# some cmake developers keep their build directory beside their lldb
-# directory
-lldbParentDir = os.path.abspath(os.path.join(lldbRootDirectory, os.pardir))
-result.append(os.path.join(lldbParentDir, 'build', 'bin'))
-result.append(os.path.join(lldbParentDir, 'build', 'host', 'bin'))
-
-return result
-
-
 def setupSysPath():
 """
 Add LLDB.framework/Resources/Python to the search paths for modules.
@@ -604,14 +551,6 @@ def setupSysPath():
 lldbtest_config.lldbExec = os.environ["LLDB_EXEC"]
 
 if not lldbtest_config.lldbExec:
-outputPaths = getOutputPaths(lldbRootDirectory)
-for outputPath in outputPaths:
-candidatePath = os.path.join(outputPath, 'lldb')
-if is_exe(candidatePath):
-lldbtest_config.lldbExec = candidatePath
-break
-
-if not lldbtest_config.lldbExec:
 # Last, check the path
 lldbtest_config.lldbExec = which('lldb')
 
@@ -696,39 +635,23 @@ def setupSysPath():
 lldbPythonDir, '..', '..')
 
 if not lldbPythonDir:
-if platform.system() == "Darwin":
-python_resource_dir = ['LLDB.framework', 'Resources', 'Python']
-outputPaths = getXcodeOutputPaths(lldbRootDirectory)
-for outputPath in outputPaths:
-candidatePath = os.path.join(
-outputPath, *python_resource_dir)
-if os.path.isfile(
-os.path.join(
-candidatePath,
-init_in_python_dir)):
-lldbPythonDir = candidatePath
-break
-
-if not lldbPythonDir:
-print("lldb.py is not found, some tests may fail.")
-else:
-print(
-"Unable to load lldb extension module.  Possible reasons 
for this include:")
-print("  1) LLDB was built with LLDB_DISABLE_PYTHON=1")
-print(
-"  2) PYTHONPATH and PYTHONHOME are not set correctly.  
PYTHONHOME should refer to")
-print(
-" the version of Python that LLDB built and linked 
aga

[Lldb-commits] [lldb] r370235 - [dotest] Remove outdates TODO

2019-08-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 28 10:38:50 2019
New Revision: 370235

URL: http://llvm.org/viewvc/llvm-project?rev=370235&view=rev
Log:
[dotest] Remove outdates TODO

The referenced function `find_test_files_in_dir_tree` no longer exists.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=370235&r1=370234&r2=370235&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Aug 28 10:38:50 2019
@@ -730,7 +730,6 @@ def visit_file(dir, name):
 unittest2.defaultTestLoader.loadTestsFromName(base))
 
 
-# TODO: This should be replaced with a call to find_test_files_in_dir_tree.
 def visit(prefix, dir, names):
 """Visitor function for os.path.walk(path, visit, arg)."""
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66896: [dotest] Don't try to guess the lldb binary & python dir.

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370234: [dotest] Don't try to guess the lldb binary 
& python dir. (authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66896?vs=217681&id=217683#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66896/new/

https://reviews.llvm.org/D66896

Files:
  lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -467,28 +467,6 @@
 lldbtest_config.codesign_identity = args.codesign_identity
 
 
-def getXcodeOutputPaths(lldbRootDirectory):
-result = []
-
-# These are for xcode build directories.
-xcode3_build_dir = ['build']
-xcode4_build_dir = ['build', 'lldb', 'Build', 'Products']
-
-configurations = [
-['Debug'],
-['DebugClang'],
-['Release'],
-['BuildAndIntegration']]
-xcode_build_dirs = [xcode3_build_dir, xcode4_build_dir]
-for configuration in configurations:
-for xcode_build_dir in xcode_build_dirs:
-outputPath = os.path.join(
-lldbRootDirectory, *(xcode_build_dir + configuration))
-result.append(outputPath)
-
-return result
-
-
 def setupTestResults():
 """Sets up test results-related objects based on arg settings."""
 # Setup the results formatter configuration.
@@ -515,37 +493,6 @@
 atexit.register(formatter_spec.cleanup_func)
 
 
-def getOutputPaths(lldbRootDirectory):
-"""
-Returns typical build output paths for the lldb executable
-
-lldbDirectory - path to the root of the lldb svn/git repo
-"""
-result = []
-
-if sys.platform == 'darwin':
-result.extend(getXcodeOutputPaths(lldbRootDirectory))
-
-# cmake builds?  look for build or build/host folder next to llvm directory
-# lldb is located in llvm/tools/lldb so we need to go up three levels
-llvmParentDir = os.path.abspath(
-os.path.join(
-lldbRootDirectory,
-os.pardir,
-os.pardir,
-os.pardir))
-result.append(os.path.join(llvmParentDir, 'build', 'bin'))
-result.append(os.path.join(llvmParentDir, 'build', 'host', 'bin'))
-
-# some cmake developers keep their build directory beside their lldb
-# directory
-lldbParentDir = os.path.abspath(os.path.join(lldbRootDirectory, os.pardir))
-result.append(os.path.join(lldbParentDir, 'build', 'bin'))
-result.append(os.path.join(lldbParentDir, 'build', 'host', 'bin'))
-
-return result
-
-
 def setupSysPath():
 """
 Add LLDB.framework/Resources/Python to the search paths for modules.
@@ -604,14 +551,6 @@
 lldbtest_config.lldbExec = os.environ["LLDB_EXEC"]
 
 if not lldbtest_config.lldbExec:
-outputPaths = getOutputPaths(lldbRootDirectory)
-for outputPath in outputPaths:
-candidatePath = os.path.join(outputPath, 'lldb')
-if is_exe(candidatePath):
-lldbtest_config.lldbExec = candidatePath
-break
-
-if not lldbtest_config.lldbExec:
 # Last, check the path
 lldbtest_config.lldbExec = which('lldb')
 
@@ -696,39 +635,23 @@
 lldbPythonDir, '..', '..')
 
 if not lldbPythonDir:
-if platform.system() == "Darwin":
-python_resource_dir = ['LLDB.framework', 'Resources', 'Python']
-outputPaths = getXcodeOutputPaths(lldbRootDirectory)
-for outputPath in outputPaths:
-candidatePath = os.path.join(
-outputPath, *python_resource_dir)
-if os.path.isfile(
-os.path.join(
-candidatePath,
-init_in_python_dir)):
-lldbPythonDir = candidatePath
-break
-
-if not lldbPythonDir:
-print("lldb.py is not found, some tests may fail.")
-else:
-print(
-"Unable to load lldb extension module.  Possible reasons for this include:")
-print("  1) LLDB was built with LLDB_DISABLE_PYTHON=1")
-print(
-"  2) PYTHONPATH and PYTHONHOME are not set correctly.  PYTHONHOME should refer to")
-print(
-" the version of Python that LLDB built and linked against, and PYTHONPATH")
-print(
-" should contain the Lib directory for the same python distro, as well as the")
-print(" location of LLDB\'s site-packages folder.

[Lldb-commits] [lldb] r370237 - [test] Temporarily disable two tests on Windows

2019-08-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 28 11:04:14 2019
New Revision: 370237

URL: http://llvm.org/viewvc/llvm-project?rev=370237&view=rev
Log:
[test] Temporarily disable two tests on Windows

Disable the two failing tests until Raphael has a chance to investigate:

Failing Tests (2):
lldb-Suite :: functionalities/completion/TestCompletion.py
lldb-Suite :: functionalities/target_command/TestTargetCommand.py

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py?rev=370237&r1=370236&r2=370237&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 Wed Aug 28 11:04:14 2019
@@ -144,6 +144,7 @@ class CommandLineCompletionTestCase(Test
 self.complete_from_to('log enable lldb expr -f ' + src_dir,
   ['main.cpp'])
 
+@skipIfWindows
 @skipIfFreeBSD  # timing out on the FreeBSD buildbot
 def test_log_dir(self):
 # Complete our source directory.

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py?rev=370237&r1=370236&r2=370237&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
 Wed Aug 28 11:04:14 2019
@@ -341,6 +341,7 @@ class targetCommandTestCase(TestBase):
 self.expect("target create -s doesntexist doesntexisteither", 
error=True,
 substrs=["invalid symbol file path 'doesntexist'"])
 
+@skipIfWindows
 @no_debug_info_test
 def test_target_create_invalid_core_file(self):
 invalid_core_path = os.path.join(self.getSourceDir(), 
"invalid_core_file")


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66858: POSIX DYLD: add workaround for android L loader

2019-08-28 Thread Pavel Labath via Phabricator via lldb-commits
labath requested changes to this revision.
labath added a comment.
This revision now requires changes to proceed.

It looks like this code would be better placed inside 
`UpdateBaseAddrIfNecessary`, as that's exactly what it is doing.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66858/new/

https://reviews.llvm.org/D66858



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66858: POSIX DYLD: add workaround for android L loader

2019-08-28 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

My other concerns about this patch are:

- the base_addr field is the *difference* between the preferred load address 
encoded in the object file, and the actual load address. This means that this 
workaround will fire every time the object is loaded at it's preferred load 
address, which is definitely not what this patch advertises to do...
- it looks like it should be possible to test this using the "gdb-client" test 
suite. I am hoping that it all it would take is to mock the appropriate 
responses to the `qXfer:libraries` and `qFileLoadAddress` packets. We should at 
least try to do that...
- just because this patch was fast-tracked into the swift fork of lldb without 
proper scrutiny (it seems), it does not mean it should be fast-tracked here (in 
fact, I would say the opposite is true...)


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66858/new/

https://reviews.llvm.org/D66858



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66896: [dotest] Don't try to guess the lldb binary & python dir.

2019-08-28 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Woohoo


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66896/new/

https://reviews.llvm.org/D66896



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66863: [lldb] Unify target checking in CommandObject

2019-08-28 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Awesome.

In D66863#1649436 , @jingham wrote:

> As a minor style thing, prior to this change CommandObjectThreadStepUntil 
> required a thread, but didn't require a process explicitly, because you can't 
> have a thread without a process.  You also can't have a thread without a 
> target since you can't have a process without a target.  But your change 
> means that if I specify that I require a thread I now ALSO have to require a 
> target explicitly or I will get an assert calling GetSelectedTarget.  That 
> seems a little awkward to me (especially since you still don't have to 
> require a process...)  It would be better if eCommandRequiresThread implied 
> eCommandRequiresProcess & eCommandRequiresTarget.  That would keep these 
> definitions less noisy.


This sounds like a good idea to me.




Comment at: lldb/source/Commands/CommandObjectTarget.cpp:2615-2617
+"Set the load addresses for "
+"one or more sections in a "
+"target module.",

Another quirk of clang-format is that it will not re-merge strings that it has 
split previously. If you manually join these three strings into one, and then 
re-run clang-format, you'll probably end up with something slightly nicer...


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66863/new/

https://reviews.llvm.org/D66863



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D65677: [VirtualFileSystem] Support encoding working directories in a VFS mapping.

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D65677#1649329 , @sammccall wrote:

> In D65677#1649291 , @JDevlieghere 
> wrote:
>
> > It's funny you say that, because the code to resolve relative paths is 
> > almost identical to the thing you added for supporting different working 
> > directories in different threads. :-)
>
>
> Right! I think the key distinction is that there wasn't any functional change 
> to the APIs, because the abstraction didn't change.
>  (There was a second factory function, which basically lets callers choose 
> between the two implementations that have different sets of bugs)
>
> >>>   What do you think? Is there another approach that's worth considering?
> >> 
> >> Per my previous comment, what goes wrong if you try to make the working 
> >> directory a sibling of VFS (within the reproducer container) rather than a 
> >> child of it (within shared infrastructure)?
> > 
> > Oops, seems like I didn't see your question either :-) Please clarify what 
> > you mean by sibling and child. Do you mean that the working directories are 
> > part of the mapping or that the redirecting file system knows about it? I 
> > don't care where we store the entries, I'm happy to have a separate YAML 
> > mapping that only the LLDB reproducers know about. However, I do need the 
> > underlying logic to be part of the (redirecting) VFS. Just like clang, LLDB 
> > is agnostic to the VFS, so this whole thing should be transparent. The only 
> > reason I didn't keep them separate is because then you need a way to tell 
> > the redirecting file system about the working directories, which means you 
> > need to get the concrete VFS, i.e. casting the VFS to a RedirectingVFS, 
> > which I try to avoid.
>
> I mean why can't you just call `setCurrentWorkingDirectory` before starting? 
> something like this:
>
>   struct Reproducer { string FSYaml; string CWD; ... };
>   void run(Reproducer &R) {
> auto* FS = RedirectingFileSystem::create(R.FSYaml, ...);
> FS->setCurrentWorkingDirectory(R.CWD);
> runLLDBWith(FS, ...);
>   }
>  
>


That doesn't work for the reproducer because the working directory likely 
doesn't exist during replay. The redirecting file system just forwards the 
`setCurrentWorkingDirectory` call to it's underlying (real) FS, so this becomes 
a no-op.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65677/new/

https://reviews.llvm.org/D65677



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370255 - [Core] Use GetAPInt instead of constructing APInts in place

2019-08-28 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Wed Aug 28 13:15:57 2019
New Revision: 370255

URL: http://llvm.org/viewvc/llvm-project?rev=370255&view=rev
Log:
[Core] Use GetAPInt instead of constructing APInts in place

GetAPInt should be able to handle all cases. I have plans to generalize
the float dumping logic and this makes it easier to do later.

Modified:
lldb/trunk/source/Core/DumpDataExtractor.cpp

Modified: lldb/trunk/source/Core/DumpDataExtractor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DumpDataExtractor.cpp?rev=370255&r1=370254&r2=370255&view=diff
==
--- lldb/trunk/source/Core/DumpDataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DumpDataExtractor.cpp Wed Aug 28 13:15:57 2019
@@ -567,11 +567,13 @@ lldb::offset_t lldb_private::DumpDataExt
 size_t item_bit_size = item_byte_size * 8;
 
 if (item_bit_size == ast->getTypeSize(ast->FloatTy)) {
-  llvm::APInt apint(item_bit_size,
-DE.GetMaxU64(&offset, item_byte_size));
-  llvm::APFloat apfloat(ast->getFloatTypeSemantics(ast->FloatTy),
-apint);
-  apfloat.toString(sv, format_precision, format_max_padding);
+  llvm::Optional apint =
+  GetAPInt(DE, &offset, item_byte_size);
+  if (apint.hasValue()) {
+llvm::APFloat apfloat(ast->getFloatTypeSemantics(ast->FloatTy),
+  apint.getValue());
+apfloat.toString(sv, format_precision, format_max_padding);
+  }
 } else if (item_bit_size == ast->getTypeSize(ast->DoubleTy)) {
   llvm::Optional apint =
   GetAPInt(DE, &offset, item_byte_size);
@@ -595,10 +597,13 @@ lldb::offset_t lldb_private::DumpDataExt
 apfloat.toString(sv, format_precision, format_max_padding);
   }
 } else if (item_bit_size == ast->getTypeSize(ast->HalfTy)) {
-  llvm::APInt apint(item_bit_size, DE.GetU16(&offset));
-  llvm::APFloat apfloat(ast->getFloatTypeSemantics(ast->HalfTy),
-apint);
-  apfloat.toString(sv, format_precision, format_max_padding);
+  llvm::Optional apint =
+  GetAPInt(DE, &offset, item_byte_size);
+  if (apint.hasValue()) {
+llvm::APFloat apfloat(ast->getFloatTypeSemantics(ast->HalfTy),
+  apint.getValue());
+apfloat.toString(sv, format_precision, format_max_padding);
+  }
 }
 
 if (!sv.empty()) {


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370259 - [dotest] Centralize and simplify session dir logic (NFC)

2019-08-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 28 13:54:17 2019
New Revision: 370259

URL: http://llvm.org/viewvc/llvm-project?rev=370259&view=rev
Log:
[dotest] Centralize and simplify session dir logic (NFC)

I was looking at the session directory logic for unrelated reasons and
noticed that the logic spread out across dotest. This simplifies things
a bit by moving the logic together.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=370259&r1=370258&r2=370259&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Aug 28 13:54:17 2019
@@ -23,9 +23,10 @@ from __future__ import print_function
 
 # System modules
 import atexit
-import os
+import datetime
 import errno
 import logging
+import os
 import platform
 import re
 import signal
@@ -387,9 +388,11 @@ def parseOptionsAndInitTestdirs():
 configuration.regexp = args.p
 
 if args.s:
-if args.s.startswith('-'):
-usage(parser)
 configuration.sdir_name = args.s
+else:
+timestamp_started = 
datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S")
+configuration.sdir_name = os.path.join(os.getcwd(), timestamp_started)
+
 configuration.session_file_format = args.session_file_format
 
 if args.t:
@@ -1019,6 +1022,9 @@ def run_suite():
 # lldb.SBDebugger.Initialize()/Terminate() pair.
 import lldb
 
+# Now we can also import lldbutil
+from lldbsuite.test import lldbutil
+
 # Create a singleton SBDebugger in the lldb namespace.
 lldb.DBG = lldb.SBDebugger.Create()
 
@@ -1078,7 +1084,6 @@ def run_suite():
 
 # Set up the working directory.
 # Note that it's not dotest's job to clean this directory.
-import lldbsuite.test.lldbutil as lldbutil
 build_dir = configuration.test_build_dir
 lldbutil.mkdir_p(build_dir)
 
@@ -1120,19 +1125,8 @@ def run_suite():
 # Install the control-c handler.
 unittest2.signals.installHandler()
 
-# If sdir_name is not specified through the '-s sdir_name' option, get a
-# timestamp string and export it as LLDB_SESSION_DIR environment var.  
This will
-# be used when/if we want to dump the session info of individual test cases
-# later on.
-#
-# See also TestBase.dumpSessionInfo() in lldbtest.py.
-import datetime
-# The windows platforms don't like ':' in the pathname.
-timestamp_started = datetime.datetime.now().strftime("%Y-%m-%d-%H_%M_%S")
-if not configuration.sdir_name:
-configuration.sdir_name = timestamp_started
-os.environ["LLDB_SESSION_DIRNAME"] = os.path.join(
-os.getcwd(), configuration.sdir_name)
+lldbutil.mkdir_p(configuration.sdir_name)
+os.environ["LLDB_SESSION_DIRNAME"] = configuration.sdir_name
 
 sys.stderr.write(
 "\nSession logs for test failures/errors/unexpected successes"
@@ -1140,13 +1134,6 @@ def run_suite():
 configuration.sdir_name)
 sys.stderr.write("Command invoked: %s\n" % getMyCommandLine())
 
-if not os.path.isdir(configuration.sdir_name):
-try:
-os.mkdir(configuration.sdir_name)
-except OSError as exception:
-if exception.errno != errno.EEXIST:
-raise
-
 #
 # Invoke the default TextTestRunner to run the test suite
 #


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66841: Skip test_target_create_invalid_core_file on Windows

2019-08-28 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth abandoned this revision.
amccarth added a comment.

Somebody else already did this while I was waiting for review.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66841/new/

https://reviews.llvm.org/D66841



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370264 - [dotest] Remove --rerun-max-file-threshold

2019-08-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 28 14:24:41 2019
New Revision: 370264

URL: http://llvm.org/viewvc/llvm-project?rev=370264&view=rev
Log:
[dotest] Remove --rerun-max-file-threshold

This variable corresponding to this argument is set but never read.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/configuration.py
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.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=370264&r1=370263&r2=370264&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Wed Aug 28 
14:24:41 2019
@@ -120,7 +120,6 @@ test_result = None
 
 # Test rerun configuration vars
 rerun_all_issues = False
-rerun_max_file_threhold = 0
 
 # The names of all tests. Used to assert we don't have two tests with the
 # same base name.

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=370264&r1=370263&r2=370264&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Aug 28 14:24:41 2019
@@ -434,7 +434,6 @@ def parseOptionsAndInitTestdirs():
 
 # rerun-related arguments
 configuration.rerun_all_issues = args.rerun_all_issues
-configuration.rerun_max_file_threshold = args.rerun_max_file_threshold
 
 if args.lldb_platform_name:
 configuration.lldb_platform_name = args.lldb_platform_name

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=370264&r1=370263&r2=370264&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Wed Aug 28 
14:24:41 2019
@@ -260,15 +260,6 @@ def create_parser():
   'irrespective of the test method\'s marking as flakey. '
   'Default behavior is to apply re-runs only to flakey '
   'tests that generate issues.'))
-group.add_argument(
-'--rerun-max-file-threshold',
-action='store',
-type=int,
-default=50,
-help=('Maximum number of files requiring a rerun beyond '
-  'which the rerun will not occur.  This is meant to '
-  'stop a catastrophically failing test suite from forcing '
-  'all tests to be rerun in the single-worker phase.'))
 
 # Remove the reference to our helper function
 del X


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r370266 - [dotest] Remove --event-add-entries

2019-08-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 28 14:31:53 2019
New Revision: 370266

URL: http://llvm.org/viewvc/llvm-project?rev=370266&view=rev
Log:
[dotest] Remove --event-add-entries

This argument was used by dosep.py to pass information around from the
workers. With dosep.py gone, I'm fairly sure we don't need this any
longer.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=370266&r1=370265&r2=370266&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Aug 28 14:31:53 2019
@@ -444,24 +444,6 @@ def parseOptionsAndInitTestdirs():
 if args.test_build_dir:
 configuration.test_build_dir = args.test_build_dir
 
-if args.event_add_entries and len(args.event_add_entries) > 0:
-entries = {}
-# Parse out key=val pairs, separated by comma
-for keyval in args.event_add_entries.split(","):
-key_val_entry = keyval.split("=")
-if len(key_val_entry) == 2:
-(key, val) = key_val_entry
-val_parts = val.split(':')
-if len(val_parts) > 1:
-(val, val_type) = val_parts
-if val_type == 'int':
-val = int(val)
-entries[key] = val
-# Tell the event builder to create all events with these
-# key/val pairs in them.
-if len(entries) > 0:
-EventBuilder.add_entries_to_all_events(entries)
-
 # Gather all the dirs passed on the command line.
 if len(args.args) > 0:
 configuration.testdirs = [os.path.realpath(os.path.abspath(x)) for x 
in args.args]

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=370266&r1=370265&r2=370266&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Wed Aug 28 
14:31:53 2019
@@ -243,13 +243,6 @@ def create_parser():
 help=('Specify an option to pass to the formatter. '
   'Use --results-formatter-option="--option1=val1" '
   'syntax.  Note the "=" is critical, don\'t include whitespace.'))
-group.add_argument(
-'--event-add-entries',
-action='store',
-help=('Specify comma-separated KEY=VAL entries to add key and value '
-  'pairs to all test events generated by this test run.  VAL may '
-  'be specified as VAL:TYPE, where TYPE may be int to convert '
-  'the value to an int'))
 
 # Re-run related arguments
 group = parser.add_argument_group('Test Re-run Options')


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66908: [dotest] Remove the -# option

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added a reviewer: LLDB.
Herald added a project: LLDB.

Rerunning the test suite is not something that dotest.py should be responsible 
for. This is another step towards making lit the driver and dotest the test 
framework.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66908

Files:
  lldb/packages/Python/lldbsuite/test/configuration.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/packages/Python/lldbsuite/test/test_result.py


Index: lldb/packages/Python/lldbsuite/test/test_result.py
===
--- lldb/packages/Python/lldbsuite/test/test_result.py
+++ lldb/packages/Python/lldbsuite/test/test_result.py
@@ -33,7 +33,6 @@
 to a log file for easier human inspection of test failures/errors.
 """
 __singleton__ = None
-__ignore_singleton__ = False
 
 @staticmethod
 def getTerminalSize():
@@ -63,8 +62,6 @@
 return int(cr[1]), int(cr[0])
 
 def __init__(self, *args):
-if not LLDBTestResult.__ignore_singleton__ and 
LLDBTestResult.__singleton__:
-raise Exception("LLDBTestResult instantiated more than once")
 super(LLDBTestResult, self).__init__(*args)
 LLDBTestResult.__singleton__ = self
 # Now put this singleton into the lldb module namespace.
Index: lldb/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -145,12 +145,6 @@
 type=int,
 metavar='count',
 help="Specify the iteration count used to collect our benchmarks. An 
example is the number of times to do 'thread step-over' to measure stepping 
speed.")
-group.add_argument(
-'-#',
-type=int,
-metavar='sharp',
-dest='sharp',
-help='Repeat the test suite for a specified number of times')
 group.add_argument('--channel', metavar='channel', dest='channels', 
action='append', help=textwrap.dedent(
 "Specify the log channels (and optional categories) e.g. 'lldb all' or 
'gdb-remote packets' if no categories are specified, 'default' is used"))
 group.add_argument(
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -401,10 +401,6 @@
 if args.v:
 configuration.verbose = 2
 
-# argparse makes sure we have a number
-if args.sharp:
-configuration.count = args.sharp
-
 if sys.platform.startswith('win32'):
 os.environ['LLDB_DISABLE_CRASH_DIALOG'] = str(
 args.disable_crash_dialog)
@@ -1142,24 +1138,11 @@
  configuration.suite.countTestCases() != 1 and "s" or ""))
 
 # Invoke the test runner.
-if configuration.count == 1:
-result = unittest2.TextTestRunner(
-stream=sys.stderr,
-verbosity=configuration.verbose,
-resultclass=test_result.LLDBTestResult).run(
-configuration.suite)
-else:
-# We are invoking the same test suite more than once.  In this case,
-# mark __ignore_singleton__ flag as True so the signleton pattern is
-# not enforced.
-test_result.LLDBTestResult.__ignore_singleton__ = True
-for i in range(configuration.count):
-
-result = unittest2.TextTestRunner(
-stream=sys.stderr,
-verbosity=configuration.verbose,
-resultclass=test_result.LLDBTestResult).run(
-configuration.suite)
+result = unittest2.TextTestRunner(
+stream=sys.stderr,
+verbosity=configuration.verbose,
+resultclass=test_result.LLDBTestResult).run(
+configuration.suite)
 
 configuration.failed = not result.wasSuccessful()
 
Index: lldb/packages/Python/lldbsuite/test/configuration.py
===
--- lldb/packages/Python/lldbsuite/test/configuration.py
+++ lldb/packages/Python/lldbsuite/test/configuration.py
@@ -36,9 +36,6 @@
 # The path to LLDB.framework is optional.
 lldbFrameworkPath = None
 
-# Test suite repeat count.  Can be overwritten with '-# count'.
-count = 1
-
 # The 'arch' and 'compiler' can be specified via command line.
 arch = None# Must be initialized after option parsing
 compiler = None# Must be initialized after option parsing


Index: lldb/packages/Python/lldbsuite/test/test_result.py
===
--- lldb/packages/Python/lldbsuite/test/test_result.py
+++ lldb/packages/Python/lldbsuite/test/test_result.py
@@ -33,7 +33,6 @@
 to a log file for easier human inspection of test failures/errors.
 """
   

[Lldb-commits] [PATCH] D66908: [dotest] Remove the -# option

2019-08-28 Thread Jim Ingham via Phabricator via lldb-commits
jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

I use -# for running single tests multiple times.  This is useful particularly 
if you have a test that only fails sometimes, you can do:

  $ lldb-dotest -p testname.py -d -#400

then attach lldb to the Python instance set some breakpoints, if that's 
appropriate and continue.  Then when you get the bad path, you're sitting there 
in the debugger with the failure in front of you.  Very convenient.  I don't 
see a way to do this with the lit infrastructure at present.

It seems to me that this is independent of the project of making dotest not be 
a driver, since this has nothing to do with finding tests, or farming many 
tests out to multiple processes, it just says "I passed you the test to run but 
run it 400 times in series rather than one time."  So I don't think this is at 
cross purposes to that project.

Until there's another way to do this task that's as convenient, it would be 
nice not to remove this option.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66908/new/

https://reviews.llvm.org/D66908



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66908: [dotest] Remove the -# option

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere abandoned this revision.
JDevlieghere added a comment.

Alright, let's keep it 👍


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66908/new/

https://reviews.llvm.org/D66908



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66912: [dotest] Make dotest.py invocation repeatable

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added a reviewer: LLDB.
Herald added a project: LLDB.

This removes support for reading the `LLDB_TEST_ARGUMENTS` environment variable 
and instead requires all arguments to be specified as part of the invocation. 
This ensures that dotest.py invocations are easily repeatable.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66912

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py


Index: lldb/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -7,32 +7,10 @@
 import os
 import textwrap
 
-# Third-party modules
-
 # LLDB modules
 from . import configuration
 
 
-class ArgParseNamespace(object):
-pass
-
-
-def parse_args(parser, argv):
-""" Returns an argument object. LLDB_TEST_ARGUMENTS environment variable 
can
-be used to pass additional arguments.
-"""
-args = ArgParseNamespace()
-
-if ('LLDB_TEST_ARGUMENTS' in os.environ):
-print(
-"Arguments passed through environment: '%s'" %
-os.environ['LLDB_TEST_ARGUMENTS'])
-args = parser.parse_args([sys.argv[0]].__add__(
-os.environ['LLDB_TEST_ARGUMENTS'].split()), namespace=args)
-
-return parser.parse_args(args=argv, namespace=args)
-
-
 def create_parser():
 parser = argparse.ArgumentParser(
 description='description',
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -48,6 +48,9 @@
 from lldbsuite.test_event.event_builder import EventBuilder
 from ..support import seven
 
+def get_dotest_invocation():
+return ' '.join(sys.argv)
+
 
 def is_exe(fpath):
 """Returns true if fpath is an executable."""
@@ -228,9 +231,9 @@
 
 try:
 parser = dotest_args.create_parser()
-args = dotest_args.parse_args(parser, sys.argv[1:])
+args = parser.parse_args()
 except:
-print(' '.join(sys.argv))
+print(get_dotest_invocation())
 raise
 
 if args.unset_env_varnames:
@@ -255,7 +258,7 @@
 
 # Only print the args if being verbose.
 if args.v and not args.q:
-print(sys.argv)
+print(get_dotest_invocation())
 
 if args.h:
 do_help = True
@@ -824,9 +827,6 @@
 'log enable failed (check GDB_REMOTE_LOG env variable)')
 
 
-def getMyCommandLine():
-return ' '.join(sys.argv)
-
 #  #
 #  #
 # Execution of the test driver starts here #
@@ -1113,7 +1113,7 @@
 "\nSession logs for test failures/errors/unexpected successes"
 " will go into directory '%s'\n" %
 configuration.sdir_name)
-sys.stderr.write("Command invoked: %s\n" % getMyCommandLine())
+sys.stderr.write("Command invoked: %s\n" % get_dotest_invocation())
 
 #
 # Invoke the default TextTestRunner to run the test suite


Index: lldb/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -7,32 +7,10 @@
 import os
 import textwrap
 
-# Third-party modules
-
 # LLDB modules
 from . import configuration
 
 
-class ArgParseNamespace(object):
-pass
-
-
-def parse_args(parser, argv):
-""" Returns an argument object. LLDB_TEST_ARGUMENTS environment variable can
-be used to pass additional arguments.
-"""
-args = ArgParseNamespace()
-
-if ('LLDB_TEST_ARGUMENTS' in os.environ):
-print(
-"Arguments passed through environment: '%s'" %
-os.environ['LLDB_TEST_ARGUMENTS'])
-args = parser.parse_args([sys.argv[0]].__add__(
-os.environ['LLDB_TEST_ARGUMENTS'].split()), namespace=args)
-
-return parser.parse_args(args=argv, namespace=args)
-
-
 def create_parser():
 parser = argparse.ArgumentParser(
 description='description',
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -48,6 +48,9 @@
 from lldbsuite.test_event.event_builder import EventBuilder
 from ..support import seven
 
+def get_dotest_invocation():
+return ' '.join(sys.argv)
+
 
 def is_exe(fpath):
 """Returns true if fpath is an executable."""
@@ -228,9 +231,9 @@
 
 try:
 parser = dotest_args.create_parser()
-args = dotest_args.parse_args(parser, sys.argv[1:])
+args = parser.parse_args()
 except:
-print(' '.join(sys.argv))
+   

[Lldb-commits] [PATCH] D66915: [TSanRuntime] Upstream thread swift race detector.

2019-08-28 Thread Davide Italiano via Phabricator via lldb-commits
davide created this revision.
davide added a reviewer: kubamracek.
Herald added a project: LLDB.

This is self-contained, and doesn't need anything in the
compiler to work. Mainly to reduce the diff between upstream
and downstream.

Patch by Kuba Mracek!


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66915

Files:
  lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
  lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h

Index: lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h
===
--- lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h
+++ lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h
@@ -61,7 +61,8 @@
 
   StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref);
 
-  std::string FormatDescription(StructuredData::ObjectSP report);
+  std::string FormatDescription(StructuredData::ObjectSP report,
+bool &is_swift_access_race);
 
   std::string GenerateSummary(StructuredData::ObjectSP report);
 
Index: lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
===
--- lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
+++ lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
@@ -88,6 +88,7 @@
 // TODO: dlsym won't work on Windows.
 void *dlsym(void* handle, const char* symbol);
 int (*ptr__tsan_get_report_loc_object_type)(void *report, unsigned long idx, const char **object_type);
+int (*ptr__tsan_get_report_tag)(void *report, unsigned long *tag);
 }
 
 const int REPORT_TRACE_SIZE = 128;
@@ -97,6 +98,7 @@
 void *report;
 const char *description;
 int report_count;
+unsigned long tag;
 
 void *sleep_trace[REPORT_TRACE_SIZE];
 
@@ -163,10 +165,14 @@
 data t = {0};
 
 ptr__tsan_get_report_loc_object_type = (typeof(ptr__tsan_get_report_loc_object_type))(void *)dlsym((void*)-2 /*RTLD_DEFAULT*/, "__tsan_get_report_loc_object_type");
+ptr__tsan_get_report_tag = (typeof(ptr__tsan_get_report_tag))(void *)dlsym((void*)-2 /*RTLD_DEFAULT*/, "__tsan_get_report_tag");
 
 t.report = __tsan_get_current_report();
 __tsan_get_report_data(t.report, &t.description, &t.report_count, &t.stack_count, &t.mop_count, &t.loc_count, &t.mutex_count, &t.thread_count, &t.unique_tid_count, t.sleep_trace, REPORT_TRACE_SIZE);
 
+if (ptr__tsan_get_report_tag)
+ptr__tsan_get_report_tag(t.report, &t.tag);
+
 if (t.stack_count > REPORT_ARRAY_SIZE) t.stack_count = REPORT_ARRAY_SIZE;
 for (int i = 0; i < t.stack_count; i++) {
 t.stacks[i].idx = i;
@@ -347,6 +353,9 @@
->GetValueAsUnsigned(0));
   dict->AddItem("sleep_trace", StructuredData::ObjectSP(CreateStackTrace(
main_value, ".sleep_trace")));
+  dict->AddIntegerItem(
+  "tag",
+  main_value->GetValueForExpressionPath(".tag")->GetValueAsUnsigned(0));
 
   StructuredData::Array *stacks = ConvertToStructuredArray(
   main_value, ".stacks", ".stack_count",
@@ -485,8 +494,8 @@
   return StructuredData::ObjectSP(dict);
 }
 
-std::string
-ThreadSanitizerRuntime::FormatDescription(StructuredData::ObjectSP report) {
+std::string ThreadSanitizerRuntime::FormatDescription(
+StructuredData::ObjectSP report, bool &is_swift_access_race) {
   std::string description = report->GetAsDictionary()
 ->GetValueForKey("issue_type")
 ->GetAsString()
@@ -521,8 +530,18 @@
   } else if (description == "lock-order-inversion") {
 return "Lock order inversion (potential deadlock)";
   } else if (description == "external-race") {
+auto tag = report->GetAsDictionary()
+   ->GetValueForKey("tag")
+   ->GetAsInteger()
+   ->GetValue();
+static const unsigned long kSwiftAccessRaceTag = 0x1;
+if (tag == kSwiftAccessRaceTag) {
+  is_swift_access_race = true;
+  return "Swift access race";
+}
 return "Race on a library object";
   } else if (description == "swift-access-race") {
+is_swift_access_race = true;
 return "Swift access race";
   }
 
@@ -616,9 +635,14 @@
 ->GetValueForKey("description")
 ->GetAsString()
 ->GetValue();
+  bool is_swift_access_race = report->GetAsDictionary()
+  ->GetValueForKey("is_swift_access_race")
+  ->GetAsBoolean()
+  ->GetValue();
+
   bool skip_one_frame =
-  report->GetObjectForDotSeparatedPath("issue_type")->GetStringValue() ==
-  "external-race";
+  (report->GetObjectForDotSeparatedPath("issue_type")->GetStringValue() ==
+  "external-race") && (!is_swift_access_race);
 
   addr_t pc = 0;
   if (report->GetAsDictionary()
@@ -810,8 +834,12 @@

[Lldb-commits] [lldb] r370278 - [dotest] Make dotest.py invocation repeatable

2019-08-28 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 28 16:54:23 2019
New Revision: 370278

URL: http://llvm.org/viewvc/llvm-project?rev=370278&view=rev
Log:
[dotest] Make dotest.py invocation repeatable

This removes support for reading the LLDB_TEST_ARGUMENTS environment
variable and instead requires all arguments to be specified as part of
the invocation. This ensures that dotest.py invocations are easily
repeatable.

Differential revision: https://reviews.llvm.org/D66912

Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=370278&r1=370277&r2=370278&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Aug 28 16:54:23 2019
@@ -48,6 +48,9 @@ from . import test_result
 from lldbsuite.test_event.event_builder import EventBuilder
 from ..support import seven
 
+def get_dotest_invocation():
+return ' '.join(sys.argv)
+
 
 def is_exe(fpath):
 """Returns true if fpath is an executable."""
@@ -228,9 +231,9 @@ def parseOptionsAndInitTestdirs():
 
 try:
 parser = dotest_args.create_parser()
-args = dotest_args.parse_args(parser, sys.argv[1:])
+args = parser.parse_args()
 except:
-print(' '.join(sys.argv))
+print(get_dotest_invocation())
 raise
 
 if args.unset_env_varnames:
@@ -255,7 +258,7 @@ def parseOptionsAndInitTestdirs():
 
 # Only print the args if being verbose.
 if args.v and not args.q:
-print(sys.argv)
+print(get_dotest_invocation())
 
 if args.h:
 do_help = True
@@ -824,9 +827,6 @@ def lldbLoggings():
 'log enable failed (check GDB_REMOTE_LOG env variable)')
 
 
-def getMyCommandLine():
-return ' '.join(sys.argv)
-
 #  #
 #  #
 # Execution of the test driver starts here #
@@ -1113,7 +1113,7 @@ def run_suite():
 "\nSession logs for test failures/errors/unexpected successes"
 " will go into directory '%s'\n" %
 configuration.sdir_name)
-sys.stderr.write("Command invoked: %s\n" % getMyCommandLine())
+sys.stderr.write("Command invoked: %s\n" % get_dotest_invocation())
 
 #
 # Invoke the default TextTestRunner to run the test suite

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=370278&r1=370277&r2=370278&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Wed Aug 28 
16:54:23 2019
@@ -7,32 +7,10 @@ import sys
 import os
 import textwrap
 
-# Third-party modules
-
 # LLDB modules
 from . import configuration
 
 
-class ArgParseNamespace(object):
-pass
-
-
-def parse_args(parser, argv):
-""" Returns an argument object. LLDB_TEST_ARGUMENTS environment variable 
can
-be used to pass additional arguments.
-"""
-args = ArgParseNamespace()
-
-if ('LLDB_TEST_ARGUMENTS' in os.environ):
-print(
-"Arguments passed through environment: '%s'" %
-os.environ['LLDB_TEST_ARGUMENTS'])
-args = parser.parse_args([sys.argv[0]].__add__(
-os.environ['LLDB_TEST_ARGUMENTS'].split()), namespace=args)
-
-return parser.parse_args(args=argv, namespace=args)
-
-
 def create_parser():
 parser = argparse.ArgumentParser(
 description='description',


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66912: [dotest] Make dotest.py invocation repeatable

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370278: [dotest] Make dotest.py invocation repeatable 
(authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66912?vs=217737&id=217744#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66912/new/

https://reviews.llvm.org/D66912

Files:
  lldb/trunk/packages/Python/lldbsuite/test/dotest.py
  lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py


Index: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
@@ -7,32 +7,10 @@
 import os
 import textwrap
 
-# Third-party modules
-
 # LLDB modules
 from . import configuration
 
 
-class ArgParseNamespace(object):
-pass
-
-
-def parse_args(parser, argv):
-""" Returns an argument object. LLDB_TEST_ARGUMENTS environment variable 
can
-be used to pass additional arguments.
-"""
-args = ArgParseNamespace()
-
-if ('LLDB_TEST_ARGUMENTS' in os.environ):
-print(
-"Arguments passed through environment: '%s'" %
-os.environ['LLDB_TEST_ARGUMENTS'])
-args = parser.parse_args([sys.argv[0]].__add__(
-os.environ['LLDB_TEST_ARGUMENTS'].split()), namespace=args)
-
-return parser.parse_args(args=argv, namespace=args)
-
-
 def create_parser():
 parser = argparse.ArgumentParser(
 description='description',
Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -48,6 +48,9 @@
 from lldbsuite.test_event.event_builder import EventBuilder
 from ..support import seven
 
+def get_dotest_invocation():
+return ' '.join(sys.argv)
+
 
 def is_exe(fpath):
 """Returns true if fpath is an executable."""
@@ -228,9 +231,9 @@
 
 try:
 parser = dotest_args.create_parser()
-args = dotest_args.parse_args(parser, sys.argv[1:])
+args = parser.parse_args()
 except:
-print(' '.join(sys.argv))
+print(get_dotest_invocation())
 raise
 
 if args.unset_env_varnames:
@@ -255,7 +258,7 @@
 
 # Only print the args if being verbose.
 if args.v and not args.q:
-print(sys.argv)
+print(get_dotest_invocation())
 
 if args.h:
 do_help = True
@@ -824,9 +827,6 @@
 'log enable failed (check GDB_REMOTE_LOG env variable)')
 
 
-def getMyCommandLine():
-return ' '.join(sys.argv)
-
 #  #
 #  #
 # Execution of the test driver starts here #
@@ -1113,7 +1113,7 @@
 "\nSession logs for test failures/errors/unexpected successes"
 " will go into directory '%s'\n" %
 configuration.sdir_name)
-sys.stderr.write("Command invoked: %s\n" % getMyCommandLine())
+sys.stderr.write("Command invoked: %s\n" % get_dotest_invocation())
 
 #
 # Invoke the default TextTestRunner to run the test suite


Index: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
@@ -7,32 +7,10 @@
 import os
 import textwrap
 
-# Third-party modules
-
 # LLDB modules
 from . import configuration
 
 
-class ArgParseNamespace(object):
-pass
-
-
-def parse_args(parser, argv):
-""" Returns an argument object. LLDB_TEST_ARGUMENTS environment variable can
-be used to pass additional arguments.
-"""
-args = ArgParseNamespace()
-
-if ('LLDB_TEST_ARGUMENTS' in os.environ):
-print(
-"Arguments passed through environment: '%s'" %
-os.environ['LLDB_TEST_ARGUMENTS'])
-args = parser.parse_args([sys.argv[0]].__add__(
-os.environ['LLDB_TEST_ARGUMENTS'].split()), namespace=args)
-
-return parser.parse_args(args=argv, namespace=args)
-
-
 def create_parser():
 parser = argparse.ArgumentParser(
 description='description',
Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py
@@ -48,6 +48,9 @@
 from lldbsuite.test_event.event_builder import EventBuilder
 from ..support import seven
 
+def get_dotest_invocation():
+return ' '.join(sys.argv)
+
 
 def is_exe(fpath):
 """Returns true if fpath is an executable."""
@@ -228,9 +231,9 @@
 
 try:
 parser = dotest_args.

[Lldb-commits] [PATCH] D66917: [dotest] Remove the curses result formatter.

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: LLDB, jingham.
Herald added subscribers: lldb-commits, abidh.
Herald added a project: LLDB.

This removes the curses result formatter which appears to be broken. Passing 
`--curses` to `dotest.py` screws up my terminal and doesn't run any tests. It 
even crashes Python on occasion.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66917

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/packages/Python/lldbsuite/test_event/formatter/curses.py

Index: lldb/packages/Python/lldbsuite/test_event/formatter/curses.py
===
--- lldb/packages/Python/lldbsuite/test_event/formatter/curses.py
+++ /dev/null
@@ -1,341 +0,0 @@
-"""
-  Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-  See https://llvm.org/LICENSE.txt for license information.
-  SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-"""
-
-from __future__ import absolute_import
-from __future__ import print_function
-
-# System modules
-import curses
-import datetime
-import math
-import sys
-import time
-
-# Third-party modules
-
-# LLDB modules
-from lldbsuite.test import lldbcurses
-
-from . import results_formatter
-from ..event_builder import EventBuilder
-
-
-class Curses(results_formatter.ResultsFormatter):
-"""Receives live results from tests that are running and reports them to the terminal in a curses GUI"""
-
-def __init__(self, out_file, options):
-# Initialize the parent
-super(Curses, self).__init__(out_file, options)
-self.using_terminal = True
-self.have_curses = True
-self.initialize_event = None
-self.jobs = [None] * 64
-self.job_tests = [None] * 64
-self.results = list()
-try:
-self.main_window = lldbcurses.intialize_curses()
-self.main_window.add_key_action(
-'\t',
-self.main_window.select_next_first_responder,
-"Switch between views that can respond to keyboard input")
-self.main_window.refresh()
-self.job_panel = None
-self.results_panel = None
-self.status_panel = None
-self.info_panel = None
-self.hide_status_list = list()
-self.start_time = time.time()
-except:
-self.have_curses = False
-lldbcurses.terminate_curses()
-self.using_terminal = False
-print("Unexpected error:", sys.exc_info()[0])
-raise
-
-self.line_dict = dict()
-# self.events_file = open("/tmp/events.txt", "w")
-# self.formatters = list()
-# if tee_results_formatter:
-# self.formatters.append(tee_results_formatter)
-
-def status_to_short_str(self, status, test_event):
-if status == EventBuilder.STATUS_SUCCESS:
-return '.'
-elif status == EventBuilder.STATUS_FAILURE:
-return 'F'
-elif status == EventBuilder.STATUS_UNEXPECTED_SUCCESS:
-return '?'
-elif status == EventBuilder.STATUS_EXPECTED_FAILURE:
-return 'X'
-elif status == EventBuilder.STATUS_SKIP:
-return 'S'
-elif status == EventBuilder.STATUS_ERROR:
-if test_event.get("issue_phase", None) == "build":
-# Build failure
-return 'B'
-else:
-return 'E'
-elif status == EventBuilder.STATUS_TIMEOUT:
-return 'T'
-elif status == EventBuilder.STATUS_EXPECTED_TIMEOUT:
-return 't'
-else:
-return status
-
-def show_info_panel(self):
-selected_idx = self.results_panel.get_selected_idx()
-if selected_idx >= 0 and selected_idx < len(self.results):
-if self.info_panel is None:
-info_frame = self.results_panel.get_contained_rect(
-top_inset=10, left_inset=10, right_inset=10, height=30)
-self.info_panel = lldbcurses.BoxedPanel(
-info_frame, "Result Details")
-# Add a key action for any key that will hide this panel when
-# any key is pressed
-self.info_panel.add_key_action(-1,
-   self.hide_info_panel,
-   'Hide the info panel')
-self.info_panel.top()
-else:
-self.info_panel.show()
-
-self.main_window.push_first_responder(self.info_panel)
-test_start = self.results[selected_idx][0]
-test_result = self.results[selected_idx][1]
-self.info_panel.set_line(
-0, "File: %s" %
-(test_start['test_filename']))
-self.info_panel.set_line(
-1, "Test: %s.

[Lldb-commits] [PATCH] D66920: [dotest] Remove deprecated loggin through env variables.

2019-08-28 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
JDevlieghere edited the summary of this revision.
JDevlieghere added a reviewer: LLDB.
JDevlieghere added a reviewer: labath.

It used to be possible to enable logging through environment variables read by 
dotest. This approach is deprecated, as stated in the dotest help output. 
Instead `--channel` should be used.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66920

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py


Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -167,20 +167,6 @@
 
 $ ./dotest.py --log-success
 
-Option 2: (DEPRECATED)
-
-The following options can only enable logs from the host lldb process.
-Only categories from the "lldb" or "gdb-remote" channels can be enabled
-They also do not automatically enable logs in locally running debug servers.
-Also, logs from all test case are written into each log file
-
-o LLDB_LOG: if defined, specifies the log file pathname for the 'lldb' 
subsystem
-  with a default option of 'event process' if LLDB_LOG_OPTION is not defined.
-
-o GDB_REMOTE_LOG: if defined, specifies the log file pathname for the
-  'process.gdb-remote' subsystem with a default option of 'packets' if
-  GDB_REMOTE_LOG_OPTION is not defined.
-
 """)
 sys.exit(0)
 
@@ -766,61 +752,6 @@
 raise Exception('disabling dynamic type support failed')
 
 
-def lldbLoggings():
-import lldb
-"""Check and do lldb loggings if necessary."""
-
-# Turn on logging for debugging purposes if ${LLDB_LOG} environment 
variable is
-# defined.  Use ${LLDB_LOG} to specify the log file.
-ci = lldb.DBG.GetCommandInterpreter()
-res = lldb.SBCommandReturnObject()
-if ("LLDB_LOG" in os.environ):
-open(os.environ["LLDB_LOG"], 'w').close()
-if ("LLDB_LOG_OPTION" in os.environ):
-lldb_log_option = os.environ["LLDB_LOG_OPTION"]
-else:
-lldb_log_option = "event process expr state api"
-ci.HandleCommand(
-"log enable -n -f " +
-os.environ["LLDB_LOG"] +
-" lldb " +
-lldb_log_option,
-res)
-if not res.Succeeded():
-raise Exception('log enable failed (check LLDB_LOG env variable)')
-
-if ("LLDB_LINUX_LOG" in os.environ):
-open(os.environ["LLDB_LINUX_LOG"], 'w').close()
-if ("LLDB_LINUX_LOG_OPTION" in os.environ):
-lldb_log_option = os.environ["LLDB_LINUX_LOG_OPTION"]
-else:
-lldb_log_option = "event process expr state api"
-ci.HandleCommand(
-"log enable -n -f " +
-os.environ["LLDB_LINUX_LOG"] +
-" linux " +
-lldb_log_option,
-res)
-if not res.Succeeded():
-raise Exception(
-'log enable failed (check LLDB_LINUX_LOG env variable)')
-
-# Ditto for gdb-remote logging if ${GDB_REMOTE_LOG} environment variable 
is defined.
-# Use ${GDB_REMOTE_LOG} to specify the log file.
-if ("GDB_REMOTE_LOG" in os.environ):
-if ("GDB_REMOTE_LOG_OPTION" in os.environ):
-gdb_remote_log_option = os.environ["GDB_REMOTE_LOG_OPTION"]
-else:
-gdb_remote_log_option = "packets process"
-ci.HandleCommand(
-"log enable -n -f " + os.environ["GDB_REMOTE_LOG"] + " gdb-remote "
-+ gdb_remote_log_option,
-res)
-if not res.Succeeded():
-raise Exception(
-'log enable failed (check GDB_REMOTE_LOG env variable)')
-
-
 #  #
 #  #
 # Execution of the test driver starts here #
@@ -1091,9 +1022,6 @@
 # Now that we have loaded all the test cases, run the whole test suite.
 #
 
-# Turn on lldb loggings if necessary.
-lldbLoggings()
-
 # Disable default dynamic types for testing purposes
 disabledynamics()
 


Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -167,20 +167,6 @@
 
 $ ./dotest.py --log-success
 
-Option 2: (DEPRECATED)
-
-The following options can only enable logs from the host lldb process.
-Only categories from the "lldb" or "gdb-remote" channels can be enabled
-They also do not automatically enable logs in locally running debug servers.
-Also, logs from all test case are written into each log file
-
-o LLDB_LOG: if defined, specifies the log file pathname for the 'lldb' subsystem
-  with a default option of 'event process' if LLDB_LOG_OPTION is not defined.
-
-o GDB_REMOTE_LOG: if defined, specifies the log file pathname for the
-  '

[Lldb-commits] [lldb] r370286 - [TSanRuntime] Upstream thread swift race detector.

2019-08-28 Thread Davide Italiano via lldb-commits
Author: davide
Date: Wed Aug 28 18:39:26 2019
New Revision: 370286

URL: http://llvm.org/viewvc/llvm-project?rev=370286&view=rev
Log:
[TSanRuntime] Upstream thread swift race detector.

Summary:
This is self-contained, and doesn't need anything in the
compiler to work. Mainly to reduce the diff between upstream
and downstream.

Patch by Kuba Mracek!

Reviewers: kubamracek

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D66915

Modified:
lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h

Modified: lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp?rev=370286&r1=370285&r2=370286&view=diff
==
--- lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp 
(original)
+++ lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp Wed 
Aug 28 18:39:26 2019
@@ -88,6 +88,7 @@ extern "C"
 // TODO: dlsym won't work on Windows.
 void *dlsym(void* handle, const char* symbol);
 int (*ptr__tsan_get_report_loc_object_type)(void *report, unsigned long 
idx, const char **object_type);
+int (*ptr__tsan_get_report_tag)(void *report, unsigned long *tag);
 }
 
 const int REPORT_TRACE_SIZE = 128;
@@ -97,6 +98,7 @@ struct data {
 void *report;
 const char *description;
 int report_count;
+unsigned long tag;
 
 void *sleep_trace[REPORT_TRACE_SIZE];
 
@@ -163,10 +165,14 @@ const char *thread_sanitizer_retrieve_re
 data t = {0};
 
 ptr__tsan_get_report_loc_object_type = 
(typeof(ptr__tsan_get_report_loc_object_type))(void *)dlsym((void*)-2 
/*RTLD_DEFAULT*/, "__tsan_get_report_loc_object_type");
+ptr__tsan_get_report_tag = (typeof(ptr__tsan_get_report_tag))(void 
*)dlsym((void*)-2 /*RTLD_DEFAULT*/, "__tsan_get_report_tag");
 
 t.report = __tsan_get_current_report();
 __tsan_get_report_data(t.report, &t.description, &t.report_count, 
&t.stack_count, &t.mop_count, &t.loc_count, &t.mutex_count, &t.thread_count, 
&t.unique_tid_count, t.sleep_trace, REPORT_TRACE_SIZE);
 
+if (ptr__tsan_get_report_tag)
+ptr__tsan_get_report_tag(t.report, &t.tag);
+
 if (t.stack_count > REPORT_ARRAY_SIZE) t.stack_count = REPORT_ARRAY_SIZE;
 for (int i = 0; i < t.stack_count; i++) {
 t.stacks[i].idx = i;
@@ -347,6 +353,9 @@ ThreadSanitizerRuntime::RetrieveReportDa
->GetValueAsUnsigned(0));
   dict->AddItem("sleep_trace", StructuredData::ObjectSP(CreateStackTrace(
main_value, ".sleep_trace")));
+  dict->AddIntegerItem(
+  "tag",
+  main_value->GetValueForExpressionPath(".tag")->GetValueAsUnsigned(0));
 
   StructuredData::Array *stacks = ConvertToStructuredArray(
   main_value, ".stacks", ".stack_count",
@@ -485,8 +494,8 @@ ThreadSanitizerRuntime::RetrieveReportDa
   return StructuredData::ObjectSP(dict);
 }
 
-std::string
-ThreadSanitizerRuntime::FormatDescription(StructuredData::ObjectSP report) {
+std::string ThreadSanitizerRuntime::FormatDescription(
+StructuredData::ObjectSP report, bool &is_swift_access_race) {
   std::string description = report->GetAsDictionary()
 ->GetValueForKey("issue_type")
 ->GetAsString()
@@ -521,8 +530,18 @@ ThreadSanitizerRuntime::FormatDescriptio
   } else if (description == "lock-order-inversion") {
 return "Lock order inversion (potential deadlock)";
   } else if (description == "external-race") {
+auto tag = report->GetAsDictionary()
+   ->GetValueForKey("tag")
+   ->GetAsInteger()
+   ->GetValue();
+static const unsigned long kSwiftAccessRaceTag = 0x1;
+if (tag == kSwiftAccessRaceTag) {
+  is_swift_access_race = true;
+  return "Swift access race";
+}
 return "Race on a library object";
   } else if (description == "swift-access-race") {
+is_swift_access_race = true;
 return "Swift access race";
   }
 
@@ -616,9 +635,14 @@ ThreadSanitizerRuntime::GenerateSummary(
 ->GetValueForKey("description")
 ->GetAsString()
 ->GetValue();
+  bool is_swift_access_race = report->GetAsDictionary()
+  ->GetValueForKey("is_swift_access_race")
+  ->GetAsBoolean()
+  ->GetValue();
+
   bool skip_one_frame =
-  report->GetObjectForDotSeparatedPath("issue_type")->GetStringValue() ==
-  "external-race";
+  (report->GetObjectForDotSeparatedPath("issue_type")->GetStringValue() ==
+  "external-race") && (!is_swift_access_race);
 
   addr_t pc = 0;
   if (report->GetAsDictionary()
@@ -810,8 +834,12 @@ bool ThreadSan

[Lldb-commits] [PATCH] D66915: [TSanRuntime] Upstream thread swift race detector.

2019-08-28 Thread Davide Italiano via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370286: [TSanRuntime] Upstream thread swift race detector. 
(authored by davide, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66915?vs=217743&id=217756#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66915/new/

https://reviews.llvm.org/D66915

Files:
  lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
  lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h

Index: lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h
===
--- lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h
+++ lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h
@@ -61,7 +61,8 @@
 
   StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref);
 
-  std::string FormatDescription(StructuredData::ObjectSP report);
+  std::string FormatDescription(StructuredData::ObjectSP report,
+bool &is_swift_access_race);
 
   std::string GenerateSummary(StructuredData::ObjectSP report);
 
Index: lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
===
--- lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
+++ lldb/trunk/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
@@ -88,6 +88,7 @@
 // TODO: dlsym won't work on Windows.
 void *dlsym(void* handle, const char* symbol);
 int (*ptr__tsan_get_report_loc_object_type)(void *report, unsigned long idx, const char **object_type);
+int (*ptr__tsan_get_report_tag)(void *report, unsigned long *tag);
 }
 
 const int REPORT_TRACE_SIZE = 128;
@@ -97,6 +98,7 @@
 void *report;
 const char *description;
 int report_count;
+unsigned long tag;
 
 void *sleep_trace[REPORT_TRACE_SIZE];
 
@@ -163,10 +165,14 @@
 data t = {0};
 
 ptr__tsan_get_report_loc_object_type = (typeof(ptr__tsan_get_report_loc_object_type))(void *)dlsym((void*)-2 /*RTLD_DEFAULT*/, "__tsan_get_report_loc_object_type");
+ptr__tsan_get_report_tag = (typeof(ptr__tsan_get_report_tag))(void *)dlsym((void*)-2 /*RTLD_DEFAULT*/, "__tsan_get_report_tag");
 
 t.report = __tsan_get_current_report();
 __tsan_get_report_data(t.report, &t.description, &t.report_count, &t.stack_count, &t.mop_count, &t.loc_count, &t.mutex_count, &t.thread_count, &t.unique_tid_count, t.sleep_trace, REPORT_TRACE_SIZE);
 
+if (ptr__tsan_get_report_tag)
+ptr__tsan_get_report_tag(t.report, &t.tag);
+
 if (t.stack_count > REPORT_ARRAY_SIZE) t.stack_count = REPORT_ARRAY_SIZE;
 for (int i = 0; i < t.stack_count; i++) {
 t.stacks[i].idx = i;
@@ -347,6 +353,9 @@
->GetValueAsUnsigned(0));
   dict->AddItem("sleep_trace", StructuredData::ObjectSP(CreateStackTrace(
main_value, ".sleep_trace")));
+  dict->AddIntegerItem(
+  "tag",
+  main_value->GetValueForExpressionPath(".tag")->GetValueAsUnsigned(0));
 
   StructuredData::Array *stacks = ConvertToStructuredArray(
   main_value, ".stacks", ".stack_count",
@@ -485,8 +494,8 @@
   return StructuredData::ObjectSP(dict);
 }
 
-std::string
-ThreadSanitizerRuntime::FormatDescription(StructuredData::ObjectSP report) {
+std::string ThreadSanitizerRuntime::FormatDescription(
+StructuredData::ObjectSP report, bool &is_swift_access_race) {
   std::string description = report->GetAsDictionary()
 ->GetValueForKey("issue_type")
 ->GetAsString()
@@ -521,8 +530,18 @@
   } else if (description == "lock-order-inversion") {
 return "Lock order inversion (potential deadlock)";
   } else if (description == "external-race") {
+auto tag = report->GetAsDictionary()
+   ->GetValueForKey("tag")
+   ->GetAsInteger()
+   ->GetValue();
+static const unsigned long kSwiftAccessRaceTag = 0x1;
+if (tag == kSwiftAccessRaceTag) {
+  is_swift_access_race = true;
+  return "Swift access race";
+}
 return "Race on a library object";
   } else if (description == "swift-access-race") {
+is_swift_access_race = true;
 return "Swift access race";
   }
 
@@ -616,9 +635,14 @@
 ->GetValueForKey("description")
 ->GetAsString()
 ->GetValue();
+  bool is_swift_access_race = report->GetAsDictionary()
+  ->GetValueForKey("is_swift_access_race")
+  ->GetAsBoolean()
+  ->GetValue();
+
   bool skip_one_frame =
-  report->GetObjectForDotSeparatedPath("issue_type")->GetStringValue() ==
-  "external-race";
+  (report->Ge

[Lldb-commits] [lldb] r370287 - [python] remove testsuite vestiges.

2019-08-28 Thread Davide Italiano via lldb-commits
Author: davide
Date: Wed Aug 28 18:45:10 2019
New Revision: 370287

URL: http://llvm.org/viewvc/llvm-project?rev=370287&view=rev
Log:
[python] remove testsuite vestiges.

Removed:
lldb/trunk/packages/Python/lldbsuite/test/attic/

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits