[Lldb-commits] [lldb] r359420 - [Windows] Dump more information about access violation exception

2019-04-29 Thread Aleksandr Urakov via lldb-commits
Author: aleksandr.urakov
Date: Mon Apr 29 00:29:25 2019
New Revision: 359420

URL: http://llvm.org/viewvc/llvm-project?rev=359420&view=rev
Log:
[Windows] Dump more information about access violation exception

Summary:
Dump more information about "access violation" and "in page error" exceptions to
description. Description now contains data about read/write violation type and
actual address as described at
https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ns-winnt-_exception_record

Reviewers: asmith, stella.stamenova

Reviewed By: stella.stamenova

Subscribers: teemperor, amccarth, abidh, lldb-commits, aleksandr.urakov

Tags: #lldb

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

Added:
lldb/trunk/lit/Process/
lldb/trunk/lit/Process/Windows/
lldb/trunk/lit/Process/Windows/exception_access_violation.cpp
Modified:
lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
lldb/trunk/source/Plugins/Process/Windows/Common/ExceptionRecord.h
lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp

Added: lldb/trunk/lit/Process/Windows/exception_access_violation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Process/Windows/exception_access_violation.cpp?rev=359420&view=auto
==
--- lldb/trunk/lit/Process/Windows/exception_access_violation.cpp (added)
+++ lldb/trunk/lit/Process/Windows/exception_access_violation.cpp Mon Apr 29 
00:29:25 2019
@@ -0,0 +1,37 @@
+// clang-format off
+
+// REQUIRES: system-windows
+// RUN: %build --compiler=clang-cl -o %t.exe -- %s
+// RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -o "run" -- write | 
FileCheck --check-prefix=WRITE %s
+// RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -o "run" -- read | 
FileCheck --check-prefix=READ %s
+
+#include 
+
+int access_violation_write(void* addr) {
+*(int*)addr = 42;
+return 0;
+}
+
+
+int access_violation_read(void* addr) {
+volatile int ret = *(int*)addr;
+return ret;
+}
+
+int main(int argc, char *argv[]) {
+if (argc < 2) {
+return 1;
+}
+if (strcmp(argv[1], "write") == 0) {
+return access_violation_write((void*)42);
+}
+if (strcmp(argv[1], "read") == 0) {
+return access_violation_read((void*)42);
+}
+return 1;
+}
+
+
+// WRITE: * thread #1, stop reason = Exception 0xc005 encountered at 
address {{.*}}: Access violation writing location 0x002a
+
+// READ:  * thread #1, stop reason = Exception 0xc005 encountered at 
address {{.*}}: Access violation reading location 0x002a

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py?rev=359420&r1=359419&r2=359420&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py Mon Apr 29 00:29:25 
2019
@@ -737,7 +737,7 @@ def is_thread_crashed(test, thread):
 return thread.GetStopReason() == lldb.eStopReasonSignal and 
thread.GetStopReasonDataAtIndex(
 0) == 
thread.GetProcess().GetUnixSignals().GetSignalNumberFromName("SIGSEGV")
 elif test.getPlatform() == "windows":
-return "Exception 0xc005" in thread.GetStopDescription(100)
+return "Exception 0xc005" in thread.GetStopDescription(200)
 else:
 return "invalid address" in thread.GetStopDescription(100)
 

Modified: lldb/trunk/source/Plugins/Process/Windows/Common/ExceptionRecord.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/ExceptionRecord.h?rev=359420&r1=359419&r2=359420&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Common/ExceptionRecord.h 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/ExceptionRecord.h Mon Apr 
29 00:29:25 2019
@@ -64,6 +64,8 @@ public:
 
   lldb::tid_t GetThreadID() const { return m_thread_id; }
 
+  const std::vector& GetExceptionArguments() const { return 
m_arguments; }
+
 private:
   DWORD m_code;
   bool m_continuable;

Modified: lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp?rev=359420&r1=359419&r2=359420&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp Mon Apr 
29 00:29:25 2019
@@ -474,6 +474,74 @@ void ProcessWindows::DidAttach(ArchSpec
 RefreshStateAfterStop();
 }
 
+static void
+DumpAdditionalExceptionInformation(llvm::raw_ostream &stream,
+   const Except

[Lldb-commits] [PATCH] D60519: [Windows] Dump more information about access violation exception

2019-04-29 Thread Aleksandr Urakov via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359420: [Windows] Dump more information about access 
violation exception (authored by aleksandr.urakov, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D60519?vs=195549&id=197059#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D60519

Files:
  lldb/trunk/lit/Process/Windows/exception_access_violation.cpp
  lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
  lldb/trunk/source/Plugins/Process/Windows/Common/ExceptionRecord.h
  lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp

Index: lldb/trunk/source/Plugins/Process/Windows/Common/ExceptionRecord.h
===
--- lldb/trunk/source/Plugins/Process/Windows/Common/ExceptionRecord.h
+++ lldb/trunk/source/Plugins/Process/Windows/Common/ExceptionRecord.h
@@ -64,6 +64,8 @@
 
   lldb::tid_t GetThreadID() const { return m_thread_id; }
 
+  const std::vector& GetExceptionArguments() const { return m_arguments; }
+
 private:
   DWORD m_code;
   bool m_continuable;
Index: lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
===
--- lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
@@ -474,6 +474,74 @@
 RefreshStateAfterStop();
 }
 
+static void
+DumpAdditionalExceptionInformation(llvm::raw_ostream &stream,
+   const ExceptionRecordSP &exception) {
+  // Decode additional exception information for specific exception types based
+  // on
+  // https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ns-winnt-_exception_record
+
+  const int addr_min_width = 2 + 8; // "0x" + 4 address bytes
+
+  const std::vector &args = exception->GetExceptionArguments();
+  switch (exception->GetExceptionCode()) {
+  case EXCEPTION_ACCESS_VIOLATION: {
+if (args.size() < 2)
+  break;
+
+stream << ": ";
+const int access_violation_code = args[0];
+const lldb::addr_t access_violation_address = args[1];
+switch (access_violation_code) {
+case 0:
+  stream << "Access violation reading";
+  break;
+case 1:
+  stream << "Access violation writing";
+  break;
+case 8:
+  stream << "User-mode data execution prevention (DEP) violation at";
+  break;
+default:
+  stream << "Unknown access violation (code " << access_violation_code
+ << ") at";
+  break;
+}
+stream << " location "
+   << llvm::format_hex(access_violation_address, addr_min_width);
+break;
+  }
+  case EXCEPTION_IN_PAGE_ERROR: {
+if (args.size() < 3)
+  break;
+
+stream << ": ";
+const int page_load_error_code = args[0];
+const lldb::addr_t page_load_error_address = args[1];
+const DWORD underlying_code = args[2];
+switch (page_load_error_code) {
+case 0:
+  stream << "In page error reading";
+  break;
+case 1:
+  stream << "In page error writing";
+  break;
+case 8:
+  stream << "User-mode data execution prevention (DEP) violation at";
+  break;
+default:
+  stream << "Unknown page loading error (code " << page_load_error_code
+ << ") at";
+  break;
+}
+stream << " location "
+   << llvm::format_hex(page_load_error_address, addr_min_width)
+   << " (status code " << llvm::format_hex(underlying_code, 8) << ")";
+break;
+  }
+  }
+}
+
 void ProcessWindows::RefreshStateAfterStop() {
   Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_EXCEPTION);
   llvm::sys::ScopedLock lock(m_mutex);
@@ -573,6 +641,8 @@
 << llvm::format_hex(active_exception->GetExceptionCode(), 8)
 << " encountered at address "
 << llvm::format_hex(active_exception->GetExceptionAddress(), 8);
+DumpAdditionalExceptionInformation(desc_stream, active_exception);
+
 stop_info = StopInfo::CreateStopReasonWithException(
 *stop_thread, desc_stream.str().c_str());
 stop_thread->SetStopInfo(stop_info);
Index: lldb/trunk/lit/Process/Windows/exception_access_violation.cpp
===
--- lldb/trunk/lit/Process/Windows/exception_access_violation.cpp
+++ lldb/trunk/lit/Process/Windows/exception_access_violation.cpp
@@ -0,0 +1,37 @@
+// clang-format off
+
+// REQUIRES: system-windows
+// RUN: %build --compiler=clang-cl -o %t.exe -- %s
+// RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -o "run" -- write | FileCheck --check-prefix=WRITE %s
+// RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -o "run" -- read | FileCheck --check-prefix=READ %s
+
+#include 
+
+int access_violation_write(void* addr) {

[Lldb-commits] [PATCH] D61210: [lldb] [lit] Introduce tests for reading x86 general purpose registers

2019-04-29 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Looks good to me. In your place, I wouldn't bother with making sure that the 
process can correctly terminate after we have read the registers, but now that 
you have done it, there's no reason to take it out. :)


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

https://reviews.llvm.org/D61210



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


[Lldb-commits] [PATCH] D61221: [lldb] [lit] Introduce tests for writing x86 general-purpose registers

2019-04-29 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.

This is great stuff. Thanks for doing this.


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

https://reviews.llvm.org/D61221



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


[Lldb-commits] [PATCH] D61233: Refactor ObjectFile::GetSDKVersion

2019-04-29 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D61233#1481527 , @teemperor wrote:

> I decided to go for a vector because otherwise the implementation in 
> ObjectFileMachO gets a bit awkward. But I have no problem with doing a 
> VersionTuple instead and adding some manual translation to version tuple in 
> ObjectFileMachO.


I think it would be better to use a VersionTuple, for consistency with other 
version uses. I don't see why the MachO implementation should be awkward 
because of that. You'd just need to replace the three `push_back` lines with 
`m_sdk_version = VersionTuple(, yy, zz);`. In fact, if at the same time you 
rewrite the `GetSDKVersion` into something like:

  if (m_sdk_version.empty())
m_sdk_version = GetVersionFromLC_VERSION());
  if (m_sdk_version.empty())
m_sdk_version = GetVersionFromLC_BUILD_VERSION());
  return m_sdk_version;

that code will become at least five times more readable than it is now. :)


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

https://reviews.llvm.org/D61233



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


[Lldb-commits] [PATCH] D61231: Add 'oneOf' utility function for comparing a ConstString against a set of strings

2019-04-29 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.



In D61231#1481804 , @teemperor wrote:

> Yeah, I'm also just like 60% confident that this more readable/expressive.


I'm about 70% against this ( :P ), and the main reason for that opinion is that 
there is nothing like this in llvm, and if llvm was able to get away without 
it, then I don't see why shouldn't we be able to do it too. The way these kinds 
of things are usually done in llvm is via the `StringSwitch` class, and it 
seems to me that `StringSwitch` could be directly used in at least half of the 
motivating use cases you show here (and in the rest, it could be used after a 
mild code refactor, which that code needs anyway).

(And yeah, I am aware that going through StringSwitch will mean we lose the 
fast string comparison that ConstString was meant to provide, but I am sure 
that this will have no impact on the overall performance here.)




Comment at: 
lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp:133-139
+  if (name.oneOf("ptr", "pointer"))
 return 0;
-  if (name == "del" || name == "deleter")
+  if (name.oneOf("del", "deleter"))
 return 1;
-  if (name == "obj" || name == "object" || name == "$$dereference$$")
+  if (name.oneOf("obj", "object", "$$dereference$$"))
 return 2;
   return UINT32_MAX;

This is a prime example for a `StringSwitch`, which is how these kinds of 
things are usually done in llvm.
```
return StringSwitch(name.GetStringRef()).Cases("ptr, "pointer", 
0).Cases("del", "deleter", 1).Cases("obj", "object", "$$dereference$$", 
2).Default(UINT32_MAX);
```
(+ running clang-format over that)



Comment at: lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp:1039-1082
+  if (type_hint.oneOf(g_CFBag, g_CFBinaryHeap)) {
 prefix = "@";
 return true;
   }
 
   if (type_hint == g_NSNumberChar) {
 prefix = "(char)";

Using StringSwitch would make this code around three times shorter.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61231



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


[Lldb-commits] [PATCH] D61244: Re-enable gmodules tests on Linux

2019-04-29 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

LG, but note that this has no effect on the overall set of tests which will run 
as long as gmodules remains disabled in 
`test_categories.is_supported_on_platform`.

The other thing to note is that the effect of enabling gmodules extremely 
strongly depends on how your system is configured. (Almost) none of our test 
define their own modules, so the only modules that lldb might end up using are 
the ones from the system libraries. Which is kind of way I think our way of 
testing module debugging support is broken. We have enough problems with people 
reporting tests which only break for them because of some quirk in their system 
libraries without us throwing modules into the mix.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61244



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


[Lldb-commits] [PATCH] D61235: Add more information to the log timer dump

2019-04-29 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: lldb/source/Utility/Timer.cpp:98-101
   m_category.m_nanos += std::chrono::nanoseconds(timer_dur).count();
+  m_category.m_nanos_total += std::chrono::nanoseconds(total_dur).count();
+  m_category.m_nanos_child +=
+  std::chrono::nanoseconds(m_child_duration).count();

IIUC, one of these is redundant, as it can be recomputed from the other two, so 
we should remove it.



Comment at: lldb/source/Utility/Timer.cpp:110-123
+namespace {
+struct Stats {
+  uint64_t nanos;
+  uint64_t nanos_total;
+  uint64_t nanos_child;
+  uint64_t count;
+};

You can just move the `const char *` into the `Stats` struct and get rid of the 
std::pair. Then the `CategoryMapIteratorSortCriterion` thingy can also become a 
regular operator<.



Comment at: lldb/unittests/Utility/TimerTest.cpp:89
+  // 0.102982273 sec (total: 0.126s; child: 0.023s; count: 1) for CAT1
+  // 0.023058228 sec (total: 0.036s; child: 0.012s; count: 2) for CAT2
+  StreamString ss;

I'm not sure this second line is really helpful here. Looking at this output, I 
would have never guessed that these numbers mean we were running two recursive 
timers belonging to the same category, and the entire thing finished in 20ms.

Maybe this isn't a real usage problem, as normally we don't have recursive 
timers (I believe), but in that case, we probably shouldn't have them in this 
test either (as right now it is the only documentation about how these times 
are supposed to work). 

What's the reason for using recursive timers here? If you just wanted to check 
that the invocation count is 2, then you can wrap the two timers in `{}` 
blocks, so that they execute "sequentially" instead of recursively. (Which I 
guess would match the typical scenario where a timer-enabled function calls 
another timer-enabled function two times in a loop.)



Comment at: lldb/unittests/Utility/TimerTest.cpp:96-97
+  6, sscanf(ss.GetData(),
+"%lf sec (total: %lfs; child: %lfs; count: %d) for CAT1%*[\n "
+"]%lf sec (total: %*lfs; child: %*lfs; count: %d) for CAT2",
+&seconds1, &total1, &child1, &count1, &seconds2, &count2))

Could you help clang-format split this string more reasonably (e.g., by 
manually splitting the string after the `]`)?



Comment at: lldb/unittests/Utility/TimerTest.cpp:100-101
+  << "String: " << ss.GetData();
+  EXPECT_GT(total1 - child1, seconds1 - 0.001);
+  EXPECT_LT(total1 - child1, seconds1 + 0.001);
+  EXPECT_EQ(1, count1);

aadsm wrote:
> davide wrote:
> > this seems ... very fragile.
> that's a good point. I'm not that familiar with the ieee754 to know what's a 
> safe interval here, do you know?
I think you want to use `EXPECT_DOUBLE_EQ` here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61235



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


[Lldb-commits] [PATCH] D61244: Re-enable gmodules tests on Linux

2019-04-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 197074.
teemperor added a comment.

- Add 'linux' to the list of platforms supporting gmodules.


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

https://reviews.llvm.org/D61244

Files:
  
lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py
  
lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
  lldb/packages/Python/lldbsuite/test/test_categories.py


Index: lldb/packages/Python/lldbsuite/test/test_categories.py
===
--- lldb/packages/Python/lldbsuite/test/test_categories.py
+++ lldb/packages/Python/lldbsuite/test/test_categories.py
@@ -59,7 +59,7 @@
 return platform in ["darwin", "macosx", "ios", "watchos", "tvos", 
"bridgeos"]
 elif category == "gmodules":
 # First, check to see if the platform can even support gmodules.
-if platform not in ["freebsd", "darwin", "macosx", "ios", "watchos", 
"tvos", "bridgeos"]:
+if platform not in ["freebsd", "darwin", "macosx", "ios", "watchos", 
"tvos", "bridgeos", "linux"]:
 return False
 return gmodules.is_compiler_clang_with_gmodules(compiler_path)
 return True
Index: 
lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
===
--- 
lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
+++ 
lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
@@ -9,7 +9,6 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipIf(bugnumber="llvm.org/pr36146", oslist=["linux"], archs=["i386"])
 @add_test_categories(["gmodules"])
 def test_specialized_typedef_from_pch(self):
 self.build()
Index: 
lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py
===
--- 
lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py
+++ 
lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py
@@ -1,6 +1,3 @@
 import lldbsuite.test.lldbinline as lldbinline
-from lldbsuite.test.decorators import *
 
-lldbinline.MakeInlineTest(__file__, globals(), [
-expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr36107",
-debug_info="gmodules")])
+lldbinline.MakeInlineTest(__file__, globals())


Index: lldb/packages/Python/lldbsuite/test/test_categories.py
===
--- lldb/packages/Python/lldbsuite/test/test_categories.py
+++ lldb/packages/Python/lldbsuite/test/test_categories.py
@@ -59,7 +59,7 @@
 return platform in ["darwin", "macosx", "ios", "watchos", "tvos", "bridgeos"]
 elif category == "gmodules":
 # First, check to see if the platform can even support gmodules.
-if platform not in ["freebsd", "darwin", "macosx", "ios", "watchos", "tvos", "bridgeos"]:
+if platform not in ["freebsd", "darwin", "macosx", "ios", "watchos", "tvos", "bridgeos", "linux"]:
 return False
 return gmodules.is_compiler_clang_with_gmodules(compiler_path)
 return True
Index: lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
===
--- lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
+++ lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
@@ -9,7 +9,6 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipIf(bugnumber="llvm.org/pr36146", oslist=["linux"], archs=["i386"])
 @add_test_categories(["gmodules"])
 def test_specialized_typedef_from_pch(self):
 self.build()
Index: lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py
===
--- lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py
+++ lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py
@@ -1,6 +1,3 @@
 import lldbsuite.test.lldbinline as lldbinline
-from lldbsuite.test.decorators import *
 
-lldbinline.MakeInlineTest(__file__, globals(), [
-expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr36107",
-debug_info="gmodules")])
+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] D61244: Re-enable gmodules tests on Linux

2019-04-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

In D61244#1482146 , @labath wrote:

> LG, but note that this has no effect on the overall set of tests which will 
> run as long as gmodules remains disabled in 
> `test_categories.is_supported_on_platform`.


Oh, true, thanks for the hint! With the current categories it seems the test 
always just get's marked as PASS (TM) on Linux... But luckily it actually 
passes even when I enable linux in the category filter.

> The other thing to note is that the effect of enabling gmodules extremely 
> strongly depends on how your system is configured. (Almost) none of our test 
> define their own modules, so the only modules that lldb might end up using 
> are the ones from the system libraries. Which is kind of way I think our way 
> of testing module debugging support is broken. We have enough problems with 
> people reporting tests which only break for them because of some quirk in 
> their system libraries without us throwing modules into the mix.

It's true that the `gmodules-templates` test touches system modules. I'm fine 
with rewriting them to not use system modules (or disable the ones that really 
have to use system modules on LInux) as long as we have some gmodules coverage 
on Linux.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61244



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


[Lldb-commits] [PATCH] D61212: [lldb] [lit] Add tests for reading ZMM registers (AVX512)

2019-04-29 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a subscriber: JDevlieghere.
labath added a comment.
This revision is now accepted and ready to land.

The test fails on linux even with the right hardware, but that's not surprising 
as the original test was also @skipUnlessDarwin (and I see no trace of zmm 
support in the linux part of code). I also don't have mac hardware around that 
I could try the mac side of things on (maybe @JDevlieghere has?), but I guess 
you can also just watch the bots carefully after committing this.

In D61212#1481278 , @mgorny wrote:

> For the record, GCC refuses to build this with:
>
>   Inputs/x86-zmm-read.cpp: In function ‘int main()’:
>   Inputs/x86-zmm-read.cpp:193:4: error: more than 30 operands in ‘asm’
>  );
>   ^
>
>
> Not sure if we care about it though; clang doesn't seem to have this 
> limitation.


I don't think we have to worry about that now. If that ever becomes a problem, 
we can always make the zmm things into an array and pass them via a single 
memory argument.


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

https://reviews.llvm.org/D61212



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


[Lldb-commits] [PATCH] D61216: [Docs] Make it possible to generate the python reference without building all of LLDB

2019-04-29 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.

Looks good to me. Thanks for looking into this.

On one hand, it would be nice to create avoid creating the fake package, and 
just run epydoc from the final destination, but on the other, the nice thing 
about this is that it will always run in the same environment and not depend on 
whether you happen to have _lldb.so built or not (plus, with all the complexity 
around frameworks and stuff, it might be hard to get __init__.py to be placed 
in the final destination without depending on any of the other build steps).


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61216



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


[Lldb-commits] [PATCH] D61182: DWARFExpression: Fix implementation of DW_OP_pick

2019-04-29 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB359436: DWARFExpression: Fix implementation of DW_OP_pick 
(authored by labath, committed by ).
Herald added a subscriber: abidh.
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D61182?vs=196833&id=197083#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61182

Files:
  include/lldb/Utility/Scalar.h
  source/Expression/DWARFExpression.cpp
  source/Utility/Scalar.cpp
  unittests/Expression/CMakeLists.txt
  unittests/Expression/DWARFExpressionTest.cpp

Index: include/lldb/Utility/Scalar.h
===
--- include/lldb/Utility/Scalar.h
+++ include/lldb/Utility/Scalar.h
@@ -339,6 +339,8 @@
 bool operator>(const Scalar &lhs, const Scalar &rhs);
 bool operator>=(const Scalar &lhs, const Scalar &rhs);
 
+llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const Scalar &scalar);
+
 } // namespace lldb_private
 
 #endif // LLDB_UTILITY_SCALAR_H
Index: unittests/Expression/CMakeLists.txt
===
--- unittests/Expression/CMakeLists.txt
+++ unittests/Expression/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_lldb_unittest(ExpressionTests
+  DWARFExpressionTest.cpp
   ClangParserTest.cpp
 
   LINK_LIBS
@@ -6,4 +7,5 @@
 lldbPluginExpressionParserClang
 lldbUtility
 lldbUtilityHelpers
+LLVMTestingSupport
   )
Index: unittests/Expression/DWARFExpressionTest.cpp
===
--- unittests/Expression/DWARFExpressionTest.cpp
+++ unittests/Expression/DWARFExpressionTest.cpp
@@ -0,0 +1,42 @@
+//===-- DWARFExpressionTest.cpp --*- C++-*-===//
+//
+// 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
+//
+//===--===//
+
+#include "lldb/Expression/DWARFExpression.h"
+#include "lldb/Core/Value.h"
+#include "lldb/Core/dwarf.h"
+#include "lldb/Utility/StreamString.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/Testing/Support/Error.h"
+#include "gtest/gtest.h"
+
+using namespace lldb_private;
+
+static llvm::Expected Evaluate(llvm::ArrayRef expr) {
+  DataExtractor extractor(expr.data(), expr.size(), lldb::eByteOrderLittle,
+  /*addr_size*/ 4);
+
+  Value result;
+  Status status;
+  if (!DWARFExpression::Evaluate(
+  /*exe_ctx*/ nullptr, /*reg_ctx*/ nullptr, /*opcode_ctx*/ nullptr,
+  extractor, /*dwarf_cu*/ nullptr, /*offset*/ 0, expr.size(),
+  lldb::eRegisterKindLLDB, /*initial_value_ptr*/ nullptr,
+  /*object_address_ptr*/ nullptr, result, &status))
+return status.ToError();
+
+  return result.GetScalar();
+}
+
+TEST(DWARFExpression, DW_OP_pick) {
+  EXPECT_THAT_EXPECTED(Evaluate({DW_OP_lit1, DW_OP_lit0, DW_OP_pick, 0}),
+   llvm::HasValue(0));
+  EXPECT_THAT_EXPECTED(Evaluate({DW_OP_lit1, DW_OP_lit0, DW_OP_pick, 1}),
+   llvm::HasValue(1));
+  EXPECT_THAT_EXPECTED(Evaluate({DW_OP_lit1, DW_OP_lit0, DW_OP_pick, 2}),
+   llvm::Failed());
+}
Index: source/Utility/Scalar.cpp
===
--- source/Utility/Scalar.cpp
+++ source/Utility/Scalar.cpp
@@ -12,6 +12,7 @@
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Status.h"
 #include "lldb/Utility/Stream.h"
+#include "lldb/Utility/StreamString.h"
 #include "lldb/lldb-types.h"
 
 #include "llvm/ADT/SmallString.h"
@@ -2844,3 +2845,9 @@
   }
   return false;
 }
+
+llvm::raw_ostream &lldb_private::operator<<(llvm::raw_ostream &os, const Scalar &scalar) {
+  StreamString s;
+  scalar.GetValue(&s, /*show_type*/ true);
+  return os << s.GetString();
+}
Index: source/Expression/DWARFExpression.cpp
===
--- source/Expression/DWARFExpression.cpp
+++ source/Expression/DWARFExpression.cpp
@@ -1751,7 +1751,7 @@
 case DW_OP_pick: {
   uint8_t pick_idx = opcodes.GetU8(&offset);
   if (pick_idx < stack.size())
-stack.push_back(stack[pick_idx]);
+stack.push_back(stack[stack.size() - 1 - pick_idx]);
   else {
 if (error_ptr)
   error_ptr->SetErrorStringWithFormat(
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r359436 - DWARFExpression: Fix implementation of DW_OP_pick

2019-04-29 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Apr 29 03:55:22 2019
New Revision: 359436

URL: http://llvm.org/viewvc/llvm-project?rev=359436&view=rev
Log:
DWARFExpression: Fix implementation of DW_OP_pick

Summary:
The DWARF spec states that the DWARF stack arguments are numbered from
the top. Our implementation of DW_OP_pick was counting them from the
bottom.

This bug probably wasn't noticed because nobody (except my upcoming
postfix-to-DWARF converter) uses DW_OP_pick, but I've cross-checked with
gdb to confirm that counting from the top is the expected behavior.

This patch fixes the implementation to match the spec and gdb behavior
and adds a test.

Reviewers: jasonmolenda, clayborg

Subscribers: mgorny, aprantl, lldb-commits

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

Added:
lldb/trunk/unittests/Expression/DWARFExpressionTest.cpp
Modified:
lldb/trunk/include/lldb/Utility/Scalar.h
lldb/trunk/source/Expression/DWARFExpression.cpp
lldb/trunk/source/Utility/Scalar.cpp
lldb/trunk/unittests/Expression/CMakeLists.txt

Modified: lldb/trunk/include/lldb/Utility/Scalar.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Scalar.h?rev=359436&r1=359435&r2=359436&view=diff
==
--- lldb/trunk/include/lldb/Utility/Scalar.h (original)
+++ lldb/trunk/include/lldb/Utility/Scalar.h Mon Apr 29 03:55:22 2019
@@ -339,6 +339,8 @@ bool operator<=(const Scalar &lhs, const
 bool operator>(const Scalar &lhs, const Scalar &rhs);
 bool operator>=(const Scalar &lhs, const Scalar &rhs);
 
+llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const Scalar &scalar);
+
 } // namespace lldb_private
 
 #endif // LLDB_UTILITY_SCALAR_H

Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=359436&r1=359435&r2=359436&view=diff
==
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Mon Apr 29 03:55:22 2019
@@ -1751,7 +1751,7 @@ bool DWARFExpression::Evaluate(
 case DW_OP_pick: {
   uint8_t pick_idx = opcodes.GetU8(&offset);
   if (pick_idx < stack.size())
-stack.push_back(stack[pick_idx]);
+stack.push_back(stack[stack.size() - 1 - pick_idx]);
   else {
 if (error_ptr)
   error_ptr->SetErrorStringWithFormat(

Modified: lldb/trunk/source/Utility/Scalar.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Scalar.cpp?rev=359436&r1=359435&r2=359436&view=diff
==
--- lldb/trunk/source/Utility/Scalar.cpp (original)
+++ lldb/trunk/source/Utility/Scalar.cpp Mon Apr 29 03:55:22 2019
@@ -12,6 +12,7 @@
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Status.h"
 #include "lldb/Utility/Stream.h"
+#include "lldb/Utility/StreamString.h"
 #include "lldb/lldb-types.h"
 
 #include "llvm/ADT/SmallString.h"
@@ -2844,3 +2845,9 @@ bool Scalar::SetBit(uint32_t bit) {
   }
   return false;
 }
+
+llvm::raw_ostream &lldb_private::operator<<(llvm::raw_ostream &os, const 
Scalar &scalar) {
+  StreamString s;
+  scalar.GetValue(&s, /*show_type*/ true);
+  return os << s.GetString();
+}

Modified: lldb/trunk/unittests/Expression/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Expression/CMakeLists.txt?rev=359436&r1=359435&r2=359436&view=diff
==
--- lldb/trunk/unittests/Expression/CMakeLists.txt (original)
+++ lldb/trunk/unittests/Expression/CMakeLists.txt Mon Apr 29 03:55:22 2019
@@ -1,4 +1,5 @@
 add_lldb_unittest(ExpressionTests
+  DWARFExpressionTest.cpp
   ClangParserTest.cpp
 
   LINK_LIBS
@@ -6,4 +7,5 @@ add_lldb_unittest(ExpressionTests
 lldbPluginExpressionParserClang
 lldbUtility
 lldbUtilityHelpers
+LLVMTestingSupport
   )

Added: lldb/trunk/unittests/Expression/DWARFExpressionTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Expression/DWARFExpressionTest.cpp?rev=359436&view=auto
==
--- lldb/trunk/unittests/Expression/DWARFExpressionTest.cpp (added)
+++ lldb/trunk/unittests/Expression/DWARFExpressionTest.cpp Mon Apr 29 03:55:22 
2019
@@ -0,0 +1,42 @@
+//===-- DWARFExpressionTest.cpp --*- 
C++-*-===//
+//
+// 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
+//
+//===--===//
+
+#include "lldb/Expression/DWARFExpression.h"
+#include "lldb/Core/Value.h"
+#include "lldb/Core/dwarf.h"
+#include "lldb/Utility/S

[Lldb-commits] [PATCH] D61183: PostfixExpression: Introduce CFANode

2019-04-29 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D61183#1480948 , @clayborg wrote:

> FYI: for all DWARF expressions found in EH frame stuff, they expect the CFA 
> address to be pushed onto the stack prior to executing the expression. Do we 
> just want to follow suit with the these expressions and avoid the extra 
> needed node?


That is exactly what I am doing, and that's why I need D61018 
 for this to work, because right now we 
actually *aren't* pushing the cfa value to the dwarf stack.

However, I still need some kind of a  node in the expression AST, so that the 
DWARF generator knows that it should insert a reference to the initial value.

Now theoretically, the dwarf codegen could be made smarter and try to optimize 
the generated expression. So for instance for an expression like ".cfa 8 +" it 
could be made to generate "DW_OP_lit8, DW_OP_plus" instead of the current 
"DW_OP_pick 0, DW_OP_uconst 8, DW_OP_plus". However, I don't see a need for 
that now, particularly, as this expression can be completely optimized away by 
using the "isCFAPlusOffset" mode of the UnwindPlan (which is something I plan 
to look at).

However, this got me thinking about the name of the special node, and I 
concluded that a better name would be the "InitialValueNode", reflecting it's 
usage instead of what it is supposed to contain. That way, it can be used in 
other situations where an initial value is present on the dwarf stack, and the 
name CFANode can remain free for the cases where one has to emit an explicit 
opcode (DW_OP_call_frame_cfa) in order to retrieve it.


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

https://reviews.llvm.org/D61183



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


[Lldb-commits] [PATCH] D61183: PostfixExpression: Introduce CFANode

2019-04-29 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 197086.
labath added a comment.

s/CFA/InitialValue/


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

https://reviews.llvm.org/D61183

Files:
  include/lldb/Symbol/PostfixExpression.h
  source/Symbol/PostfixExpression.cpp
  unittests/Symbol/PostfixExpressionTest.cpp

Index: unittests/Symbol/PostfixExpressionTest.cpp
===
--- unittests/Symbol/PostfixExpressionTest.cpp
+++ unittests/Symbol/PostfixExpressionTest.cpp
@@ -44,6 +44,8 @@
  Dispatch(binary.Left()), Dispatch(binary.Right()));
   }
 
+  std::string Visit(InitialValueNode &, Node *&) override { return "InitialValue"; }
+
   std::string Visit(IntegerNode &integer, Node *&) override {
 return llvm::formatv("int({0})", integer.GetValue());
   }
@@ -105,6 +107,9 @@
   if (!ast)
 return "Parse failed.";
   if (!ResolveSymbols(ast, [&](SymbolNode &symbol) -> Node * {
+if (symbol.GetName() == "INIT")
+  return MakeNode(alloc);
+
 uint32_t num;
 if (to_integer(symbol.GetName().drop_front(), num))
   return MakeNode(alloc, num);
@@ -138,6 +143,17 @@
 
   EXPECT_EQ("DW_OP_bregx 65 0", ParseAndGenerateDWARF("R65"));
 
+  EXPECT_EQ("DW_OP_pick 0x00", ParseAndGenerateDWARF("INIT"));
+
+  EXPECT_EQ("DW_OP_pick 0x00, DW_OP_pick 0x01, DW_OP_plus ",
+ParseAndGenerateDWARF("INIT INIT +"));
+
+  EXPECT_EQ("DW_OP_breg1 +0, DW_OP_pick 0x01, DW_OP_plus ",
+ParseAndGenerateDWARF("R1 INIT +"));
+
+  EXPECT_EQ("DW_OP_constu 0x1, DW_OP_pick 0x01, DW_OP_deref , DW_OP_plus ",
+ParseAndGenerateDWARF("1 INIT ^ +"));
+
   EXPECT_EQ("DW_OP_constu 0x4, DW_OP_constu 0x5, DW_OP_plus ",
 ParseAndGenerateDWARF("4 5 +"));
 
Index: source/Symbol/PostfixExpression.cpp
===
--- source/Symbol/PostfixExpression.cpp
+++ source/Symbol/PostfixExpression.cpp
@@ -96,8 +96,9 @@
 return Dispatch(binary.Left()) && Dispatch(binary.Right());
   }
 
-  bool Visit(IntegerNode &integer, Node *&) override { return true; }
-  bool Visit(RegisterNode ®, Node *&) override { return true; }
+  bool Visit(InitialValueNode &, Node *&) override { return true; }
+  bool Visit(IntegerNode &, Node *&) override { return true; }
+  bool Visit(RegisterNode &, Node *&) override { return true; }
 
   bool Visit(SymbolNode &symbol, Node *&ref) override {
 if (Node *replacement = m_replacer(symbol)) {
@@ -125,9 +126,12 @@
 private:
   void Visit(BinaryOpNode &binary, Node *&);
 
+  void Visit(InitialValueNode &val, Node *&);
+
   void Visit(IntegerNode &integer, Node *&) {
 m_out_stream.PutHex8(DW_OP_constu);
 m_out_stream.PutULEB128(integer.GetValue());
+++m_stack_depth;
   }
 
   void Visit(RegisterNode ®, Node *&);
@@ -139,6 +143,14 @@
   void Visit(UnaryOpNode &unary, Node *&);
 
   Stream &m_out_stream;
+
+  /// The number keeping track of the evaluation stack depth at any given
+  /// moment. Used for implementing InitialValueNodes. If we have
+  /// InitialValueNodes in our input expression, we assume the initial stack
+  /// will contain their value (hence we start with m_stack_depth = 1). If we
+  /// don't have InitialValueNodes, this value is not used, and so its starting
+  /// value does not matter.
+  size_t m_stack_depth = 1;
 };
 } // namespace
 
@@ -166,6 +178,16 @@
 m_out_stream.PutHex8(DW_OP_and);
 break;
   }
+  --m_stack_depth; // Two pops, one push.
+}
+
+void DWARFCodegen::Visit(InitialValueNode &, Node *&) {
+  // We never go below the initial stack, so we can pick the initial value from
+  // the bottom of the stack at any moment.
+  assert(m_stack_depth >= 1);
+  m_out_stream.PutHex8(DW_OP_pick);
+  m_out_stream.PutHex8(m_stack_depth - 1);
+  ++m_stack_depth;
 }
 
 void DWARFCodegen::Visit(RegisterNode ®, Node *&) {
@@ -179,6 +201,7 @@
 m_out_stream.PutHex8(DW_OP_breg0 + reg_num);
 
   m_out_stream.PutSLEB128(0);
+  ++m_stack_depth;
 }
 
 void DWARFCodegen::Visit(UnaryOpNode &unary, Node *&) {
@@ -189,6 +212,7 @@
 m_out_stream.PutHex8(DW_OP_deref);
 break;
   }
+  // Stack depth unchanged.
 }
 
 bool postfix::ResolveSymbols(
Index: include/lldb/Symbol/PostfixExpression.h
===
--- include/lldb/Symbol/PostfixExpression.h
+++ include/lldb/Symbol/PostfixExpression.h
@@ -29,6 +29,7 @@
 public:
   enum Kind {
 BinaryOp,
+InitialValue,
 Integer,
 Register,
 Symbol,
@@ -73,6 +74,16 @@
   Node *m_right;
 };
 
+/// A node representing the canonical frame address.
+class InitialValueNode: public Node {
+public:
+  InitialValueNode() : Node(InitialValue) {}
+
+  static bool classof(const Node *node) {
+return node->GetKind() == InitialValue;
+  }
+};
+
 /// A node representing an integer literal.
 class IntegerNode : public Node {
 public:
@@ -153,6 +164,7 @@
   virtual ~Visitor() = defaul

Re: [Lldb-commits] [PATCH] D61090: [SBHostOS} Remove getting the python script interpreter path

2019-04-29 Thread Pavel Labath via lldb-commits

On 26/04/2019 19:34, Jim Ingham wrote:




On Apr 26, 2019, at 1:29 AM, Pavel Labath via Phabricator 
 wrote:

labath added a comment.

In D61090#1479049 , @jingham wrote:


I really thought there was one at the SB layer, because in terms of design that is 
what makes sense.  I guess we never really needed it until now, so we didn't add 
it.  Once there's more than one hard-coded script interpreter, we will need to add 
some way to select & direct scripts at the various script interpreters so we 
will need SBScriptInterpreter at the SB layer.  So maybe now is the time to add it 
in preparation...

Also, the fact that at the lldb_private layer, the ScriptInterpreter is held 
onto by the CommandInterpreter is clearly wrong.  The CommandInterpreter should 
have a member that tells it the currently selected ScriptInterpreter, but the 
list of script interpreters should belong to the Debugger.  We should probably 
disentangle that at the same time.



Yes, it sounds like we should have a SBScriptInterpreter at some point. Though, 
right now, it's not really clear to me what will it's exact role be, so I would 
tend to agree with Greg that we wait until we have a real use case for it (so 
we don't commit to a design we may want to change later).


At this point we could get away with adding is 
"SBDebugger::GetSelectedScriptInterpreter()" and 
"SBScriptInterpreter::GetLLDBScriptModulePath" - that would be sufficient to move the 
responsibility for finding this path to the correct place.  Those don't seem controversial to me.  
I agree sketching in selecting interpreters and invoking scripts on the would not be a good choice 
till we have something more concrete to play with.


No that part doesn't seem too controversial. My point just was that if 
we're going to keep the SBHostOS method working for backwards compat, 
then we might as well have it be the only way of retrieving the python 
path for now.


OTOH, if you are actually getting to a point where you need to "select" 
a script interpreter, then doing this now sounds like a natural step (I 
know you want to make the python version selectable at runtime, but I 
have no idea how exactly do you intend to achieve that).








As an aside, IIUC, the current work to support either Python flavor only supports 
one interpreter at a time because Python doesn't support loading Python 2 & 3 
into the same process?


I've heard someone say that, and I can believe that is the official party line of the 
python project, but I haven't investigated how "true" that statement is. E.g., 
I'm pretty sure we could get it to work by using some of the fancier flags of dlopen 
(RTLD_LOCAL, or the new namespace thingies present on linux), but that may take more 
effort than it's worth..



Interesting.  If/when we get to supporting fairly different scripting languages, it will be 
important to be able to load them all to support "I got cool formatter in scripting 
language X from person A and another in language Y from person B and I need to use them in 
the same debugging session".  But for now it seems more likely you're either going to 
convert all your Python scripts from 2 -> 3 or leave them in 2, so this doesn't seem 
crucial for Python support.  The only use-case where this is slightly motivated is apps like 
Xcode that create many debug sessions in the same lldb binary.  This would force them to 
make a choice of 2 vrs. 3 for all sessions.



I suppose XCode could just launch two lldb binaries instead of one, and 
choose the process to host a debug session depending on the requested 
python version (?)


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


[Lldb-commits] [lldb] r359440 - [lldb] [test] Remove duplicate YMM/ZMM dotest tests

2019-04-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Apr 29 04:38:17 2019
New Revision: 359440

URL: http://llvm.org/viewvc/llvm-project?rev=359440&view=rev
Log:
[lldb] [test] Remove duplicate YMM/ZMM dotest tests

Removed:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/intel_avx/

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


[Lldb-commits] [PATCH] D61221: [lldb] [lit] Introduce tests for writing x86 general-purpose registers

2019-04-29 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB359441: [lldb] [lit] Introduce tests for writing x86 
general-purpose registers (authored by mgorny, committed by ).
Herald added a subscriber: teemperor.
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D61221?vs=196954&id=197092#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61221

Files:
  lit/Register/Inputs/x86-64-gp-write.cpp
  lit/Register/Inputs/x86-gp-write.cpp
  lit/Register/x86-64-gp-write.test
  lit/Register/x86-gp-write.test

Index: lit/Register/x86-64-gp-write.test
===
--- lit/Register/x86-64-gp-write.test
+++ lit/Register/x86-64-gp-write.test
@@ -0,0 +1,26 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86_64
+# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-64-gp-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write rax 0x0102030405060708
+register write rbx 0x1112131415161718
+register write rcx 0x2122232425262728
+register write rdx 0x3132333435363738
+register write rsp 0x4142434445464748
+register write rbp 0x5152535455565758
+register write rsi 0x6162636465666768
+register write rdi 0x7172737475767778
+
+process continue
+# CHECK-DAG: rax = 0x0102030405060708
+# CHECK-DAG: rbx = 0x1112131415161718
+# CHECK-DAG: rcx = 0x2122232425262728
+# CHECK-DAG: rdx = 0x3132333435363738
+# CHECK-DAG: rsp = 0x4142434445464748
+# CHECK-DAG: rbp = 0x5152535455565758
+# CHECK-DAG: rsi = 0x6162636465666768
+# CHECK-DAG: rdi = 0x7172737475767778
+
+# CHECK: Process {{[0-9]+}} exited with status = 0
Index: lit/Register/Inputs/x86-64-gp-write.cpp
===
--- lit/Register/Inputs/x86-64-gp-write.cpp
+++ lit/Register/Inputs/x86-64-gp-write.cpp
@@ -0,0 +1,55 @@
+#include 
+#include 
+#include 
+
+int main() {
+  constexpr uint64_t fill = 0x0F0F0F0F0F0F0F0F;
+
+  uint64_t rax, rbx, rcx, rdx, rsp, rbp, rsi, rdi;
+
+  asm volatile(
+// save rsp & rbp
+"movq%%rsp, %%mm0\n\t"
+"movq%%rbp, %%mm1\n\t"
+"\n\t"
+"movq%8, %%rax\n\t"
+"movq%8, %%rbx\n\t"
+"movq%8, %%rcx\n\t"
+"movq%8, %%rdx\n\t"
+"movq%8, %%rsp\n\t"
+"movq%8, %%rbp\n\t"
+"movq%8, %%rsi\n\t"
+"movq%8, %%rdi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+"movq%%rax, %0\n\t"
+"movq%%rbx, %1\n\t"
+"movq%%rcx, %2\n\t"
+"movq%%rdx, %3\n\t"
+"movq%%rsp, %4\n\t"
+"movq%%rbp, %5\n\t"
+"movq%%rsi, %6\n\t"
+"movq%%rdi, %7\n\t"
+"\n\t"
+// restore rsp & rbp
+"movq%%mm0, %%rsp\n\t"
+"movq%%mm1, %%rbp\n\t"
+: "=r"(rax), "=r"(rbx), "=r"(rcx), "=r"(rdx), "=r"(rsp), "=r"(rbp),
+  "=r"(rsi), "=r"(rdi)
+: "g"(fill)
+: "%rax", "%rbx", "%rcx", "%rdx", "%rsp", "%rbp", "%rsi", "%rdi", "%mm0",
+  "%mm1"
+  );
+
+  printf("rax = 0x%016" PRIx64 "\n", rax);
+  printf("rbx = 0x%016" PRIx64 "\n", rbx);
+  printf("rcx = 0x%016" PRIx64 "\n", rcx);
+  printf("rdx = 0x%016" PRIx64 "\n", rdx);
+  printf("rsp = 0x%016" PRIx64 "\n", rsp);
+  printf("rbp = 0x%016" PRIx64 "\n", rbp);
+  printf("rsi = 0x%016" PRIx64 "\n", rsi);
+  printf("rdi = 0x%016" PRIx64 "\n", rdi);
+
+  return 0;
+}
Index: lit/Register/Inputs/x86-gp-write.cpp
===
--- lit/Register/Inputs/x86-gp-write.cpp
+++ lit/Register/Inputs/x86-gp-write.cpp
@@ -0,0 +1,61 @@
+#include 
+#include 
+#include 
+
+int main() {
+  constexpr uint32_t fill = 0x0F0F0F0F;
+
+  uint32_t eax, ebx, ecx, edx, esp, ebp, esi, edi;
+
+  asm volatile(
+// save esp & ebp
+"movd%%esp, %%mm0\n\t"
+"movd%%ebp, %%mm1\n\t"
+"\n\t"
+"movl%8, %%eax\n\t"
+"movl%8, %%ebx\n\t"
+"movl%8, %%ecx\n\t"
+"movl%8, %%edx\n\t"
+"movl%8, %%esp\n\t"
+"movl%8, %%ebp\n\t"
+"movl%8, %%esi\n\t"
+"movl%8, %%edi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+// first save new esp & ebp, and restore their original values, so that
+// we can output values via memory
+"movd%%esp, %%mm2\n\t"
+"movd%%ebp, %%mm3\n\t"
+"movd%%mm0, %%esp\n\t"
+"movd%%mm1, %%ebp\n\t"
+"\n\t"
+// output values via memory
+"movl%%eax, %0\n\t"
+"movl%%ebx, %1\n\t"
+"movl%%ecx, %2\n\t"
+"movl%%edx, %3\n\t"
+"movl%%esi, %6\n\t"
+"movl%%edi, %7\n\t"
+"\n\t"
+// output saved esp & ebp
+"movd%%mm2, %4\n\t"
+"movd%%mm3, %5\n\t"
+: "=m"(eax), "=m"(ebx), "=m"(ecx), "=m"(edx), "=a"(esp), "=b"(ebp),
+  "=m"(esi), "=m"(edi)
+: "i"(fill)
+: "%ecx", "%edx", "%esp", "%ebp", "%esi", "%edi", "%mm0", "%mm1", "%mm2",
+  "%mm3"
+  );
+
+  printf("eax = 0x%08" PRIx32 "\n", eax);

[Lldb-commits] [lldb] r359438 - [lldb] [lit] Introduce tests for reading x86 general purpose registers

2019-04-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Apr 29 04:37:58 2019
New Revision: 359438

URL: http://llvm.org/viewvc/llvm-project?rev=359438&view=rev
Log:
[lldb] [lit] Introduce tests for reading x86 general purpose registers

Introduce tests for reading the eight x86 general purpose registers,
i.e. RAX/RBX/RCX/RDX/RBP/RSP/RSI/RDI and their shorter counterparts.
The test comes in separate 32-bit and 64-bit variant, targeting
appropriate processors.

While technically the 32-bit test could run on amd64, it would be
redundant to the 64-bit version, so just run one of them on each arch.

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

Added:
lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp
lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp
lldb/trunk/lit/Register/x86-64-gp-read.test
lldb/trunk/lit/Register/x86-gp-read.test

Added: lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp?rev=359438&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-64-gp-read.cpp Mon Apr 29 04:37:58 2019
@@ -0,0 +1,40 @@
+#include 
+
+int main() {
+  constexpr uint64_t rax = 0x0102030405060708;
+  constexpr uint64_t rbx = 0x1112131415161718;
+  constexpr uint64_t rcx = 0x2122232425262728;
+  constexpr uint64_t rdx = 0x3132333435363738;
+  constexpr uint64_t rsp = 0x4142434445464748;
+  constexpr uint64_t rbp = 0x5152535455565758;
+  constexpr uint64_t rsi = 0x6162636465666768;
+  constexpr uint64_t rdi = 0x7172737475767778;
+
+  asm volatile(
+// save rsp & rbp
+"movq%%rsp, %%r8\n\t"
+"movq%%rbp, %%r9\n\t"
+"\n\t"
+"movq%0, %%rax\n\t"
+"movq%1, %%rbx\n\t"
+"movq%2, %%rcx\n\t"
+"movq%3, %%rdx\n\t"
+"movq%4, %%rsp\n\t"
+"movq%5, %%rbp\n\t"
+"movq%6, %%rsi\n\t"
+"movq%7, %%rdi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+// restore rsp & rbp
+"movq%%r8, %%rsp\n\t"
+"movq%%r9, %%rbp"
+:
+: "i"(rax), "i"(rbx), "i"(rcx), "i"(rdx), "i"(rsp), "i"(rbp), "i"(rsi),
+  "i"(rdi)
+: "%rax", "%rbx", "%rcx", "%rdx", "%rsp", "%rbp", "%rsi", "%rdi", "%r8",
+  "%r9"
+  );
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp?rev=359438&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-gp-read.cpp Mon Apr 29 04:37:58 2019
@@ -0,0 +1,40 @@
+#include 
+
+int main() {
+  constexpr uint32_t eax = 0x05060708;
+  constexpr uint32_t ebx = 0x15161718;
+  constexpr uint32_t ecx = 0x25262728;
+  constexpr uint32_t edx = 0x35363738;
+  constexpr uint32_t esp = 0x45464748;
+  constexpr uint32_t ebp = 0x55565758;
+  constexpr uint32_t esi = 0x65666768;
+  constexpr uint32_t edi = 0x75767778;
+
+  asm volatile(
+// save esp & ebp
+"movd%%esp, %%mm0\n\t"
+"movd%%ebp, %%mm1\n\t"
+"\n\t"
+"movl%0, %%eax\n\t"
+"movl%1, %%ebx\n\t"
+"movl%2, %%ecx\n\t"
+"movl%3, %%edx\n\t"
+"movl%4, %%esp\n\t"
+"movl%5, %%ebp\n\t"
+"movl%6, %%esi\n\t"
+"movl%7, %%edi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+// restore esp & ebp
+"movd%%mm0, %%esp\n\t"
+"movd%%mm1, %%ebp\n\t"
+:
+: "i"(eax), "i"(ebx), "i"(ecx), "i"(edx), "i"(esp), "i"(ebp), "i"(esi),
+  "i"(edi)
+: "%eax", "%ebx", "%ecx", "%edx", "%esp", "%ebp", "%esi", "%edi", "%mm0",
+  "%mm1"
+  );
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-gp-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-gp-read.test?rev=359438&view=auto
==
--- lldb/trunk/lit/Register/x86-64-gp-read.test (added)
+++ lldb/trunk/lit/Register/x86-64-gp-read.test Mon Apr 29 04:37:58 2019
@@ -0,0 +1,42 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86_64
+# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-64-gp-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register read --all
+# CHECK-DAG: rax = 0x0102030405060708
+# CHECK-DAG: rbx = 0x1112131415161718
+# CHECK-DAG: rcx = 0x2122232425262728
+# CHECK-DAG: rdx = 0x3132333435363738
+# CHECK-DAG: rdi = 0x7172737475767778
+# CHECK-DAG: rsi = 0x6162636465666768
+# CHECK-DAG: rbp = 0x5152535455565758
+# CHECK-DAG: rsp = 0x4142434445464748
+# CHECK-DAG: eax = 0x05060708
+# CHECK-DAG: ebx = 0x15161718
+# CHECK-DAG: ecx = 0x25262728
+# CHECK-DAG: edx = 0x35363738
+# CHECK-DAG: edi = 0x75767778
+# CHECK-DAG: esi = 0x65666768
+# CHECK-DAG: ebp = 0x55565758
+# CHECK-DAG: esp = 0x45464748
+# CHECK-DAG: ax = 0x0708
+# CHECK-DAG: bx = 0x1718
+# CHECK-D

[Lldb-commits] [lldb] r359439 - [lldb] [lit] Add tests for reading ZMM registers (AVX512)

2019-04-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Apr 29 04:38:10 2019
New Revision: 359439

URL: http://llvm.org/viewvc/llvm-project?rev=359439&view=rev
Log:
[lldb] [lit] Add tests for reading ZMM registers (AVX512)

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

Added:
lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp
lldb/trunk/lit/Register/x86-64-zmm-read.test
lldb/trunk/lit/Register/x86-zmm-read.test
Modified:
lldb/trunk/utils/lit-cpuid/lit-cpuid.cpp

Added: lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp?rev=359439&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-zmm-read.cpp Mon Apr 29 04:38:10 2019
@@ -0,0 +1,196 @@
+#include 
+
+struct alignas(64) zmm_t {
+  uint64_t a, b, c, d, e, f, g, h;
+};
+
+int main() {
+  zmm_t zmm0 = { 0x020406080A0C0E01, 0x030507090B0D0F00,
+ 0x838587898B8D8F80, 0x828486888A8C8E81,
+ 0x424446484A4C4E41, 0x434547494B4D4F40,
+ 0xC3C5C7C9CBCDCFC0, 0xC2C4C6C8CACCCEC1 };
+  zmm_t zmm1 = { 0x121416181A1C1E11, 0x131517191B1D1F10,
+ 0x939597999B9D9F90, 0x929496989A9C9E91,
+ 0x525456585A5C5E51, 0x535557595B5D5F50,
+ 0xD3D5D7D9DBDDDFD0, 0xD2D4D6D8DADCDED1 };
+  zmm_t zmm2 = { 0x222426282A2C2E21, 0x232527292B2D2F20,
+ 0xA3A5A7A9ABADAFA0, 0xA2A4A6A8AAACAEA1,
+ 0x626466686A6C6E61, 0x636567696B6D6F60,
+ 0xE3E5E7E9EBEDEFE0, 0xE2E4E6E8EAECEEE1 };
+  zmm_t zmm3 = { 0x323436383A3C3E31, 0x333537393B3D3F30,
+ 0xB3B5B7B9BBBDBFB0, 0xB2B4B6B8BABCBEB1,
+ 0x727476787A7C7E71, 0x737577797B7D7F70,
+ 0xF3F5F7F9FBFDFFF0, 0xF2F4F6F8FAFCFEF1 };
+  zmm_t zmm4 = { 0x424446484A4C4E41, 0x434547494B4D4F40,
+ 0xC3C5C7C9CBCDCFC0, 0xC2C4C6C8CACCCEC1,
+ 0x828486888A8C8E81, 0x838587898B8D8F80,
+ 0x030507090B0D0F00, 0x020406080A0C0E01 };
+  zmm_t zmm5 = { 0x525456585A5C5E51, 0x535557595B5D5F50,
+ 0xD3D5D7D9DBDDDFD0, 0xD2D4D6D8DADCDED1,
+ 0x929496989A9C9E91, 0x939597999B9D9F90,
+ 0x131517191B1D1F10, 0x121416181A1C1E11 };
+  zmm_t zmm6 = { 0x626466686A6C6E61, 0x636567696B6D6F60,
+ 0xE3E5E7E9EBEDEFE0, 0xE2E4E6E8EAECEEE1,
+ 0xA2A4A6A8AAACAEA1, 0xA3A5A7A9ABADAFA0,
+ 0x232527292B2D2F20, 0x222426282A2C2E21 };
+  zmm_t zmm7 = { 0x727476787A7C7E71, 0x737577797B7D7F70,
+ 0xF3F5F7F9FBFDFFF0, 0xF2F4F6F8FAFCFEF1,
+ 0xB2B4B6B8BABCBEB1, 0xB3B5B7B9BBBDBFB0,
+ 0x333537393B3D3F30, 0x323436383A3C3E31 };
+#if defined(__x86_64__) || defined(_M_X64)
+  zmm_t zmm8 = { 0x828486888A8C8E81, 0x838587898B8D8F80,
+ 0x030507090B0D0F00, 0x020406080A0C0E01,
+ 0xC2C4C6C8CACCCEC1, 0xC3C5C7C9CBCDCFC0,
+ 0x434547494B4D4F40, 0x424446484A4C4E41 };
+  zmm_t zmm9 = { 0x929496989A9C9E91, 0x939597999B9D9F90,
+ 0x131517191B1D1F10, 0x121416181A1C1E11,
+ 0xD2D4D6D8DADCDED1, 0xD3D5D7D9DBDDDFD0,
+ 0x535557595B5D5F50, 0x525456585A5C5E51 };
+  zmm_t zmm10 = { 0xA2A4A6A8AAACAEA1, 0xA3A5A7A9ABADAFA0,
+  0x232527292B2D2F20, 0x222426282A2C2E21,
+  0xE2E4E6E8EAECEEE1, 0xE3E5E7E9EBEDEFE0,
+  0x636567696B6D6F60, 0x626466686A6C6E61 };
+  zmm_t zmm11 = { 0xB2B4B6B8BABCBEB1, 0xB3B5B7B9BBBDBFB0,
+  0x333537393B3D3F30, 0x323436383A3C3E31,
+  0xF2F4F6F8FAFCFEF1, 0xF3F5F7F9FBFDFFF0,
+  0x737577797B7D7F70, 0x727476787A7C7E71 };
+  zmm_t zmm12 = { 0xC2C4C6C8CACCCEC1, 0xC3C5C7C9CBCDCFC0,
+  0x434547494B4D4F40, 0x424446484A4C4E41,
+  0x020406080A0C0E01, 0x030507090B0D0F00,
+  0x838587898B8D8F80, 0x828486888A8C8E81 };
+  zmm_t zmm13 = { 0xD2D4D6D8DADCDED1, 0xD3D5D7D9DBDDDFD0,
+  0x535557595B5D5F50, 0x525456585A5C5E51,
+  0x121416181A1C1E11, 0x131517191B1D1F10,
+  0x939597999B9D9F90, 0x929496989A9C9E91 };
+  zmm_t zmm14 = { 0xE2E4E6E8EAECEEE1, 0xE3E5E7E9EBEDEFE0,
+  0x636567696B6D6F60, 0x626466686A6C6E61,
+  0x222426282A2C2E21, 0x232527292B2D2F20,
+  0xA3A5A7A9ABADAFA0, 0xA2A4A6A8AAACAEA1 };
+  zmm_t zmm15 = { 0xF2F4F6F8FAFCFEF1, 0xF3F5F7F9FBFDFFF0,
+  0x737577797B7D7F70, 0x727476787A7C7E71,
+  0x323436383A3C3E31, 0x333537393B3D3F30,
+  0xB3B5B7B9BBBDBFB0, 0xB2B4B6B8BABCBEB1 };
+  zmm_t zmm16 = { 0x030507090B0D0F00, 0x020406080A0C0E01,
+  0x828486888A8C8E81, 0x838587898B8D8F80,
+  0x434547494B4D4F40, 0x424446484A4C4E41,
+  0xC2C4C6C8CACCCEC1, 0xC3C5C7C9CBCDC

[Lldb-commits] [lldb] r359441 - [lldb] [lit] Introduce tests for writing x86 general-purpose registers

2019-04-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Apr 29 04:38:28 2019
New Revision: 359441

URL: http://llvm.org/viewvc/llvm-project?rev=359441&view=rev
Log:
[lldb] [lit] Introduce tests for writing x86 general-purpose registers

Introduce two initial tests for 'register write' command.  The tests
first clobber x86 general purpose registers, then call int3 to let lldb
write to them, then print the new values.  FileCheck takes care of
verifying whether correct values were written.

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

Added:
lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp
lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp
lldb/trunk/lit/Register/x86-64-gp-write.test
lldb/trunk/lit/Register/x86-gp-write.test

Added: lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp?rev=359441&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-64-gp-write.cpp Mon Apr 29 04:38:28 2019
@@ -0,0 +1,55 @@
+#include 
+#include 
+#include 
+
+int main() {
+  constexpr uint64_t fill = 0x0F0F0F0F0F0F0F0F;
+
+  uint64_t rax, rbx, rcx, rdx, rsp, rbp, rsi, rdi;
+
+  asm volatile(
+// save rsp & rbp
+"movq%%rsp, %%mm0\n\t"
+"movq%%rbp, %%mm1\n\t"
+"\n\t"
+"movq%8, %%rax\n\t"
+"movq%8, %%rbx\n\t"
+"movq%8, %%rcx\n\t"
+"movq%8, %%rdx\n\t"
+"movq%8, %%rsp\n\t"
+"movq%8, %%rbp\n\t"
+"movq%8, %%rsi\n\t"
+"movq%8, %%rdi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+"movq%%rax, %0\n\t"
+"movq%%rbx, %1\n\t"
+"movq%%rcx, %2\n\t"
+"movq%%rdx, %3\n\t"
+"movq%%rsp, %4\n\t"
+"movq%%rbp, %5\n\t"
+"movq%%rsi, %6\n\t"
+"movq%%rdi, %7\n\t"
+"\n\t"
+// restore rsp & rbp
+"movq%%mm0, %%rsp\n\t"
+"movq%%mm1, %%rbp\n\t"
+: "=r"(rax), "=r"(rbx), "=r"(rcx), "=r"(rdx), "=r"(rsp), "=r"(rbp),
+  "=r"(rsi), "=r"(rdi)
+: "g"(fill)
+: "%rax", "%rbx", "%rcx", "%rdx", "%rsp", "%rbp", "%rsi", "%rdi", "%mm0",
+  "%mm1"
+  );
+
+  printf("rax = 0x%016" PRIx64 "\n", rax);
+  printf("rbx = 0x%016" PRIx64 "\n", rbx);
+  printf("rcx = 0x%016" PRIx64 "\n", rcx);
+  printf("rdx = 0x%016" PRIx64 "\n", rdx);
+  printf("rsp = 0x%016" PRIx64 "\n", rsp);
+  printf("rbp = 0x%016" PRIx64 "\n", rbp);
+  printf("rsi = 0x%016" PRIx64 "\n", rsi);
+  printf("rdi = 0x%016" PRIx64 "\n", rdi);
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp?rev=359441&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-gp-write.cpp Mon Apr 29 04:38:28 2019
@@ -0,0 +1,61 @@
+#include 
+#include 
+#include 
+
+int main() {
+  constexpr uint32_t fill = 0x0F0F0F0F;
+
+  uint32_t eax, ebx, ecx, edx, esp, ebp, esi, edi;
+
+  asm volatile(
+// save esp & ebp
+"movd%%esp, %%mm0\n\t"
+"movd%%ebp, %%mm1\n\t"
+"\n\t"
+"movl%8, %%eax\n\t"
+"movl%8, %%ebx\n\t"
+"movl%8, %%ecx\n\t"
+"movl%8, %%edx\n\t"
+"movl%8, %%esp\n\t"
+"movl%8, %%ebp\n\t"
+"movl%8, %%esi\n\t"
+"movl%8, %%edi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+// first save new esp & ebp, and restore their original values, so that
+// we can output values via memory
+"movd%%esp, %%mm2\n\t"
+"movd%%ebp, %%mm3\n\t"
+"movd%%mm0, %%esp\n\t"
+"movd%%mm1, %%ebp\n\t"
+"\n\t"
+// output values via memory
+"movl%%eax, %0\n\t"
+"movl%%ebx, %1\n\t"
+"movl%%ecx, %2\n\t"
+"movl%%edx, %3\n\t"
+"movl%%esi, %6\n\t"
+"movl%%edi, %7\n\t"
+"\n\t"
+// output saved esp & ebp
+"movd%%mm2, %4\n\t"
+"movd%%mm3, %5\n\t"
+: "=m"(eax), "=m"(ebx), "=m"(ecx), "=m"(edx), "=a"(esp), "=b"(ebp),
+  "=m"(esi), "=m"(edi)
+: "i"(fill)
+: "%ecx", "%edx", "%esp", "%ebp", "%esi", "%edi", "%mm0", "%mm1", "%mm2",
+  "%mm3"
+  );
+
+  printf("eax = 0x%08" PRIx32 "\n", eax);
+  printf("ebx = 0x%08" PRIx32 "\n", ebx);
+  printf("ecx = 0x%08" PRIx32 "\n", ecx);
+  printf("edx = 0x%08" PRIx32 "\n", edx);
+  printf("esp = 0x%08" PRIx32 "\n", esp);
+  printf("ebp = 0x%08" PRIx32 "\n", ebp);
+  printf("esi = 0x%08" PRIx32 "\n", esi);
+  printf("edi = 0x%08" PRIx32 "\n", edi);
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-gp-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-gp-write.test?rev=359441&view=auto
==
--- lldb/trunk/lit/Register/x86-64-gp-write.test (added)
+++ lldb/trunk/lit

[Lldb-commits] [PATCH] D61210: [lldb] [lit] Introduce tests for reading x86 general purpose registers

2019-04-29 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB359438: [lldb] [lit] Introduce tests for reading x86 
general purpose registers (authored by mgorny, committed by ).
Herald added a subscriber: teemperor.
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D61210?vs=196952&id=197090#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61210

Files:
  lit/Register/Inputs/x86-64-gp-read.cpp
  lit/Register/Inputs/x86-gp-read.cpp
  lit/Register/x86-64-gp-read.test
  lit/Register/x86-gp-read.test

Index: lit/Register/x86-64-gp-read.test
===
--- lit/Register/x86-64-gp-read.test
+++ lit/Register/x86-64-gp-read.test
@@ -0,0 +1,42 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86_64
+# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-64-gp-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register read --all
+# CHECK-DAG: rax = 0x0102030405060708
+# CHECK-DAG: rbx = 0x1112131415161718
+# CHECK-DAG: rcx = 0x2122232425262728
+# CHECK-DAG: rdx = 0x3132333435363738
+# CHECK-DAG: rdi = 0x7172737475767778
+# CHECK-DAG: rsi = 0x6162636465666768
+# CHECK-DAG: rbp = 0x5152535455565758
+# CHECK-DAG: rsp = 0x4142434445464748
+# CHECK-DAG: eax = 0x05060708
+# CHECK-DAG: ebx = 0x15161718
+# CHECK-DAG: ecx = 0x25262728
+# CHECK-DAG: edx = 0x35363738
+# CHECK-DAG: edi = 0x75767778
+# CHECK-DAG: esi = 0x65666768
+# CHECK-DAG: ebp = 0x55565758
+# CHECK-DAG: esp = 0x45464748
+# CHECK-DAG: ax = 0x0708
+# CHECK-DAG: bx = 0x1718
+# CHECK-DAG: cx = 0x2728
+# CHECK-DAG: dx = 0x3738
+# CHECK-DAG: di = 0x7778
+# CHECK-DAG: si = 0x6768
+# CHECK-DAG: bp = 0x5758
+# CHECK-DAG: sp = 0x4748
+# CHECK-DAG: ah = 0x07
+# CHECK-DAG: bh = 0x17
+# CHECK-DAG: ch = 0x27
+# CHECK-DAG: dh = 0x37
+# CHECK-DAG: al = 0x08
+# CHECK-DAG: bl = 0x18
+# CHECK-DAG: cl = 0x28
+# CHECK-DAG: dl = 0x38
+
+process continue
+# CHECK: Process {{[0-9]+}} exited with status = 0
Index: lit/Register/Inputs/x86-64-gp-read.cpp
===
--- lit/Register/Inputs/x86-64-gp-read.cpp
+++ lit/Register/Inputs/x86-64-gp-read.cpp
@@ -0,0 +1,40 @@
+#include 
+
+int main() {
+  constexpr uint64_t rax = 0x0102030405060708;
+  constexpr uint64_t rbx = 0x1112131415161718;
+  constexpr uint64_t rcx = 0x2122232425262728;
+  constexpr uint64_t rdx = 0x3132333435363738;
+  constexpr uint64_t rsp = 0x4142434445464748;
+  constexpr uint64_t rbp = 0x5152535455565758;
+  constexpr uint64_t rsi = 0x6162636465666768;
+  constexpr uint64_t rdi = 0x7172737475767778;
+
+  asm volatile(
+// save rsp & rbp
+"movq%%rsp, %%r8\n\t"
+"movq%%rbp, %%r9\n\t"
+"\n\t"
+"movq%0, %%rax\n\t"
+"movq%1, %%rbx\n\t"
+"movq%2, %%rcx\n\t"
+"movq%3, %%rdx\n\t"
+"movq%4, %%rsp\n\t"
+"movq%5, %%rbp\n\t"
+"movq%6, %%rsi\n\t"
+"movq%7, %%rdi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+// restore rsp & rbp
+"movq%%r8, %%rsp\n\t"
+"movq%%r9, %%rbp"
+:
+: "i"(rax), "i"(rbx), "i"(rcx), "i"(rdx), "i"(rsp), "i"(rbp), "i"(rsi),
+  "i"(rdi)
+: "%rax", "%rbx", "%rcx", "%rdx", "%rsp", "%rbp", "%rsi", "%rdi", "%r8",
+  "%r9"
+  );
+
+  return 0;
+}
Index: lit/Register/Inputs/x86-gp-read.cpp
===
--- lit/Register/Inputs/x86-gp-read.cpp
+++ lit/Register/Inputs/x86-gp-read.cpp
@@ -0,0 +1,40 @@
+#include 
+
+int main() {
+  constexpr uint32_t eax = 0x05060708;
+  constexpr uint32_t ebx = 0x15161718;
+  constexpr uint32_t ecx = 0x25262728;
+  constexpr uint32_t edx = 0x35363738;
+  constexpr uint32_t esp = 0x45464748;
+  constexpr uint32_t ebp = 0x55565758;
+  constexpr uint32_t esi = 0x65666768;
+  constexpr uint32_t edi = 0x75767778;
+
+  asm volatile(
+// save esp & ebp
+"movd%%esp, %%mm0\n\t"
+"movd%%ebp, %%mm1\n\t"
+"\n\t"
+"movl%0, %%eax\n\t"
+"movl%1, %%ebx\n\t"
+"movl%2, %%ecx\n\t"
+"movl%3, %%edx\n\t"
+"movl%4, %%esp\n\t"
+"movl%5, %%ebp\n\t"
+"movl%6, %%esi\n\t"
+"movl%7, %%edi\n\t"
+"\n\t"
+"int3\n\t"
+"\n\t"
+// restore esp & ebp
+"movd%%mm0, %%esp\n\t"
+"movd%%mm1, %%ebp\n\t"
+:
+: "i"(eax), "i"(ebx), "i"(ecx), "i"(edx), "i"(esp), "i"(ebp), "i"(esi),
+  "i"(edi)
+: "%eax", "%ebx", "%ecx", "%edx", "%esp", "%ebp", "%esi", "%edi", "%mm0",
+  "%mm1"
+  );
+
+  return 0;
+}
Index: lit/Register/x86-gp-read.test
===
--- lit/Register/x86-gp-read.test
+++ lit/Register/x86-gp-read.test
@@ -0,0 +1,34 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86
+# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-gp-read.cpp -o %t
+# RUN: %lldb -b -s %s

[Lldb-commits] [PATCH] D61212: [lldb] [lit] Add tests for reading ZMM registers (AVX512)

2019-04-29 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB359439: [lldb] [lit] Add tests for reading ZMM registers 
(AVX512) (authored by mgorny, committed by ).
Herald added a subscriber: teemperor.
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D61212?vs=196951&id=197091#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61212

Files:
  lit/Register/Inputs/x86-zmm-read.cpp
  lit/Register/x86-64-zmm-read.test
  lit/Register/x86-zmm-read.test
  utils/lit-cpuid/lit-cpuid.cpp

Index: utils/lit-cpuid/lit-cpuid.cpp
===
--- utils/lit-cpuid/lit-cpuid.cpp
+++ utils/lit-cpuid/lit-cpuid.cpp
@@ -29,6 +29,8 @@
 outs() << "sse\n";
   if (features["avx"])
 outs() << "avx\n";
+  if (features["avx512f"])
+outs() << "avx512f\n";
 #endif
 
   return 0;
Index: lit/Register/x86-zmm-read.test
===
--- lit/Register/x86-zmm-read.test
+++ lit/Register/x86-zmm-read.test
@@ -0,0 +1,37 @@
+# XFAIL: system-freebsd
+# XFAIL: system-linux
+# XFAIL: system-netbsd
+# XFAIL: system-windows
+# REQUIRES: native && target-x86 && native-cpu-avx512f
+# RUN: %clangxx %p/Inputs/x86-zmm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register read --all
+# CHECK-DAG: xmm0 = {0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03}
+# CHECK-DAG: xmm1 = {0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13}
+# CHECK-DAG: xmm2 = {0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23}
+# CHECK-DAG: xmm3 = {0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33}
+# CHECK-DAG: xmm4 = {0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43}
+# CHECK-DAG: xmm5 = {0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53}
+# CHECK-DAG: xmm6 = {0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63}
+# CHECK-DAG: xmm7 = {0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73}
+# CHECK-DAG: ymm0 = {0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82}
+# CHECK-DAG: ymm1 = {0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92}
+# CHECK-DAG: ymm2 = {0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2}
+# CHECK-DAG: ymm3 = {0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2}
+# CHECK-DAG: ymm4 = {0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2}
+# CHECK-DAG: ymm5 = {0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2}
+# CHECK-DAG: ymm6 = {0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2}
+# CHECK-DAG: ymm7 = {0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2}
+# CHECK-DAG: zmm0 = {0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2}
+# CHECK-DAG: zmm1 = {0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2}
+# CHECK-DAG: zmm2 = {0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2}
+# CHECK-DAG: zmm3 = {0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0

Re: [Lldb-commits] [PATCH] D61191: Editline: Fix an msan error

2019-04-29 Thread Pavel Labath via lldb-commits

On 26/04/2019 18:56, Christos Zoulas wrote:

On Apr 26,  3:11pm, revi...@reviews.llvm.org (Pavel Labath via Phabricator) 
wrote:
-- Subject: [PATCH] D61191: Editline: Fix an msan error

|
| --b1_b299efcc557883c5ff30a5eebc16e12b
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: quoted-printable
|
| labath created this revision.
| labath added reviewers: christos, krytarowski, davide.
|
| Despite the documentation for the el_get(EL_GETTC) function claiming the
| vararg part is (const char *name, void *value), in reality the function
| expects the vararg list to be terminated by a null pointer, which can be
| clearly seen by examining the source code. Although this is mostly
| bening because the extra values are not used it any way, it still lights
| up as an error when running the tests under msan.
|
| Work around this quirk by adding an explicit nullptr to the end of the
| argument list.
|
|
| https://reviews.llvm.org/D61191

fixed, thanks!

christos




Oooh, thanks for the super-fast fix.

Just to confirm, by "fixed" you mean that it should now not be needed to 
terminate the vararg list with a null pointer?


Do you have anything (a revision, version number or something) that I 
can leave as a trail to future maintainers to remove this workaround 
when the fixed libedit becomes more widely available?


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


[Lldb-commits] [PATCH] D59537: Instantiate 'std' templates explicitly in the expression evaluator

2019-04-29 Thread Gabor Marton via Phabricator via lldb-commits
martong accepted this revision.
martong added a comment.
This revision is now accepted and ready to land.

In D59537#1481333 , @teemperor wrote:

> @martong See D59485  for the new ASTImporter 
> method for registering imported decls. I created the method in the 
> ASTImporter as the only dependency on the ASTNodeImporter is 
> `InitializeImportedDecl` which only imports more decl attributes/flags and 
> doesn't update any internal ASTImporter state from what I can tell.


Raphael, thank you for working on this. Looks good to me now.


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

https://reviews.llvm.org/D59537



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


[Lldb-commits] [PATCH] D59485: [ASTImporter] Add an ImportImpl method to allow customizing Import behavior.

2019-04-29 Thread Gabor Marton via Phabricator via lldb-commits
martong accepted this revision.
martong added a comment.

Looks good, thanks!


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

https://reviews.llvm.org/D59485



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


Re: [Lldb-commits] [PATCH] D61191: Editline: Fix an msan error

2019-04-29 Thread Christos Zoulas via lldb-commits
Yes, you don't need to NULL terminate the argument list now.
Here's a link to the commit:
http://mail-index.netbsd.org/source-changes/2019/04/26/msg105454.html 


Best,

christos

> On Apr 29, 2019, at 7:39 AM, Pavel Labath  wrote:
> 
> On 26/04/2019 18:56, Christos Zoulas wrote:
>> On Apr 26,  3:11pm, revi...@reviews.llvm.org (Pavel Labath via Phabricator) 
>> wrote:
>> -- Subject: [PATCH] D61191: Editline: Fix an msan error
>> |
>> | --b1_b299efcc557883c5ff30a5eebc16e12b
>> | Content-Type: text/plain; charset=us-ascii
>> | Content-Transfer-Encoding: quoted-printable
>> |
>> | labath created this revision.
>> | labath added reviewers: christos, krytarowski, davide.
>> |
>> | Despite the documentation for the el_get(EL_GETTC) function claiming the
>> | vararg part is (const char *name, void *value), in reality the function
>> | expects the vararg list to be terminated by a null pointer, which can be
>> | clearly seen by examining the source code. Although this is mostly
>> | bening because the extra values are not used it any way, it still lights
>> | up as an error when running the tests under msan.
>> |
>> | Work around this quirk by adding an explicit nullptr to the end of the
>> | argument list.
>> |
>> |
>> | https://reviews.llvm.org/D61191
>> fixed, thanks!
>> christos
> 
> 
> Oooh, thanks for the super-fast fix.
> 
> Just to confirm, by "fixed" you mean that it should now not be needed to 
> terminate the vararg list with a null pointer?
> 
> Do you have anything (a revision, version number or something) that I can 
> leave as a trail to future maintainers to remove this workaround when the 
> fixed libedit becomes more widely available?
> 
> pl

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


[Lldb-commits] [PATCH] D59485: [ASTImporter] Add an ImportImpl method to allow customizing Import behavior.

2019-04-29 Thread Gabor Marton via Phabricator via lldb-commits
martong added inline comments.



Comment at: clang/unittests/AST/ASTImporterTest.cpp:625
+  "class shouldNotBeImported {};", Lang_CXX, "class realDecl {};", 
Lang_CXX,
+  "shouldNotBeImported", RedirectingImporter::Constructor);
+  auto *Imported = cast(To);

I just realized that maybe we could simplify and make this part more elegant:
If `ASTImporterTestBase` had a data member with the type `ImporterConstructor` 
then we could overwrite that data member in the constructor of `CustomImporter`.
(The `ASTImporter` is created lazily when the first `getImportedDecl` is 
called, but by that time the creator is already set, so this will work.)
This way we could elide the last argument here 
(`RedirectingImporter::Constructor`) and in all subsequent `TEST_P` tests, it 
would be enough to set up the creator per test fixture.



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

https://reviews.llvm.org/D59485



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


[Lldb-commits] [PATCH] D61191: Editline: Fix an msan error

2019-04-29 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB359449: Editline: Fix an msan error (authored by labath, 
committed by ).
Herald added a subscriber: abidh.
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D61191?vs=196855&id=197104#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61191

Files:
  source/Host/common/Editline.cpp


Index: source/Host/common/Editline.cpp
===
--- source/Host/common/Editline.cpp
+++ source/Host/common/Editline.cpp
@@ -1215,9 +1215,13 @@
   if (m_editline != nullptr) {
 el_resize(m_editline);
 int columns;
-// Despite the man page claiming non-zero indicates success, it's actually
-// zero
-if (el_get(m_editline, EL_GETTC, "co", &columns) == 0) {
+// This function is documenting as taking (const char *, void *) for the
+// vararg part, but in reality in was consuming arguments until the first
+// null pointer. This was fixed in libedit in April 2019
+// ,
+// but we're keeping the workaround until a version with that fix is more
+// widely available.
+if (el_get(m_editline, EL_GETTC, "co", &columns, nullptr) == 0) {
   m_terminal_width = columns;
   if (m_current_line_rows != -1) {
 const LineInfoW *info = el_wline(m_editline);


Index: source/Host/common/Editline.cpp
===
--- source/Host/common/Editline.cpp
+++ source/Host/common/Editline.cpp
@@ -1215,9 +1215,13 @@
   if (m_editline != nullptr) {
 el_resize(m_editline);
 int columns;
-// Despite the man page claiming non-zero indicates success, it's actually
-// zero
-if (el_get(m_editline, EL_GETTC, "co", &columns) == 0) {
+// This function is documenting as taking (const char *, void *) for the
+// vararg part, but in reality in was consuming arguments until the first
+// null pointer. This was fixed in libedit in April 2019
+// ,
+// but we're keeping the workaround until a version with that fix is more
+// widely available.
+if (el_get(m_editline, EL_GETTC, "co", &columns, nullptr) == 0) {
   m_terminal_width = columns;
   if (m_current_line_rows != -1) {
 const LineInfoW *info = el_wline(m_editline);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r359449 - Editline: Fix an msan error

2019-04-29 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Apr 29 06:54:12 2019
New Revision: 359449

URL: http://llvm.org/viewvc/llvm-project?rev=359449&view=rev
Log:
Editline: Fix an msan error

Summary:
libedit implementation of el_get(EL_GETTC) had a bug, where it was
consuming vararg arguments until reaching the first null pointer (and
not just two, as documented). This was causing (at least) errors to be
reported when running the tests under msan.

The issue has since been fixed in libedit, but this adds patch adds a
trivial workaround, so that we operate correctly with the libedit
versions which are already out there.

Reviewers: christos, krytarowski, davide

Subscribers: lldb-commits

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

Modified:
lldb/trunk/source/Host/common/Editline.cpp

Modified: lldb/trunk/source/Host/common/Editline.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Editline.cpp?rev=359449&r1=359448&r2=359449&view=diff
==
--- lldb/trunk/source/Host/common/Editline.cpp (original)
+++ lldb/trunk/source/Host/common/Editline.cpp Mon Apr 29 06:54:12 2019
@@ -1215,9 +1215,13 @@ void Editline::TerminalSizeChanged() {
   if (m_editline != nullptr) {
 el_resize(m_editline);
 int columns;
-// Despite the man page claiming non-zero indicates success, it's actually
-// zero
-if (el_get(m_editline, EL_GETTC, "co", &columns) == 0) {
+// This function is documenting as taking (const char *, void *) for the
+// vararg part, but in reality in was consuming arguments until the first
+// null pointer. This was fixed in libedit in April 2019
+// ,
+// but we're keeping the workaround until a version with that fix is more
+// widely available.
+if (el_get(m_editline, EL_GETTC, "co", &columns, nullptr) == 0) {
   m_terminal_width = columns;
   if (m_current_line_rows != -1) {
 const LineInfoW *info = el_wline(m_editline);


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


[Lldb-commits] [lldb] r359450 - Remove obsoleted NativePDB tests

2019-04-29 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Apr 29 07:00:58 2019
New Revision: 359450

URL: http://llvm.org/viewvc/llvm-project?rev=359450&view=rev
Log:
Remove obsoleted NativePDB tests

Their functionality overlaps with the newly introduced
PostfixExpressionTests (r359288). Tests, which still exercise some
pdb-related functionality (register name resolution) have been kept.

Modified:

lldb/trunk/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp

Modified: 
lldb/trunk/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp?rev=359450&r1=359449&r2=359450&view=diff
==
--- 
lldb/trunk/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp
 (original)
+++ 
lldb/trunk/unittests/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpressionTests.cpp
 Mon Apr 29 07:00:58 2019
@@ -53,36 +53,10 @@ CheckValidProgramTranslation(llvm::Strin
result_dwarf_expression.GetString().data());
 }
 
-TEST(PDBFPOProgramToDWARFExpressionTests, SingleAssignmentConst) {
-  CheckValidProgramTranslation("$T0 0 = ", "$T0", "DW_OP_constu 0x0");
-}
-
 TEST(PDBFPOProgramToDWARFExpressionTests, SingleAssignmentRegisterRef) {
   CheckValidProgramTranslation("$T0 $ebp = ", "$T0", "DW_OP_breg6 +0");
 }
 
-TEST(PDBFPOProgramToDWARFExpressionTests, SingleAssignmentExpressionPlus) {
-  CheckValidProgramTranslation("$T0 $ebp 4 + = ", "$T0",
-   "DW_OP_breg6 +0, DW_OP_constu 0x4, DW_OP_plus 
");
-}
-
-TEST(PDBFPOProgramToDWARFExpressionTests, SingleAssignmentExpressionDeref) {
-  CheckValidProgramTranslation("$T0 $ebp ^ = ", "$T0",
-   "DW_OP_breg6 +0, DW_OP_deref ");
-}
-
-TEST(PDBFPOProgramToDWARFExpressionTests, SingleAssignmentExpressionMinus) {
-  CheckValidProgramTranslation(
-  "$T0 $ebp 4 - = ", "$T0",
-  "DW_OP_breg6 +0, DW_OP_constu 0x4, DW_OP_minus ");
-}
-
-TEST(PDBFPOProgramToDWARFExpressionTests, SingleAssignmentExpressionAlign) {
-  CheckValidProgramTranslation("$T0 $ebp 128 @ = ", "$T0",
-   "DW_OP_breg6 +0, DW_OP_constu 0x80, DW_OP_lit1 "
-   ", DW_OP_minus , DW_OP_not , DW_OP_and ");
-}
-
 TEST(PDBFPOProgramToDWARFExpressionTests, MultipleIndependentAssignments) {
   CheckValidProgramTranslation("$T1 1 = $T0 0 =", "$T0", "DW_OP_constu 0x0");
 }


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


[Lldb-commits] [lldb] r359451 - Fix a typo in x86-64-gp-write.test

2019-04-29 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Apr 29 07:04:41 2019
New Revision: 359451

URL: http://llvm.org/viewvc/llvm-project?rev=359451&view=rev
Log:
Fix a typo in x86-64-gp-write.test

The test was building the wrong inferior, causing failures.

Modified:
lldb/trunk/lit/Register/x86-64-gp-write.test

Modified: lldb/trunk/lit/Register/x86-64-gp-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-gp-write.test?rev=359451&r1=359450&r2=359451&view=diff
==
--- lldb/trunk/lit/Register/x86-64-gp-write.test (original)
+++ lldb/trunk/lit/Register/x86-64-gp-write.test Mon Apr 29 07:04:41 2019
@@ -1,6 +1,6 @@
 # XFAIL: system-windows
 # REQUIRES: native && target-x86_64
-# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-64-gp-read.cpp -o %t
+# RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-64-gp-write.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s
 process launch
 


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


[Lldb-commits] [lldb] r359452 - @skipIfLinux another batch of flaky lldb-mi tests

2019-04-29 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Apr 29 07:12:05 2019
New Revision: 359452

URL: http://llvm.org/viewvc/llvm-project?rev=359452&view=rev
Log:
@skipIfLinux another batch of flaky lldb-mi tests

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py?rev=359452&r1=359451&r2=359452&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
 Mon Apr 29 07:12:05 2019
@@ -18,7 +18,7 @@ class MiBreakTestCase(lldbmi_testcase.Mi
 
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
-@expectedFlakeyLinux("llvm.org/pr24717")
+@skipIfLinux# llvm.org/pr24717
 @expectedFailureNetBSD
 @skipIfRemote   # We do not currently support remote debugging via the MI.
 def test_lldbmi_break_insert_function_pending(self):

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py?rev=359452&r1=359451&r2=359452&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
 Mon Apr 29 07:12:05 2019
@@ -90,6 +90,7 @@ class MiStartupOptionsTestCase(lldbmi_te
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfDarwin
+@skipIfLinux
 def test_lldbmi_executable_option_relative_path(self):
 """Test that 'lldb-mi --interpreter %s' loads executable which is 
specified via relative path."""
 
@@ -296,6 +297,7 @@ class MiStartupOptionsTestCase(lldbmi_te
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfDarwin
+@skipIfLinux
 def test_lldbmi_log_directory_option(self):
 """Test that 'lldb-mi --log --log-dir' creates a log file in the 
directory specified by --log-dir."""
 


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


[Lldb-commits] [PATCH] D61235: Add more information to the log timer dump

2019-04-29 Thread António Afonso via Phabricator via lldb-commits
aadsm planned changes to this revision.
aadsm marked 2 inline comments as done.
aadsm added inline comments.



Comment at: lldb/source/Utility/Timer.cpp:110-123
+namespace {
+struct Stats {
+  uint64_t nanos;
+  uint64_t nanos_total;
+  uint64_t nanos_child;
+  uint64_t count;
+};

labath wrote:
> You can just move the `const char *` into the `Stats` struct and get rid of 
> the std::pair. Then the `CategoryMapIteratorSortCriterion` thingy can also 
> become a regular operator<.
ah yeah, that will be much better.



Comment at: lldb/unittests/Utility/TimerTest.cpp:89
+  // 0.102982273 sec (total: 0.126s; child: 0.023s; count: 1) for CAT1
+  // 0.023058228 sec (total: 0.036s; child: 0.012s; count: 2) for CAT2
+  StreamString ss;

labath wrote:
> I'm not sure this second line is really helpful here. Looking at this output, 
> I would have never guessed that these numbers mean we were running two 
> recursive timers belonging to the same category, and the entire thing 
> finished in 20ms.
> 
> Maybe this isn't a real usage problem, as normally we don't have recursive 
> timers (I believe), but in that case, we probably shouldn't have them in this 
> test either (as right now it is the only documentation about how these times 
> are supposed to work). 
> 
> What's the reason for using recursive timers here? If you just wanted to 
> check that the invocation count is 2, then you can wrap the two timers in 
> `{}` blocks, so that they execute "sequentially" instead of recursively. 
> (Which I guess would match the typical scenario where a timer-enabled 
> function calls another timer-enabled function two times in a loop.)
you're totally right, I actually didn't think much about it when I wrote the 
test but this should definitely be sequential not recursive.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61235



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


[Lldb-commits] [lldb] r359456 - Remove XFAIL: windows from x86-64-gp-write.test

2019-04-29 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Apr 29 08:16:26 2019
New Revision: 359456

URL: http://llvm.org/viewvc/llvm-project?rev=359456&view=rev
Log:
Remove XFAIL: windows from x86-64-gp-write.test

The typo fix in r359451 was enough to get it passing there.

Modified:
lldb/trunk/lit/Register/x86-64-gp-write.test

Modified: lldb/trunk/lit/Register/x86-64-gp-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-gp-write.test?rev=359456&r1=359455&r2=359456&view=diff
==
--- lldb/trunk/lit/Register/x86-64-gp-write.test (original)
+++ lldb/trunk/lit/Register/x86-64-gp-write.test Mon Apr 29 08:16:26 2019
@@ -1,4 +1,3 @@
-# XFAIL: system-windows
 # REQUIRES: native && target-x86_64
 # RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-64-gp-write.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s


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


[Lldb-commits] [PATCH] D59015: [lldb-mi] Include full path in the -data-disassemble response

2019-04-29 Thread Anton Kolesov via Phabricator via lldb-commits
anton.kolesov updated this revision to Diff 197117.
anton.kolesov added a comment.

Allocate path buffer on stack instead of heap.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D59015

Files:
  lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
  lldb/tools/lldb-mi/MICmdCmdData.cpp


Index: lldb/tools/lldb-mi/MICmdCmdData.cpp
===
--- lldb/tools/lldb-mi/MICmdCmdData.cpp
+++ lldb/tools/lldb-mi/MICmdCmdData.cpp
@@ -401,8 +401,12 @@
   const MIuint nLine = lineEntry.GetLine();
   const char *pFileName = lineEntry.GetFileSpec().GetFilename();
   pFileName = (pFileName != nullptr) ? pFileName : pUnknown;
+  // Get a full path to the file.
+  char pathBuffer[PATH_MAX];
+  lineEntry.GetFileSpec().GetPath(pathBuffer, PATH_MAX);
 
-  // MI "src_and_asm_line={line=\"%u\",file=\"%s\",line_asm_insn=[ ]}"
+  // MI "src_and_asm_line={line=\"%u\",file=\"%s\",line_asm_insn=[ ],
+  // fullname=\"%s\"}"
   const CMICmnMIValueConst miValueConst(
   CMIUtilString::Format("%u", nLine));
   const CMICmnMIValueResult miValueResult("line", miValueConst);
@@ -413,6 +417,9 @@
   const CMICmnMIValueList miValueList(miValueTuple);
   const CMICmnMIValueResult miValueResult3("line_asm_insn", miValueList);
   miValueTuple2.Add(miValueResult3);
+  const CMICmnMIValueConst miValueConst5(pathBuffer);
+  const CMICmnMIValueResult miValueResult5("fullname", miValueConst5);
+  miValueTuple2.Add(miValueResult5);
   const CMICmnMIValueResult miValueResult4("src_and_asm_line",
miValueTuple2);
   m_miValueList.Add(miValueResult4);
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
@@ -56,6 +56,14 @@
 
"\^done,asm_insns=\[{address=\"0x0*%x\",func-name=\"main\",offset=\"0\",size=\"[1-9]+\",inst=\".+?\"},"
 %
 addr)
 
+# Test -data-disassemble with source line information
+self.runCmd("-data-disassemble -s %#x -e %#x -- 1" % (addr, addr + 
0x10))
+self.expect(
+'\^done,asm_insns=\[src_and_asm_line={line="\d+",file="main.cpp",'
+
'line_asm_insn=\[{address="0x0*%x",func-name="main",offset="0",size="[1-9]+",inst=".+?"}\],'
+'fullname="%s"}' %
+(addr, os.path.abspath("main.cpp")) )
+
 # Run to hello_world
 self.runCmd("-break-insert -f hello_world")
 self.expect("\^done,bkpt={number=\"2\"")


Index: lldb/tools/lldb-mi/MICmdCmdData.cpp
===
--- lldb/tools/lldb-mi/MICmdCmdData.cpp
+++ lldb/tools/lldb-mi/MICmdCmdData.cpp
@@ -401,8 +401,12 @@
   const MIuint nLine = lineEntry.GetLine();
   const char *pFileName = lineEntry.GetFileSpec().GetFilename();
   pFileName = (pFileName != nullptr) ? pFileName : pUnknown;
+  // Get a full path to the file.
+  char pathBuffer[PATH_MAX];
+  lineEntry.GetFileSpec().GetPath(pathBuffer, PATH_MAX);
 
-  // MI "src_and_asm_line={line=\"%u\",file=\"%s\",line_asm_insn=[ ]}"
+  // MI "src_and_asm_line={line=\"%u\",file=\"%s\",line_asm_insn=[ ],
+  // fullname=\"%s\"}"
   const CMICmnMIValueConst miValueConst(
   CMIUtilString::Format("%u", nLine));
   const CMICmnMIValueResult miValueResult("line", miValueConst);
@@ -413,6 +417,9 @@
   const CMICmnMIValueList miValueList(miValueTuple);
   const CMICmnMIValueResult miValueResult3("line_asm_insn", miValueList);
   miValueTuple2.Add(miValueResult3);
+  const CMICmnMIValueConst miValueConst5(pathBuffer);
+  const CMICmnMIValueResult miValueResult5("fullname", miValueConst5);
+  miValueTuple2.Add(miValueResult5);
   const CMICmnMIValueResult miValueResult4("src_and_asm_line",
miValueTuple2);
   m_miValueList.Add(miValueResult4);
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
@@ -56,6 +56,14 @@
 "\^done,asm_insns=\[{address=\"0x0*%x\",func-name=\"main\",offset=\"0\",size=\"[1-9]+\",inst=\".+?\"}," %
 addr)
 
+# Test -data-disassemble with source line information
+self.runCmd("-data-disassemble -s %#x -e %#x -- 1" % (addr, addr + 0x10))
+self.expect(
+'\^done,asm_insns=\[src_and_asm_line={line="\d+",file="main.cpp",'
+'line_asm_insn=\[{address="0x0*%

[Lldb-commits] [lldb] r359465 - [Docs] Generate the python reference without building all of LLDB

2019-04-29 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Apr 29 09:29:10 2019
New Revision: 359465

URL: http://llvm.org/viewvc/llvm-project?rev=359465&view=rev
Log:
[Docs] Generate the python reference without building all of LLDB

As discussed on the mailing list, we should be able to generate the
Python reference without building all of LLDB. To make that possible I
create a dummy python package, which is then parsed by epydoc. The
latter will complain that it couldn't import lldb, but that doesn't
matter as far as generation of the docs is concerned.

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

Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/docs/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=359465&r1=359464&r2=359465&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Mon Apr 29 09:29:10 2019
@@ -30,12 +30,12 @@ if (WIN32)
   add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
 endif()
 
-add_subdirectory(docs)
 if (NOT LLDB_DISABLE_PYTHON)
   add_subdirectory(scripts)
 endif ()
 add_subdirectory(source)
 add_subdirectory(tools)
+add_subdirectory(docs)
 
 option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." 
${LLVM_INCLUDE_TESTS})
 option(LLDB_TEST_USE_CUSTOM_C_COMPILER "Use the C compiler provided via 
LLDB_TEST_C_COMPILER for building test inferiors (instead of the just-built 
compiler). Defaults to OFF." OFF)

Modified: lldb/trunk/docs/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/CMakeLists.txt?rev=359465&r1=359464&r2=359465&view=diff
==
--- lldb/trunk/docs/CMakeLists.txt (original)
+++ lldb/trunk/docs/CMakeLists.txt Mon Apr 29 09:29:10 2019
@@ -13,31 +13,46 @@ if(DOXYGEN_FOUND)
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 COMMENT "Generating LLDB C++ API reference with Doxygen" VERBATIM
   )
-endif(DOXYGEN_FOUND)
+endif()
 
-find_package(PythonInterp REQUIRED)
 find_program(EPYDOC_EXECUTABLE NAMES epydoc epydoc.py)
 if(EPYDOC_EXECUTABLE)
+  message(STATUS "Found epydoc - ${EPYDOC_EXECUTABLE}")
+
   find_program(DOT_EXECUTABLE dot)
-if(DOT_EXECUTABLE)
-  set(EPYDOC_OPTIONS ${EPYDOC_OPTIONS} --graph all --dotpath 
${DOT_EXECUTABLE})
-endif()
-set(DOC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc")
-file(MAKE_DIRECTORY "${DOC_DIR}")
-#set(ENV{PYTHONPATH} 
${CMAKE_CURRENT_BINARY_DIR}/../../../lib/python2.7/site-packages)
-add_custom_target(lldb-python-doc
-  ${EPYDOC_EXECUTABLE}
-  --html
-  lldb
-  -o ${CMAKE_CURRENT_BINARY_DIR}/python_reference
-  --name "LLDB python API"
-  --url "http://lldb.llvm.org";
-  ${EPYDOC_OPTIONS}
-  DEPENDS swig_wrapper liblldb
-  WORKING_DIRECTORY 
${CMAKE_CURRENT_BINARY_DIR}/../../../lib${LLVM_LIBDIR_SUFFIX}/python2.7/site-packages
-  COMMENT "Generating LLDB Python API reference with epydoc" VERBATIM
-)
-endif(EPYDOC_EXECUTABLE)
+  if(DOT_EXECUTABLE)
+set(EPYDOC_OPTIONS ${EPYDOC_OPTIONS} --graph all --dotpath 
${DOT_EXECUTABLE})
+message(STATUS "Found dot - ${DOT_EXECUTABLE}")
+  endif()
+
+  # Pretend to make a python package so that we can generate the reference.
+  # Because we don't build liblldb, epydoc will complain that the import of
+  # _lldb.so failed, but that doesn't prevent it from generating the docs.
+  file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lldb)
+  get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR)
+  add_custom_target(lldb-python-doc-package
+COMMAND "${CMAKE_COMMAND}" -E copy "${lldb_scripts_dir}/lldb.py" 
"${CMAKE_CURRENT_BINARY_DIR}/lldb/__init__.py"
+DEPENDS swig_wrapper
+COMMENT "Copying lldb.py to pretend package.")
+
+  set(DOC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc")
+  file(MAKE_DIRECTORY "${DOC_DIR}")
+  add_custom_target(lldb-python-doc
+${EPYDOC_EXECUTABLE}
+--html
+lldb
+-o ${CMAKE_CURRENT_BINARY_DIR}/python_reference
+--name "LLDB python API"
+--url "http://lldb.llvm.org";
+${EPYDOC_OPTIONS}
+DEPENDS swig_wrapper
+DEPENDS lldb-python-doc-package
+WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+COMMENT "Generating LLDB Python API reference with epydoc" VERBATIM
+  )
+else()
+  message(STATUS "Could NOT find epydoc")
+endif()
 
 if (LLVM_ENABLE_SPHINX)
   include(AddSphinxTarget)


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


[Lldb-commits] [PATCH] D61266: Skip TestClassTemplateParameterPack.py on all platforms

2019-04-29 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik created this revision.
shafik added reviewers: jingham, aprantl, teemperor.

The `TestClassTemplateParameterPack.py` test does not work for the right 
reasons. The expressions such as:

  expression -- C().isSixteenThirtyTwo()

work only because we are currently pulling all the local variables e.g.:

  using $__lldb_local_vars::argc;
  using $__lldb_local_vars::argv;
  using $__lldb_local_vars::myC;
  using $__lldb_local_vars::myLesserC;
  using $__lldb_local_vars::myD;
  using $__lldb_local_vars::myLesserD;

regardless if we use them in the expression and this causes us to for example 
to pull `C` into the evaluation context but this is not how it should 
work. Once we land: https://reviews.llvm.org/D46551

This will no longer work. When clang does the call back it is looking for `C` 
but currently the debug information contains `C` etc... So a long-term 
fix for this would require at least reworking ho that debug information is 
generated.


https://reviews.llvm.org/D61266

Files:
  
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py


Index: 
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
===
--- 
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
+++ 
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
@@ -6,4 +6,4 @@
 decorators.expectedFailureAll(
 compiler="gcc"),
 # rdar://problem/48128064
-decorators.skipIfDarwin])
+decorators.skipIf])


Index: packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
===
--- packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
+++ packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
@@ -6,4 +6,4 @@
 decorators.expectedFailureAll(
 compiler="gcc"),
 # rdar://problem/48128064
-decorators.skipIfDarwin])
+decorators.skipIf])
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61216: [Docs] Make it possible to generate the python reference without building all of LLDB

2019-04-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359465: [Docs] Generate the python reference without 
building all of LLDB (authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61216?vs=196926&id=197130#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61216

Files:
  lldb/trunk/CMakeLists.txt
  lldb/trunk/docs/CMakeLists.txt


Index: lldb/trunk/CMakeLists.txt
===
--- lldb/trunk/CMakeLists.txt
+++ lldb/trunk/CMakeLists.txt
@@ -30,12 +30,12 @@
   add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
 endif()
 
-add_subdirectory(docs)
 if (NOT LLDB_DISABLE_PYTHON)
   add_subdirectory(scripts)
 endif ()
 add_subdirectory(source)
 add_subdirectory(tools)
+add_subdirectory(docs)
 
 option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." 
${LLVM_INCLUDE_TESTS})
 option(LLDB_TEST_USE_CUSTOM_C_COMPILER "Use the C compiler provided via 
LLDB_TEST_C_COMPILER for building test inferiors (instead of the just-built 
compiler). Defaults to OFF." OFF)
Index: lldb/trunk/docs/CMakeLists.txt
===
--- lldb/trunk/docs/CMakeLists.txt
+++ lldb/trunk/docs/CMakeLists.txt
@@ -13,31 +13,46 @@
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 COMMENT "Generating LLDB C++ API reference with Doxygen" VERBATIM
   )
-endif(DOXYGEN_FOUND)
+endif()
 
-find_package(PythonInterp REQUIRED)
 find_program(EPYDOC_EXECUTABLE NAMES epydoc epydoc.py)
 if(EPYDOC_EXECUTABLE)
+  message(STATUS "Found epydoc - ${EPYDOC_EXECUTABLE}")
+
   find_program(DOT_EXECUTABLE dot)
-if(DOT_EXECUTABLE)
-  set(EPYDOC_OPTIONS ${EPYDOC_OPTIONS} --graph all --dotpath 
${DOT_EXECUTABLE})
-endif()
-set(DOC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc")
-file(MAKE_DIRECTORY "${DOC_DIR}")
-#set(ENV{PYTHONPATH} 
${CMAKE_CURRENT_BINARY_DIR}/../../../lib/python2.7/site-packages)
-add_custom_target(lldb-python-doc
-  ${EPYDOC_EXECUTABLE}
-  --html
-  lldb
-  -o ${CMAKE_CURRENT_BINARY_DIR}/python_reference
-  --name "LLDB python API"
-  --url "http://lldb.llvm.org";
-  ${EPYDOC_OPTIONS}
-  DEPENDS swig_wrapper liblldb
-  WORKING_DIRECTORY 
${CMAKE_CURRENT_BINARY_DIR}/../../../lib${LLVM_LIBDIR_SUFFIX}/python2.7/site-packages
-  COMMENT "Generating LLDB Python API reference with epydoc" VERBATIM
-)
-endif(EPYDOC_EXECUTABLE)
+  if(DOT_EXECUTABLE)
+set(EPYDOC_OPTIONS ${EPYDOC_OPTIONS} --graph all --dotpath 
${DOT_EXECUTABLE})
+message(STATUS "Found dot - ${DOT_EXECUTABLE}")
+  endif()
+
+  # Pretend to make a python package so that we can generate the reference.
+  # Because we don't build liblldb, epydoc will complain that the import of
+  # _lldb.so failed, but that doesn't prevent it from generating the docs.
+  file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lldb)
+  get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR)
+  add_custom_target(lldb-python-doc-package
+COMMAND "${CMAKE_COMMAND}" -E copy "${lldb_scripts_dir}/lldb.py" 
"${CMAKE_CURRENT_BINARY_DIR}/lldb/__init__.py"
+DEPENDS swig_wrapper
+COMMENT "Copying lldb.py to pretend package.")
+
+  set(DOC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc")
+  file(MAKE_DIRECTORY "${DOC_DIR}")
+  add_custom_target(lldb-python-doc
+${EPYDOC_EXECUTABLE}
+--html
+lldb
+-o ${CMAKE_CURRENT_BINARY_DIR}/python_reference
+--name "LLDB python API"
+--url "http://lldb.llvm.org";
+${EPYDOC_OPTIONS}
+DEPENDS swig_wrapper
+DEPENDS lldb-python-doc-package
+WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+COMMENT "Generating LLDB Python API reference with epydoc" VERBATIM
+  )
+else()
+  message(STATUS "Could NOT find epydoc")
+endif()
 
 if (LLVM_ENABLE_SPHINX)
   include(AddSphinxTarget)


Index: lldb/trunk/CMakeLists.txt
===
--- lldb/trunk/CMakeLists.txt
+++ lldb/trunk/CMakeLists.txt
@@ -30,12 +30,12 @@
   add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
 endif()
 
-add_subdirectory(docs)
 if (NOT LLDB_DISABLE_PYTHON)
   add_subdirectory(scripts)
 endif ()
 add_subdirectory(source)
 add_subdirectory(tools)
+add_subdirectory(docs)
 
 option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." ${LLVM_INCLUDE_TESTS})
 option(LLDB_TEST_USE_CUSTOM_C_COMPILER "Use the C compiler provided via LLDB_TEST_C_COMPILER for building test inferiors (instead of the just-built compiler). Defaults to OFF." OFF)
Index: lldb/trunk/docs/CMakeLists.txt
===
--- lldb/trunk/docs/CMakeLists.txt
+++ lldb/trunk/docs/CMakeLists.txt
@@ -13,31 +13,46 @@
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 COMMENT "Generating LLDB

[Lldb-commits] [PATCH] D59015: [lldb-mi] Include full path in the -data-disassemble response

2019-04-29 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

LGTM. If there are any other " std::unique_ptr" instances you would 
like to fix after this patch, feel free to submit more fixes without need for 
review.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D59015



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


[Lldb-commits] [PATCH] D61266: Skip TestClassTemplateParameterPack.py on all platforms

2019-04-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

>   So a long-term fix for this would require at least reworking ho that debug 
> information is generated.

I believe the debug information correct but our lookup is just not 
finding/loading the necessary AST nodes?

Otherwise I assume the radar is keeping track of the fact that this feature is 
broken, so LGTM so that we unblock the other reviews.




Comment at: 
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py:9
 # rdar://problem/48128064
-decorators.skipIfDarwin])
+decorators.skipIf])

Nit pick: Isn't there a `skip` or so that's more expressive than `skipIf`?


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

https://reviews.llvm.org/D61266



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


[Lldb-commits] [lldb] r359471 - Fix a stack-smasher in PlatformMacOSX::GetSDKDirectory()

2019-04-29 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Apr 29 10:28:38 2019
New Revision: 359471

URL: http://llvm.org/viewvc/llvm-project?rev=359471&view=rev
Log:
Fix a stack-smasher in PlatformMacOSX::GetSDKDirectory()

GetSDKVersion expects the number of version fields not their byte size
and will happily overwrite later contents of the stack.

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

Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp?rev=359471&r1=359470&r2=359471&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp Mon Apr 29 
10:28:38 2019
@@ -164,7 +164,7 @@ ConstString PlatformMacOSX::GetSDKDirect
   std::string default_xcode_sdk;
   FileSpec fspec;
   uint32_t versions[2];
-  if (objfile->GetSDKVersion(versions, sizeof(versions))) {
+  if (objfile->GetSDKVersion(versions, 2)) {
 fspec = HostInfo::GetShlibDir();
 if (fspec) {
   std::string path;


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


[Lldb-commits] [PATCH] D61218: Fix a stack-smasher in PlatformMacOSX::GetSDKDirectory()

2019-04-29 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359471: Fix a stack-smasher in 
PlatformMacOSX::GetSDKDirectory() (authored by adrian, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61218?vs=196931&id=197138#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61218

Files:
  lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp


Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
===
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
@@ -164,7 +164,7 @@
   std::string default_xcode_sdk;
   FileSpec fspec;
   uint32_t versions[2];
-  if (objfile->GetSDKVersion(versions, sizeof(versions))) {
+  if (objfile->GetSDKVersion(versions, 2)) {
 fspec = HostInfo::GetShlibDir();
 if (fspec) {
   std::string path;


Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
===
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
@@ -164,7 +164,7 @@
   std::string default_xcode_sdk;
   FileSpec fspec;
   uint32_t versions[2];
-  if (objfile->GetSDKVersion(versions, sizeof(versions))) {
+  if (objfile->GetSDKVersion(versions, 2)) {
 fspec = HostInfo::GetShlibDir();
 if (fspec) {
   std::string path;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D59485: [ASTImporter] Add an ImportImpl method to allow customizing Import behavior.

2019-04-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 197149.
teemperor added a comment.

- Refactored test according to Gábor's feedback.


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

https://reviews.llvm.org/D59485

Files:
  clang/include/clang/AST/ASTImporter.h
  clang/lib/AST/ASTImporter.cpp
  clang/unittests/AST/ASTImporterTest.cpp

Index: clang/unittests/AST/ASTImporterTest.cpp
===
--- clang/unittests/AST/ASTImporterTest.cpp
+++ clang/unittests/AST/ASTImporterTest.cpp
@@ -313,6 +313,17 @@
   const char *const InputFileName = "input.cc";
   const char *const OutputFileName = "output.cc";
 
+public:
+  /// Allocates an ASTImporter (or one of its subclasses).
+  typedef std::function
+  ImporterConstructor;
+
+  // The lambda that constructs the ASTImporter we use in this test.
+  ImporterConstructor Creator;
+
+private:
   // Buffer for the To context, must live in the test scope.
   std::string ToCode;
 
@@ -325,22 +336,32 @@
 std::unique_ptr Unit;
 TranslationUnitDecl *TUDecl = nullptr;
 std::unique_ptr Importer;
-TU(StringRef Code, StringRef FileName, ArgVector Args)
+ImporterConstructor Creator;
+TU(StringRef Code, StringRef FileName, ArgVector Args,
+   ImporterConstructor C = ImporterConstructor())
 : Code(Code), FileName(FileName),
   Unit(tooling::buildASTFromCodeWithArgs(this->Code, Args,
  this->FileName)),
-  TUDecl(Unit->getASTContext().getTranslationUnitDecl()) {
+  TUDecl(Unit->getASTContext().getTranslationUnitDecl()), Creator(C) {
   Unit->enableSourceFileDiagnostics();
+
+  // If the test doesn't need a specific ASTImporter, we just create a
+  // normal ASTImporter with it.
+  if (!Creator)
+Creator = [](ASTContext &ToContext, FileManager &ToFileManager,
+ ASTContext &FromContext, FileManager &FromFileManager,
+ bool MinimalImport, ASTImporterLookupTable *LookupTable) {
+  return new ASTImporter(ToContext, ToFileManager, FromContext,
+ FromFileManager, MinimalImport, LookupTable);
+};
 }
 
 void lazyInitImporter(ASTImporterLookupTable &LookupTable, ASTUnit *ToAST) {
   assert(ToAST);
-  if (!Importer) {
-Importer.reset(
-new ASTImporter(ToAST->getASTContext(), ToAST->getFileManager(),
-Unit->getASTContext(), Unit->getFileManager(),
-false, &LookupTable));
-  }
+  if (!Importer)
+Importer.reset(Creator(ToAST->getASTContext(), ToAST->getFileManager(),
+   Unit->getASTContext(), Unit->getFileManager(),
+   false, &LookupTable));
   assert(&ToAST->getASTContext() == &Importer->getToContext());
   createVirtualFileIfNeeded(ToAST, FileName, Code);
 }
@@ -424,7 +445,7 @@
 ArgVector FromArgs = getArgVectorForLanguage(FromLang),
   ToArgs = getArgVectorForLanguage(ToLang);
 
-FromTUs.emplace_back(FromSrcCode, InputFileName, FromArgs);
+FromTUs.emplace_back(FromSrcCode, InputFileName, FromArgs, Creator);
 TU &FromTU = FromTUs.back();
 
 assert(!ToAST);
@@ -562,6 +583,74 @@
   EXPECT_THAT(RedeclsD1, ::testing::ContainerEq(RedeclsD2));
 }
 
+namespace {
+struct RedirectingImporter : public ASTImporter {
+  using ASTImporter::ASTImporter;
+
+protected:
+  llvm::Expected ImportImpl(Decl *FromD) override {
+auto *ND = dyn_cast(FromD);
+if (!ND || ND->getName() != "shouldNotBeImported")
+  return ASTImporter::ImportImpl(FromD);
+for (Decl *D : getToContext().getTranslationUnitDecl()->decls()) {
+  if (auto *ND = dyn_cast(D))
+if (ND->getName() == "realDecl") {
+  RegisterImportedDecl(FromD, ND);
+  return ND;
+}
+}
+return ASTImporter::ImportImpl(FromD);
+  }
+};
+
+} // namespace
+
+struct RedirectingImporterTest : ASTImporterOptionSpecificTestBase {
+  RedirectingImporterTest() {
+Creator = [](ASTContext &ToContext, FileManager &ToFileManager,
+ ASTContext &FromContext, FileManager &FromFileManager,
+ bool MinimalImport, ASTImporterLookupTable *LookupTable) {
+  return new RedirectingImporter(ToContext, ToFileManager, FromContext,
+ FromFileManager, MinimalImport,
+ LookupTable);
+};
+  }
+};
+
+// Test that an ASTImporter subclass can intercept an import call.
+TEST_P(RedirectingImporterTest, InterceptImport) {
+  Decl *From, *To;
+  std::tie(From, To) =
+  getImportedDecl("class shouldNotBeImported {};", Lang_CXX,
+  "class realDecl {};", Lang_CXX, "shouldNotBeImported");
+  auto *Imported = cast(To);
+  EXPECT_EQ(Imported->getQualifiedNameAsString(), "realDecl");
+
+  // Make sure our importer prevented t

[Lldb-commits] [PATCH] D61128: Support member function types in PdbAstBuilder

2019-04-29 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth accepted this revision.
amccarth added a comment.
This revision is now accepted and ready to land.

Thanks for the improved commit message.  Again, sorry about the delay.




Comment at: lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h:183
CompilerType ct);
+  lldb::TypeSP CreateFunctionType(PdbTypeSymId type_id,
+  const llvm::codeview::MemberFunctionRecord 
&pr,

Suggestion:  Consider  `CreateMemberFunctionType` or `CreateMethodType` to 
avoid confusion with `CreateProcedureType`.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61128



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


[Lldb-commits] [PATCH] D61235: Add more information to the log timer dump

2019-04-29 Thread António Afonso via Phabricator via lldb-commits
aadsm marked an inline comment as done.
aadsm added inline comments.



Comment at: lldb/unittests/Utility/TimerTest.cpp:100-101
+  << "String: " << ss.GetData();
+  EXPECT_GT(total1 - child1, seconds1 - 0.001);
+  EXPECT_LT(total1 - child1, seconds1 + 0.001);
+  EXPECT_EQ(1, count1);

labath wrote:
> aadsm wrote:
> > davide wrote:
> > > this seems ... very fragile.
> > that's a good point. I'm not that familiar with the ieee754 to know what's 
> > a safe interval here, do you know?
> I think you want to use `EXPECT_DOUBLE_EQ` here.
It still doesn't help me :(

```
Expected: total1 - child1
  Which is: 0.02
To be equal to: seconds1
  Which is: 0.10054
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61235



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


[Lldb-commits] [PATCH] D61240: Implement GetSystemIncludeDirectories for macOS

2019-04-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp:244
+  case lldb::eLanguageTypeObjC_plus_plus:
+return {sys_root + "/usr/include/"};
+  default:

I'm not 100% sure if that is how Clang header search works, but I believe that 
these paths should be returned relative to the sysroot, no?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61240



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


[Lldb-commits] [PATCH] D61240: Implement GetSystemIncludeDirectories for macOS

2019-04-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp:244
+  case lldb::eLanguageTypeObjC_plus_plus:
+return {sys_root + "/usr/include/"};
+  default:

aprantl wrote:
> aprantl wrote:
> > I'm not 100% sure if that is how Clang header search works, but I believe 
> > that these paths should be returned relative to the sysroot, no?
> ... and we should set sysroot separately.
Doing it this way may work but it would be different from how a regular clang 
invocation works, and that is prone to subtle bugs.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61240



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


[Lldb-commits] [PATCH] D61240: Implement GetSystemIncludeDirectories for macOS

2019-04-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp:244
+  case lldb::eLanguageTypeObjC_plus_plus:
+return {sys_root + "/usr/include/"};
+  default:

aprantl wrote:
> I'm not 100% sure if that is how Clang header search works, but I believe 
> that these paths should be returned relative to the sysroot, no?
... and we should set sysroot separately.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61240



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


[Lldb-commits] [PATCH] D61233: Refactor ObjectFile::GetSDKVersion

2019-04-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

Awesome. I should have done that right away. This isn't super important, but I 
feel like just returning a vector (with potentially zero elements would be just 
as good) and the Optional doesn't add much value.




Comment at: lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp:211
   "SDKs/MacOSX%u.%u.sdk",
-  xcode_contents_path.c_str(), versions[0],
-  versions[1]);
+  xcode_contents_path.c_str(), versions->at(0),
+  versions->at(1));

For my own education, why is this preferred over `versions[0]`? Because of 
Optional's `operator->`?


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

https://reviews.llvm.org/D61233



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


[Lldb-commits] [lldb] r359487 - [test] Disable x86-64-gp-write on Darwin

2019-04-29 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Apr 29 12:39:09 2019
New Revision: 359487

URL: http://llvm.org/viewvc/llvm-project?rev=359487&view=rev
Log:
[test] Disable x86-64-gp-write on Darwin

Modified:
lldb/trunk/lit/Register/x86-64-gp-write.test

Modified: lldb/trunk/lit/Register/x86-64-gp-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-gp-write.test?rev=359487&r1=359486&r2=359487&view=diff
==
--- lldb/trunk/lit/Register/x86-64-gp-write.test (original)
+++ lldb/trunk/lit/Register/x86-64-gp-write.test Mon Apr 29 12:39:09 2019
@@ -1,3 +1,4 @@
+# UNSUPPORTED: system-darwin
 # REQUIRES: native && target-x86_64
 # RUN: %clangxx -fomit-frame-pointer %p/Inputs/x86-64-gp-write.cpp -o %t
 # RUN: %lldb -b -s %s %t | FileCheck %s


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


[Lldb-commits] [PATCH] D59537: Instantiate 'std' templates explicitly in the expression evaluator

2019-04-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/include/lldb/Symbol/ClangASTContext.h:1005
+// May be null if we are already done parsing this ASTContext or the
+// ASTContext wasn't created by parsing source code.
+clang::Sema *   m_sema = nullptr;

`///`



Comment at: lldb/include/lldb/Symbol/ClangASTImporter.h:249
+/// it at the end of the scope. Supports being used multiple times on the
+/// same Minion instance in nested scopes.
+class CxxModuleScope {

I really wish we could rename Minion with something actually descriptive...


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

https://reviews.llvm.org/D59537



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


[Lldb-commits] [lldb] r359490 - [CMake] Fix subtle CMake bug

2019-04-29 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Mon Apr 29 12:44:43 2019
New Revision: 359490

URL: http://llvm.org/viewvc/llvm-project?rev=359490&view=rev
Log:
[CMake] Fix subtle CMake bug

CMake specifies that the DEPENDS field of add_custom_target is for files
and output of add_custom_command. In order to add a target dependency,
add_dependencies should be used.

Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/cmake/modules/AddLLDB.cmake
lldb/trunk/docs/CMakeLists.txt
lldb/trunk/test/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=359490&r1=359489&r2=359490&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Mon Apr 29 12:44:43 2019
@@ -133,7 +133,8 @@ if(LLDB_INCLUDE_TESTS)
 list(APPEND LLDB_TEST_DEPS dsymutil)
   endif()
 
-  add_custom_target(lldb-test-deps DEPENDS ${LLDB_TEST_DEPS})
+  add_custom_target(lldb-test-deps)
+  add_dependencies(lldb-test-deps ${LLDB_TEST_DEPS})
 
   add_subdirectory(test)
   add_subdirectory(unittests)

Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=359490&r1=359489&r2=359490&view=diff
==
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Mon Apr 29 12:44:43 2019
@@ -83,7 +83,7 @@ function(add_lldb_library name)
   endif()
   if (NOT CMAKE_CONFIGURATION_TYPES)
 add_llvm_install_targets(install-${name}
- DEPENDS $
+ DEPENDS ${name}
  COMPONENT ${name})
   endif()
 endif()

Modified: lldb/trunk/docs/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/CMakeLists.txt?rev=359490&r1=359489&r2=359490&view=diff
==
--- lldb/trunk/docs/CMakeLists.txt (original)
+++ lldb/trunk/docs/CMakeLists.txt Mon Apr 29 12:44:43 2019
@@ -32,8 +32,8 @@ if(EPYDOC_EXECUTABLE)
   get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR)
   add_custom_target(lldb-python-doc-package
 COMMAND "${CMAKE_COMMAND}" -E copy "${lldb_scripts_dir}/lldb.py" 
"${CMAKE_CURRENT_BINARY_DIR}/lldb/__init__.py"
-DEPENDS swig_wrapper
 COMMENT "Copying lldb.py to pretend package.")
+  add_dependencies(lldb-python-doc-package swig_wrapper)
 
   set(DOC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc")
   file(MAKE_DIRECTORY "${DOC_DIR}")
@@ -45,11 +45,10 @@ if(EPYDOC_EXECUTABLE)
 --name "LLDB python API"
 --url "http://lldb.llvm.org";
 ${EPYDOC_OPTIONS}
-DEPENDS swig_wrapper
-DEPENDS lldb-python-doc-package
 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 COMMENT "Generating LLDB Python API reference with epydoc" VERBATIM
   )
+  add_dependencies(lldb-python-doc swig_wrapper lldb-python-doc-package)
 else()
   message(STATUS "Could NOT find epydoc")
 endif()

Modified: lldb/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=359490&r1=359489&r2=359490&view=diff
==
--- lldb/trunk/test/CMakeLists.txt (original)
+++ lldb/trunk/test/CMakeLists.txt Mon Apr 29 12:44:43 2019
@@ -8,9 +8,9 @@ function(add_python_test_target name tes
   add_custom_target(${name}
 COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS}
 COMMENT "${comment}"
-DEPENDS ${LLDB_TEST_DEPS}
 USES_TERMINAL
 )
+  add_dependencies(${name} ${LLDB_TEST_DEPS})
 endfunction()
 
 # The default architecture with which to compile test executables is the 
default LLVM target


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


[Lldb-commits] [PATCH] D61266: Skip TestClassTemplateParameterPack.py on all platforms

2019-04-29 Thread Frederic Riss via Phabricator via lldb-commits
friss requested changes to this revision.
friss added a comment.
This revision now requires changes to proceed.

We shouldn't skip the whole test, just the expressions that worked for bad 
reasons. Calling functions on local variables should work, it's just creating 
the templated objects that is completely broken.


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

https://reviews.llvm.org/D61266



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


[Lldb-commits] [lldb] r359492 - [lit] Fix the timeout.

2019-04-29 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Apr 29 12:55:49 2019
New Revision: 359492

URL: http://llvm.org/viewvc/llvm-project?rev=359492&view=rev
Log:
[lit] Fix the timeout.

The timeout wasn't working because it's a property of the lit
configuration, not of the configuration in lit.site.cfg. This sets the
property for the correct object.

Modified:
lldb/trunk/lit/lit.cfg.py
lldb/trunk/lit/lit.site.cfg.py.in

Modified: lldb/trunk/lit/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg.py?rev=359492&r1=359491&r2=359492&view=diff
==
--- lldb/trunk/lit/lit.cfg.py (original)
+++ lldb/trunk/lit/lit.cfg.py Mon Apr 29 12:55:49 2019
@@ -74,6 +74,9 @@ for i in ['module-cache-clang', 'module-
 print("Deleting module cache at %s."%cachedir)
 shutil.rmtree(cachedir)
 
+# Set a default  timeout of 10 minutes.
+lit_config.maxIndividualTestTime = 600
+
 # If running tests natively, check for CPU features needed for some tests.
 
 if 'native' in config.available_features:

Modified: lldb/trunk/lit/lit.site.cfg.py.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.site.cfg.py.in?rev=359492&r1=359491&r2=359492&view=diff
==
--- lldb/trunk/lit/lit.site.cfg.py.in (original)
+++ lldb/trunk/lit/lit.site.cfg.py.in Mon Apr 29 12:55:49 2019
@@ -20,7 +20,6 @@ config.lldb_bitness = 64 if @LLDB_IS_64_
 config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
 config.have_lldb_instr = @LLDB_TOOL_LLDB_INSTR_BUILD@
 config.have_lldb_vscode = @LLDB_TOOL_LLDB_VSCODE_BUILD@
-config.maxIndividualTestTime = 600
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.


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


[Lldb-commits] [PATCH] D59537: Instantiate 'std' templates explicitly in the expression evaluator

2019-04-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 197170.
teemperor added a comment.

- Fixed m_sema documentation.


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

https://reviews.llvm.org/D59537

Files:
  lldb/include/lldb/Symbol/ClangASTContext.h
  lldb/include/lldb/Symbol/ClangASTImporter.h
  lldb/include/lldb/Symbol/CxxModuleHandler.h
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/deque-basic/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/deque-basic/TestBasicDeque.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/deque-basic/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/deque-dbg-info-content/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/deque-dbg-info-content/TestDbgInfoContentDeque.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/deque-dbg-info-content/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/forward_list-basic/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/forward_list-basic/TestBasicForwardList.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/forward_list-basic/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/forward_list-dbg-info-content/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/forward_list-dbg-info-content/TestDbgInfoContentForwardList.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/forward_list-dbg-info-content/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/list-basic/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/list-basic/TestBasicList.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/list-basic/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/list-dbg-info-content/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/list-dbg-info-content/TestDbgInfoContentList.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/list-dbg-info-content/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/shared_ptr-dbg-info-content/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/shared_ptr-dbg-info-content/TestSharedPtrDbgInfoContent.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/shared_ptr-dbg-info-content/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/shared_ptr/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/shared_ptr/TestSharedPtr.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/shared_ptr/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/unique_ptr-dbg-info-content/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/unique_ptr-dbg-info-content/TestUniquePtrDbgInfoContent.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/unique_ptr-dbg-info-content/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/unique_ptr/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/unique_ptr/TestUniquePtr.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/unique_ptr/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-basic/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-basic/TestBasicVector.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-basic/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-bool/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-bool/TestBoolVector.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-bool/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-dbg-info-content/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-dbg-info-content/TestDbgInfoContentVector.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-dbg-info-content/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-of-vectors/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-of-vectors/TestVectorOfVectors.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/vector-of-vectors/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/weak_ptr-dbg-

[Lldb-commits] [PATCH] D61183: PostfixExpression: Introduce CFANode

2019-04-29 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth accepted this revision.
amccarth added a comment.

LGTM, but I found one comment a bit confusing for me.




Comment at: source/Symbol/PostfixExpression.cpp:150
+  /// InitialValueNodes in our input expression, we assume the initial stack
+  /// will contain their value (hence we start with m_stack_depth = 1). If we
+  /// don't have InitialValueNodes, this value is not used, and so its starting

I'm having trouble understanding this comment.

"will contain their value" -- What does "their" refer to here?  I guessed 
InitialValueNodes, but then I'd expect "value" to be "values" (plural), and I'm 
not sure how that relates to the stack depth.


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

https://reviews.llvm.org/D61183



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


[Lldb-commits] [PATCH] D59537: Instantiate 'std' templates explicitly in the expression evaluator

2019-04-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor marked 2 inline comments as done.
teemperor added inline comments.



Comment at: lldb/include/lldb/Symbol/ClangASTImporter.h:249
+/// it at the end of the scope. Supports being used multiple times on the
+/// same Minion instance in nested scopes.
+class CxxModuleScope {

aprantl wrote:
> I really wish we could rename Minion with something actually descriptive...
I'm still trying to come up with a good name. The whole purpose of the class is 
to actually extend and listen to the actual ASTImporter. So what about 
`ASTImporterDecorator`?


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

https://reviews.llvm.org/D59537



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


[Lldb-commits] [PATCH] D59537: Instantiate 'std' templates explicitly in the expression evaluator

2019-04-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/include/lldb/Symbol/ClangASTImporter.h:249
+/// it at the end of the scope. Supports being used multiple times on the
+/// same Minion instance in nested scopes.
+class CxxModuleScope {

teemperor wrote:
> aprantl wrote:
> > I really wish we could rename Minion with something actually descriptive...
> I'm still trying to come up with a good name. The whole purpose of the class 
> is to actually extend and listen to the actual ASTImporter. So what about 
> `ASTImporterDecorator`?
ASTImporterDelegate perhaps? https://en.wikipedia.org/wiki/Delegation_pattern


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

https://reviews.llvm.org/D59537



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


[Lldb-commits] [PATCH] D61244: Re-enable gmodules tests on Linux

2019-04-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a reviewer: aprantl.
teemperor planned changes to this revision.
teemperor added a comment.

I looked into this a bit further and I think the best way forward is to enable 
gmodules on Linux but exclude all tests that rely on system modules (i.e. std 
or libc) as that really seems to be a messy situation. I'll update the patch 
accordingly.


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

https://reviews.llvm.org/D61244



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


[Lldb-commits] [lldb] r359503 - [lit] Check for the psutil module when setting a timeout

2019-04-29 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Apr 29 14:03:39 2019
New Revision: 359503

URL: http://llvm.org/viewvc/llvm-project?rev=359503&view=rev
Log:
[lit] Check for the psutil module when setting a timeout

Apparently setting the per-test-timeout and not having the psutil
package constitutes to a fatal error. So only set the timeout when the
module is available.

Modified:
lldb/trunk/lit/lit.cfg.py

Modified: lldb/trunk/lit/lit.cfg.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg.py?rev=359503&r1=359502&r2=359503&view=diff
==
--- lldb/trunk/lit/lit.cfg.py (original)
+++ lldb/trunk/lit/lit.cfg.py Mon Apr 29 14:03:39 2019
@@ -74,8 +74,14 @@ for i in ['module-cache-clang', 'module-
 print("Deleting module cache at %s."%cachedir)
 shutil.rmtree(cachedir)
 
-# Set a default  timeout of 10 minutes.
-lit_config.maxIndividualTestTime = 600
+# Set a default per-test timeout of 10 minutes. Setting a timeout per test
+# requires the psutil module and lit complains if the value is set but the
+# module can't be found.
+try:
+import psutil  # noqa: F401
+lit_config.maxIndividualTestTime = 600
+except ImportError:
+pass
 
 # If running tests natively, check for CPU features needed for some tests.
 


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


[Lldb-commits] [PATCH] D61266: Skip TestClassTemplateParameterPack.py on all platforms

2019-04-29 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

@friss updated the change to only effect those specifically broken.


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

https://reviews.llvm.org/D61266



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


[Lldb-commits] [PATCH] D59485: [ASTImporter] Add an ImportImpl method to allow customizing Import behavior.

2019-04-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

I'll land this as it seems only the tests are subject to change and I want to 
also land the dependencies of this patch. Please let me know if you want any 
other changes changes to the test and thanks for the review!


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

https://reviews.llvm.org/D59485



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


[Lldb-commits] [PATCH] D61266: Skip TestClassTemplateParameterPack.py on all platforms

2019-04-29 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik updated this revision to Diff 197178.
shafik added a comment.

Fred is correct, I mistakenly thought the parts of the test that were working 
were being covered elsewhere but that is not the case. So I have reworked this 
change to instead of skipping the whole test to comment out the inline 
expressions that are specifically broken.


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

https://reviews.llvm.org/D61266

Files:
  
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
  packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp


Index: 
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp
===
--- 
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp
+++ 
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp
@@ -42,10 +42,14 @@
 (void)C().isSixteenThirtyTwo();
 (void)C().isSixteenThirtyTwo();
 (void)(myC.member != 64);   //% self.expect("expression -- myC", 
DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["64"])
-//% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = 
["false"])
-//% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])
 //% self.expect("expression -- 
myLesserC.isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = 
["false"])
 //% self.expect("expression -- 
myC.isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])
+
+// Commenting out some of the expressions 
because they work for the wrong reasons and will break all together
+// once we stop injecting all the local 
variables into an expression. This case will have to be fixed with
+// a future set of changes.
+//#% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = 
["false"])
+//#% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])

 D myD;
 D myLesserD;
@@ -53,8 +57,10 @@
 (void)D().isIntBool();
 (void)D().isIntBool();
 return myD.member != 64;   //% self.expect("expression -- myD", 
DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["64"])
-//% self.expect("expression -- D().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"])
-//% self.expect("expression -- D().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])
 //% self.expect("expression -- 
myLesserD.isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"])
 //% self.expect("expression -- 
myD.isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])
+
+// See comment above.
+//#% self.expect("expression -- D().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"])
+//#% self.expect("expression -- D().isIntBool()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])
 }
Index: 
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
===
--- 
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
+++ 
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
@@ -4,6 +4,4 @@
 lldbinline.MakeInlineTest(
 __file__, globals(), [
 decorators.expectedFailureAll(
-compiler="gcc"),
-# rdar://problem/48128064
-decorators.skipIfDarwin])
+compiler="gcc")])


Index: packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp
===
--- packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp
+++ packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp
@@ -42,10 +42,14 @@
 (void)C().isSixteenThirtyTwo();
 (void)C().isSixteenThirtyTwo();
 (void)(myC.member != 64);   //% self.expect("expression -- myC", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["64"])
-//% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["false"])
-//% self.expect("expression -- C().isSixteenThirtyTwo()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["true"])
   

[Lldb-commits] [PATCH] D59485: [ASTImporter] Add an ImportImpl method to allow customizing Import behavior.

2019-04-29 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC359502: [ASTImporter] Add an ImportImpl method to allow 
customizing Import behavior. (authored by teemperor, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D59485?vs=197149&id=197180#toc

Repository:
  rC Clang

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

https://reviews.llvm.org/D59485

Files:
  include/clang/AST/ASTImporter.h
  lib/AST/ASTImporter.cpp
  unittests/AST/ASTImporterTest.cpp

Index: include/clang/AST/ASTImporter.h
===
--- include/clang/AST/ASTImporter.h
+++ include/clang/AST/ASTImporter.h
@@ -142,6 +142,12 @@
 
 void AddToLookupTable(Decl *ToD);
 
+  protected:
+/// Can be overwritten by subclasses to implement their own import logic.
+/// The overwritten method should call this method if it didn't import the
+/// decl on its own.
+virtual Expected ImportImpl(Decl *From);
+
   public:
 
 /// \param ToContext The context we'll be importing into.
@@ -427,6 +433,8 @@
 /// \c To declaration mappings as they are imported.
 virtual void Imported(Decl *From, Decl *To) {}
 
+void RegisterImportedDecl(Decl *FromD, Decl *ToD);
+
 /// Store and assign the imported declaration to its counterpart.
 Decl *MapImported(Decl *From, Decl *To);
 
Index: lib/AST/ASTImporter.cpp
===
--- lib/AST/ASTImporter.cpp
+++ lib/AST/ASTImporter.cpp
@@ -255,8 +255,7 @@
 return true; // Already imported.
   ToD = CreateFun(std::forward(args)...);
   // Keep track of imported Decls.
-  Importer.MapImported(FromD, ToD);
-  Importer.AddToLookupTable(ToD);
+  Importer.RegisterImportedDecl(FromD, ToD);
   InitializeImportedDecl(FromD, ToD);
   return false; // A new Decl is created.
 }
@@ -7656,6 +7655,17 @@
   LookupTable->add(ToND);
 }
 
+Expected ASTImporter::ImportImpl(Decl *FromD) {
+  // Import the decl using ASTNodeImporter.
+  ASTNodeImporter Importer(*this);
+  return Importer.Visit(FromD);
+}
+
+void ASTImporter::RegisterImportedDecl(Decl *FromD, Decl *ToD) {
+  MapImported(FromD, ToD);
+  AddToLookupTable(ToD);
+}
+
 Expected ASTImporter::Import_New(QualType FromT) {
   if (FromT.isNull())
 return QualType{};
@@ -7749,7 +7759,6 @@
   if (!FromD)
 return nullptr;
 
-  ASTNodeImporter Importer(*this);
 
   // Check whether we've already imported this declaration.
   Decl *ToD = GetAlreadyImportedOrNull(FromD);
@@ -7760,7 +7769,7 @@
   }
 
   // Import the declaration.
-  ExpectedDecl ToDOrErr = Importer.Visit(FromD);
+  ExpectedDecl ToDOrErr = ImportImpl(FromD);
   if (!ToDOrErr)
 return ToDOrErr;
   ToD = *ToDOrErr;
@@ -7771,6 +7780,9 @@
 return nullptr;
   }
 
+  // Make sure that ImportImpl registered the imported decl.
+  assert(ImportedDecls.count(FromD) != 0 && "Missing call to MapImported?");
+
   // Once the decl is connected to the existing declarations, i.e. when the
   // redecl chain is properly set then we populate the lookup again.
   // This way the primary context will be able to find all decls.
Index: unittests/AST/ASTImporterTest.cpp
===
--- unittests/AST/ASTImporterTest.cpp
+++ unittests/AST/ASTImporterTest.cpp
@@ -313,6 +313,17 @@
   const char *const InputFileName = "input.cc";
   const char *const OutputFileName = "output.cc";
 
+public:
+  /// Allocates an ASTImporter (or one of its subclasses).
+  typedef std::function
+  ImporterConstructor;
+
+  // The lambda that constructs the ASTImporter we use in this test.
+  ImporterConstructor Creator;
+
+private:
   // Buffer for the To context, must live in the test scope.
   std::string ToCode;
 
@@ -325,22 +336,32 @@
 std::unique_ptr Unit;
 TranslationUnitDecl *TUDecl = nullptr;
 std::unique_ptr Importer;
-TU(StringRef Code, StringRef FileName, ArgVector Args)
+ImporterConstructor Creator;
+TU(StringRef Code, StringRef FileName, ArgVector Args,
+   ImporterConstructor C = ImporterConstructor())
 : Code(Code), FileName(FileName),
   Unit(tooling::buildASTFromCodeWithArgs(this->Code, Args,
  this->FileName)),
-  TUDecl(Unit->getASTContext().getTranslationUnitDecl()) {
+  TUDecl(Unit->getASTContext().getTranslationUnitDecl()), Creator(C) {
   Unit->enableSourceFileDiagnostics();
+
+  // If the test doesn't need a specific ASTImporter, we just create a
+  // normal ASTImporter with it.
+  if (!Creator)
+Creator = [](ASTContext &ToContext, FileManager &ToFileManager,
+ ASTContext &FromContext, FileManager &FromFileManager,
+ bool MinimalImport, ASTImporterLookupTable *LookupTable) {
+  return new ASTImporter(ToContext, ToFileManager, FromContext,
+   

[Lldb-commits] [PATCH] D61266: Skip TestClassTemplateParameterPack.py on all platforms

2019-04-29 Thread Frederic Riss via Phabricator via lldb-commits
friss added inline comments.



Comment at: 
packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp:48-50
+// Commenting out some of the expressions 
because they work for the wrong reasons and will break all together
+// once we stop injecting all the local 
variables into an expression. This case will have to be fixed with
+// a future set of changes.

This is a little vague. Can you replace it with something like: "Disabling 
until we do template lookup correctly: 
http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20180507/040689.html";

With this, this LGTM


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

https://reviews.llvm.org/D61266



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


[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-04-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added inline comments.



Comment at: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp:40
+return Shape::empty_shape()->bounds().x; // break here
+}

Some small things:
1. I think the source here is not clang-formatted :)
2. It's not really clear to me if Shape or Bounds are supposed to have arg 
passing restrictions (or both?). Maybe rename them or comment this in the 
source. E.g. `// supposed to be passed by ref/value`.
3. Can this test be more minimized? Do we need both x and y as member 
variables? Do we need all these methods and variables? Especially when debug 
stepping through this test case at some point a minimized test case is always 
nicer.


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

https://reviews.llvm.org/D61146



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


[Lldb-commits] [PATCH] D61146: Set a CXXRecordDecl to not be passed in registers if DW_CC_pass_by_reference when loading from DWARF

2019-04-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py:26
+lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp", False))
+

What does False do if it isn't the default argument? And if it is, can we 
remove it?



Comment at: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py:29
+self.expect("expr Shape::empty_shape()->bounds()",
+substrs=['(Bounds) $0 = (x = 1, y = 2)'])

it's probably more future-proof to write this as `substrs=['(Bounds)', 'x = 1', 
'y = 2'])`



Comment at: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp:1
+struct Bounds {
+  Bounds() = default;

Any comment at all to explain what's special here?



Comment at: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp:11
+class Shape {
+static Shape *sp;
+public:

clang-format please



Comment at: 
packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/main.cpp:22
+  bounds.y = 2;
+  return;
+}

what's the point of the return?



Comment at: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:965
+  m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
+  if (record_decl) {
+record_decl->setArgPassingRestrictions(

at least in LLVM style we elide single-statement braces.



Comment at: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:967
+record_decl->setArgPassingRestrictions(
+clang::RecordDecl::APK_CannotPassInRegs);
+  }

This part LGTM.


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

https://reviews.llvm.org/D61146



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


[Lldb-commits] [PATCH] D56229: [PECOFF] Implementation of ObjectFilePECOFF:: GetUUID()

2019-04-29 Thread Aaron Smith via Phabricator via lldb-commits
asmith updated this revision to Diff 197239.

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

https://reviews.llvm.org/D56229

Files:
  lit/Modules/PECOFF/export-dllfunc.yaml
  lit/Modules/PECOFF/uuid.yaml
  source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
  source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h

Index: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
===
--- source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
+++ source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
@@ -286,6 +286,7 @@
   llvm::Optional m_deps_filespec;
   typedef llvm::object::OwningBinary OWNBINType;
   llvm::Optional m_owningbin;
+  lldb_private::UUID m_uuid;
 };
 
 #endif // liblldb_ObjectFilePECOFF_h_
Index: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
===
--- source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -40,6 +40,54 @@
 using namespace lldb;
 using namespace lldb_private;
 
+struct CVInfoPdb70 {
+  // 16-byte GUID
+  struct _Guid {
+llvm::support::ulittle32_t Data1;
+llvm::support::ulittle16_t Data2;
+llvm::support::ulittle16_t Data3;
+uint8_t Data4[8];
+  } Guid;
+
+  llvm::support::ulittle32_t Age;
+};
+
+static UUID GetCoffUUID(llvm::object::COFFObjectFile *coff_obj) {
+  if (!coff_obj)
+return UUID();
+
+  const llvm::codeview::DebugInfo *pdb_info = nullptr;
+  llvm::StringRef pdb_file;
+
+  // This part is similar with what has done in minidump parser.
+  if (!coff_obj->getDebugPDBInfo(pdb_info, pdb_file) && pdb_info) {
+if (pdb_info->PDB70.CVSignature == llvm::OMF::Signature::PDB70) {
+  using llvm::support::endian::read16be;
+  using llvm::support::endian::read32be;
+
+  const uint8_t *sig = pdb_info->PDB70.Signature;
+  struct CVInfoPdb70 info;
+  info.Guid.Data1 = read32be(sig);
+  sig += 4;
+  info.Guid.Data2 = read16be(sig);
+  sig += 2;
+  info.Guid.Data3 = read16be(sig);
+  sig += 2;
+  memcpy(info.Guid.Data4, sig, 8);
+
+  // Return 20-byte UUID if the Age is not zero
+  if (pdb_info->PDB70.Age) {
+info.Age = read32be(&pdb_info->PDB70.Age);
+return UUID::fromOptionalData(&info, sizeof(info));
+  }
+  // Otherwise return 16-byte GUID
+  return UUID::fromOptionalData(&info.Guid, sizeof(info.Guid));
+}
+  }
+
+  return UUID();
+}
+
 void ObjectFilePECOFF::Initialize() {
   PluginManager::RegisterPlugin(
   GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance,
@@ -113,36 +161,43 @@
 lldb::offset_t data_offset, lldb::offset_t file_offset,
 lldb::offset_t length, lldb_private::ModuleSpecList &specs) {
   const size_t initial_count = specs.GetSize();
+  if (!data_sp || !ObjectFilePECOFF::MagicBytesMatch(data_sp))
+return initial_count;
 
-  if (ObjectFilePECOFF::MagicBytesMatch(data_sp)) {
-DataExtractor data;
-data.SetData(data_sp, data_offset, length);
-data.SetByteOrder(eByteOrderLittle);
+  auto binary = llvm::object::createBinary(file.GetPath());
+  if (!binary)
+return initial_count;
 
-dos_header_t dos_header;
-coff_header_t coff_header;
+  if (!binary->getBinary()->isCOFF() &&
+  !binary->getBinary()->isCOFFImportFile())
+return initial_count;
 
-if (ParseDOSHeader(data, dos_header)) {
-  lldb::offset_t offset = dos_header.e_lfanew;
-  uint32_t pe_signature = data.GetU32(&offset);
-  if (pe_signature != IMAGE_NT_SIGNATURE)
-return false;
-  if (ParseCOFFHeader(data, &offset, coff_header)) {
-ArchSpec spec;
-if (coff_header.machine == MachineAmd64) {
-  spec.SetTriple("x86_64-pc-windows");
-  specs.Append(ModuleSpec(file, spec));
-} else if (coff_header.machine == MachineX86) {
-  spec.SetTriple("i386-pc-windows");
-  specs.Append(ModuleSpec(file, spec));
-  spec.SetTriple("i686-pc-windows");
-  specs.Append(ModuleSpec(file, spec));
-} else if (coff_header.machine == MachineArmNt) {
-  spec.SetTriple("arm-pc-windows");
-  specs.Append(ModuleSpec(file, spec));
-}
-  }
-}
+  auto COFFObj =
+llvm::cast(binary->getBinary());
+
+  ModuleSpec module_spec(file);
+  ArchSpec &spec = module_spec.GetArchitecture();
+  lldb_private::UUID &uuid = module_spec.GetUUID();
+  if (!uuid.IsValid())
+uuid = GetCoffUUID(COFFObj);
+
+  switch (COFFObj->getMachine()) {
+  case MachineAmd64:
+spec.SetTriple("x86_64-pc-windows");
+specs.Append(module_spec);
+break;
+  case MachineX86:
+spec.SetTriple("i386-pc-windows");
+specs.Append(module_spec);
+spec.SetTriple("i686-pc-windows");
+specs.Append(module_spec);
+break;
+  case MachineArmNt:
+spec.SetTriple("arm-pc-windows");
+specs.Append(module_spec);
+break;
+  default:
+break;
   }
 
   ret

[Lldb-commits] [lldb] r359528 - [PECOFF] Implementation of ObjectFilePECOFF:: GetUUID()

2019-04-29 Thread Aaron Smith via lldb-commits
Author: asmith
Date: Mon Apr 29 18:41:33 2019
New Revision: 359528

URL: http://llvm.org/viewvc/llvm-project?rev=359528&view=rev
Log:
[PECOFF] Implementation of ObjectFilePECOFF:: GetUUID()

Summary:
Provide an implementation of GetUUID() for remote debugging scenarios.

Return a PDB's GUID (or PDB70's Signature) as the UUID.

Reviewers: amccarth, labath

Reviewed By: labath

Subscribers: amccarth, clayborg, Hui, labath, lldb-commits

Tags: #lldb

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

Added:
lldb/trunk/lit/Modules/PECOFF/uuid.yaml
Modified:
lldb/trunk/lit/Modules/PECOFF/export-dllfunc.yaml
lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h

Modified: lldb/trunk/lit/Modules/PECOFF/export-dllfunc.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/PECOFF/export-dllfunc.yaml?rev=359528&r1=359527&r2=359528&view=diff
==
--- lldb/trunk/lit/Modules/PECOFF/export-dllfunc.yaml (original)
+++ lldb/trunk/lit/Modules/PECOFF/export-dllfunc.yaml Mon Apr 29 18:41:33 2019
@@ -1,11 +1,15 @@
 # REQUIRES: lld
 # RUN: yaml2obj < %s > %t.obj
 #
-# RUN: lld-link /machine:x64 /out:%t.dll /noentry /nodefaultlib /dll %t.obj 
/export:DllFunc
+# RUN: lld-link /machine:x64 /out:%t.dll /noentry /nodefaultlib /debug /dll 
%t.obj /export:DllFunc
 #
 # RUN: lldb-test object-file %t.dll | FileCheck -check-prefix=BASIC-CHECK %s
 # RUN: lldb-test object-file -dep-modules %t.dll | FileCheck 
-check-prefix=DEPS %s
 
+# BASIC-CHECK: Plugin name: pe-coff
+
+# UUID should not be empty if the module is built with debug info.
+# BASIC-CHECK-DAG: UUID: {{[0-9A-F]{7,}[0-9A-F]}}-{{.*}}
 
 # BASIC-CHECK: Showing 3 subsections
 # BASIC-CHECK:  Index: 0

Added: lldb/trunk/lit/Modules/PECOFF/uuid.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/PECOFF/uuid.yaml?rev=359528&view=auto
==
--- lldb/trunk/lit/Modules/PECOFF/uuid.yaml (added)
+++ lldb/trunk/lit/Modules/PECOFF/uuid.yaml Mon Apr 29 18:41:33 2019
@@ -0,0 +1,90 @@
+# REQUIRES: lld
+# RUN: yaml2obj %s > %t.obj
+# RUN: lldb-test object-file %t.obj | FileCheck %s
+
+# CHECK-DAG: UUID: 14B292E0-D81A-B4F1-4C4C-44205044422E-0001
+
+--- !COFF
+OptionalHeader:  
+  AddressOfEntryPoint: 0
+  ImageBase:   2147483648
+  SectionAlignment: 4096
+  FileAlignment:   512
+  MajorOperatingSystemVersion: 6
+  MinorOperatingSystemVersion: 0
+  MajorImageVersion: 0
+  MinorImageVersion: 0
+  MajorSubsystemVersion: 6
+  MinorSubsystemVersion: 0
+  Subsystem:   IMAGE_SUBSYSTEM_WINDOWS_GUI
+  DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, 
IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT ]
+  SizeOfStackReserve: 1048576
+  SizeOfStackCommit: 4096
+  SizeOfHeapReserve: 1048576
+  SizeOfHeapCommit: 4096
+  ExportTable: 
+RelativeVirtualAddress: 8327
+Size:90
+  ImportTable: 
+RelativeVirtualAddress: 0
+Size:0
+  ResourceTable:   
+RelativeVirtualAddress: 0
+Size:0
+  ExceptionTable:  
+RelativeVirtualAddress: 12288
+Size:12
+  CertificateTable: 
+RelativeVirtualAddress: 0
+Size:0
+  BaseRelocationTable: 
+RelativeVirtualAddress: 0
+Size:0
+  Debug:   
+RelativeVirtualAddress: 8192
+Size:28
+  Architecture:
+RelativeVirtualAddress: 0
+Size:0
+  GlobalPtr:   
+RelativeVirtualAddress: 0
+Size:0
+  TlsTable:
+RelativeVirtualAddress: 0
+Size:0
+  LoadConfigTable: 
+RelativeVirtualAddress: 0
+Size:0
+  BoundImport: 
+RelativeVirtualAddress: 0
+Size:0
+  IAT: 
+RelativeVirtualAddress: 0
+Size:0
+  DelayImportDescriptor: 
+RelativeVirtualAddress: 0
+Size:0
+  ClrRuntimeHeader: 
+RelativeVirtualAddress: 0
+Size:0
+header:  
+  Machine: IMAGE_FILE_MACHINE_AMD64
+  Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, 
IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ]
+sections:
+  - Name:.text
+Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, 
IMAGE_SCN_MEM_READ ]
+VirtualAddress:  4096
+VirtualSize: 22
+SectionData: 50894C24048B4C24040FAF4C2404890C248B042459C3
+  - Name:.rdata
+Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
+VirtualAddress:  8192
+VirtualSize: 236
+SectionData: 
A565B65C02006B001C201C0652534453E092B2141AD8F1B44C4C44205044422E0100443A5C757073747265616D5C6275696C645C746F6F6C735C6C6C64625C6C69745C4D6F64756C65735C5045434F46465C4F75747075745C6578706F72742D646C6C66756

[Lldb-commits] [PATCH] D61292: Include inlined functions when figuring out a contiguous address range

2019-04-29 Thread António Afonso via Phabricator via lldb-commits
aadsm created this revision.
aadsm added reviewers: clayborg, jasonmolenda.
Herald added subscribers: lldb-commits, jdoerfert, eraman, mgorny.
Herald added a project: LLDB.

This diff changes the function `LineEntry::GetSameLineContiguousAddressRange` 
so that it also includes function calls that were inlined at the same line of 
code.

My motivation is to decrease the step over time of lines that heavly rely on 
inlined functions. I have multiple examples in the code base I work that makes 
a step over stop 20 or mote times internally. This can easly had up to step 
overs that take >500ms which I was able to lower to 25ms with this new strategy.

The reason the current code is not extending the address range beyond an 
inlined function is because when we resolve the symbol at the next address of 
the line entry we will get the entry line corresponding to where the original 
code for the inline function lives, making us barely extend the range. This 
then will end up on a step over having to stop multiple times everytime there's 
an inlined function.

To check if the range is an inlined function at that line I also get the block 
associated with the next address and check if there is a parent block with a 
call site at the line we're trying to extend.

To check this I created a new function in Block called 
`GetContainingInlinedBlockWithCallSite` that does exactly that. I also added a 
new function to Declaration for convinence of checking file/line named 
`CompareFileAndLine`.

To avoid potential issues when extending an address range I added an `Extend` 
function that extends the range by the AddressRange given as an argument. This 
function returns true to indicate sucess when the rage was agumented, false 
otherwise (e.g.: the ranges are not connected). The reason I do is to make sure 
that we're not just blindly extending complete_line_range by whatever 
`GetByteSize()` we got. If for some reason the ranges are not connected or 
overlap, or even 0, this could be an issue.

I also added a unit tests for this change and include the instructions on the 
test itself on how to generate the yaml file I use for testing.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61292

Files:
  lldb/include/lldb/Core/AddressRange.h
  lldb/include/lldb/Symbol/Block.h
  lldb/include/lldb/Symbol/Declaration.h
  lldb/include/lldb/Symbol/LineEntry.h
  lldb/source/Core/AddressRange.cpp
  lldb/source/Symbol/Block.cpp
  lldb/source/Symbol/Declaration.cpp
  lldb/source/Symbol/LineEntry.cpp
  lldb/source/Target/Thread.cpp
  lldb/source/Target/ThreadPlanStepRange.cpp
  lldb/unittests/Symbol/CMakeLists.txt
  lldb/unittests/Symbol/Inputs/inlined-functions.yaml
  lldb/unittests/Symbol/TestLineEntry.cpp

Index: lldb/unittests/Symbol/TestLineEntry.cpp
===
--- /dev/null
+++ lldb/unittests/Symbol/TestLineEntry.cpp
@@ -0,0 +1,278 @@
+//===-- TestLineEntry.cpp --*- C++ -*-===//
+//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "gtest/gtest.h"
+#include 
+
+#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
+#include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h"
+#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
+#include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h"
+#include "TestingSupport/TestUtilities.h"
+#include "lldb/Symbol/ClangASTContext.h"
+
+#include "lldb/Core/Module.h"
+#include "lldb/Host/FileSystem.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Symbol/CompileUnit.h"
+#include "lldb/Symbol/SymbolContext.h"
+#include "lldb/Utility/StreamString.h"
+
+#include "llvm/Support/FileUtilities.h"
+#include "llvm/Support/Program.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+class LineEntryTest : public testing::Test {
+public:
+  void SetUp() override {
+FileSystem::Initialize();
+HostInfo::Initialize();
+ObjectFileMachO::Initialize();
+SymbolVendorMacOSX::Initialize();
+SymbolFileDWARF::Initialize();
+ClangASTContext::Initialize();
+  }
+
+  void TearDown() override {
+ClangASTContext::Terminate();
+SymbolFileDWARF::Terminate();
+SymbolVendorMacOSX::Terminate();
+ObjectFileMachO::Terminate();
+HostInfo::Terminate();
+FileSystem::Terminate();
+  }
+
+protected:
+  llvm::Expected GetModule();
+  llvm::Expected GetLineEntryForLine(uint32_t line);
+  ModuleSP m_module_sp;
+};
+
+#define EXPECTED_NO_ERROR(x)   \
+  if (std::error_code ASSERT_NO_ERROR_ec = x) {\
+llvm::SmallString<128> MessageStorage; \
+llvm::raw_svector_ostream Message(MessageStorage); \
+Message << #x

[Lldb-commits] [PATCH] D61235: Add more information to the log timer dump

2019-04-29 Thread António Afonso via Phabricator via lldb-commits
aadsm updated this revision to Diff 197246.
aadsm added a comment.

Only store needed data for dumping and put everything in the struct. Also fix 
tests to do sequential calls instead of recursive.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61235

Files:
  lldb/include/lldb/Utility/Timer.h
  lldb/source/Utility/Timer.cpp
  lldb/unittests/Utility/TimerTest.cpp

Index: lldb/unittests/Utility/TimerTest.cpp
===
--- lldb/unittests/Utility/TimerTest.cpp
+++ lldb/unittests/Utility/TimerTest.cpp
@@ -61,7 +61,9 @@
   StreamString ss;
   Timer::DumpCategoryTimes(&ss);
   double seconds1, seconds2;
-  ASSERT_EQ(2, sscanf(ss.GetData(), "%lf sec for CAT1%*[\n ]%lf sec for CAT2",
+  ASSERT_EQ(2, sscanf(ss.GetData(),
+  "%lf sec (total: %*lfs; child: %*lfs; count: %*d) for "
+  "CAT1%*[\n ]%lf sec for CAT2",
   &seconds1, &seconds2))
   << "String: " << ss.GetData();
   EXPECT_LT(0.01, seconds1);
@@ -69,3 +71,40 @@
   EXPECT_LT(0.001, seconds2);
   EXPECT_GT(0.1, seconds2);
 }
+
+TEST(TimerTest, CategoryTimesStats) {
+  Timer::ResetCategoryTimes();
+  {
+static Timer::Category tcat1("CAT1");
+Timer t1(tcat1, ".");
+std::this_thread::sleep_for(std::chrono::milliseconds(100));
+static Timer::Category tcat2("CAT2");
+{
+  Timer t2(tcat2, ".");
+  std::this_thread::sleep_for(std::chrono::milliseconds(10));
+}
+{
+  Timer t3(tcat2, ".");
+  std::this_thread::sleep_for(std::chrono::milliseconds(10));
+}
+  }
+  // Example output:
+  // 0.105202764 sec (total: 0.132s; child: 0.027s; count: 1) for CAT1
+  // 0.026772798 sec (total: 0.027s; child: 0.000s; count: 2) for CAT2
+  StreamString ss;
+  Timer::DumpCategoryTimes(&ss);
+  double seconds1, total1, child1, seconds2;
+  int count1, count2;
+  ASSERT_EQ(
+  6, sscanf(ss.GetData(),
+"%lf sec (total: %lfs; child: %lfs; count: %d) for CAT1%*[\n ]"
+"%lf sec (total: %*lfs; child: %*lfs; count: %d) for CAT2",
+&seconds1, &total1, &child1, &count1, &seconds2, &count2))
+  << "String: " << ss.GetData();
+  EXPECT_GT(total1 - child1, seconds1 - 0.001);
+  EXPECT_LT(total1 - child1, seconds1 + 0.001);
+  EXPECT_EQ(1, count1);
+  EXPECT_GT(child1, seconds2 - 0.001);
+  EXPECT_LT(child1, seconds2 + 0.001);
+  EXPECT_EQ(2, count2);
+}
Index: lldb/source/Utility/Timer.cpp
===
--- lldb/source/Utility/Timer.cpp
+++ lldb/source/Utility/Timer.cpp
@@ -41,6 +41,8 @@
 
 Timer::Category::Category(const char *cat) : m_name(cat) {
   m_nanos.store(0, std::memory_order_release);
+  m_nanos_total.store(0, std::memory_order_release);
+  m_count.store(0, std::memory_order_release);
   Category *expected = g_categories;
   do {
 m_next = expected;
@@ -93,6 +95,8 @@
 
   // Keep total results for each category so we can dump results.
   m_category.m_nanos += std::chrono::nanoseconds(timer_dur).count();
+  m_category.m_nanos_total += std::chrono::nanoseconds(total_dur).count();
+  m_category.m_count++;
 }
 
 void Timer::SetDisplayDepth(uint32_t depth) { g_display_depth = depth; }
@@ -100,25 +104,38 @@
 /* binary function predicate:
  * - returns whether a person is less than another person
  */
-
-typedef std::pair TimerEntry;
-
-static bool CategoryMapIteratorSortCriterion(const TimerEntry &lhs,
- const TimerEntry &rhs) {
-  return lhs.second > rhs.second;
+namespace {
+struct Stats {
+  const char *name;
+  uint64_t nanos;
+  uint64_t nanos_total;
+  uint64_t count;
+};
+} // namespace
+
+static bool CategoryMapIteratorSortCriterion(const Stats &lhs,
+ const Stats &rhs) {
+  return lhs.nanos > rhs.nanos;
 }
 
 void Timer::ResetCategoryTimes() {
-  for (Category *i = g_categories; i; i = i->m_next)
+  for (Category *i = g_categories; i; i = i->m_next) {
 i->m_nanos.store(0, std::memory_order_release);
+i->m_nanos_total.store(0, std::memory_order_release);
+i->m_count.store(0, std::memory_order_release);
+  }
 }
 
 void Timer::DumpCategoryTimes(Stream *s) {
-  std::vector sorted;
+  std::vector sorted;
   for (Category *i = g_categories; i; i = i->m_next) {
 uint64_t nanos = i->m_nanos.load(std::memory_order_acquire);
-if (nanos)
-  sorted.push_back(std::make_pair(i->m_name, nanos));
+if (nanos) {
+  uint64_t nanos_total = i->m_nanos_total.load(std::memory_order_acquire);
+  uint64_t count = i->m_count.load(std::memory_order_acquire);
+  Stats stats{i->m_name, nanos, nanos_total, count};
+  sorted.push_back(stats);
+}
   }
   if (sorted.empty())
 return; // Later code will break without any elements.
@@ -126,6 +143,9 @@
   // Sort by time
   llvm::sort(sorted.begin(), sorted.end(), Cat

[Lldb-commits] [PATCH] D61128: Support member function types in PdbAstBuilder

2019-04-29 Thread Mikhail Senkov via Phabricator via lldb-commits
zloyrobot added a comment.

In D61128#1482765 , @amccarth wrote:

> Thanks for the improved commit message.  Again, sorry about the delay.


No problem, thanks for review!


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61128



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