[Lldb-commits] [PATCH] D61360: Initialization: remove ObjectContainer from Common

2019-05-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: source/API/CMakeLists.txt:99-100
 lldbUtility
+lldbPluginObjectContainerBSDArchive
+lldbPluginObjectContainerMachOArchive
 ${LLDB_ALL_PLUGINS}

xiaobai wrote:
> These should get sucked into LLDB_ALL_PLUGINS right?
Yes, they will be.



Comment at: source/API/SystemInitializerFull.cpp:132-133
 
+  ObjectContainerBSDArchive::Initialize();
+  ObjectContainerUniversalMachO::Initialize();
+

xiaobai wrote:
> You need to include the headers for these classes
And remove them from `SystemInitializerCommon.h`


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61360



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


Re: [Lldb-commits] [lldb] r359730 - [lldb-server] Remove lldb-server's dependency on Core

2019-05-02 Thread Pavel Labath via lldb-commits

On 01/05/2019 23:41, Alex Langford via lldb-commits wrote:

Author: xiaobai
Date: Wed May  1 14:41:40 2019
New Revision: 359730

URL: http://llvm.org/viewvc/llvm-project?rev=359730&view=rev
Log:
[lldb-server] Remove lldb-server's dependency on Core

No need to directly link against Core, as lldb-server doesn't directly
use it.

Modified:
 lldb/trunk/tools/lldb-server/CMakeLists.txt
 lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp
 lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp

Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=359730&r1=359729&r2=359730&view=diff
==
--- lldb/trunk/tools/lldb-server/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-server/CMakeLists.txt Wed May  1 14:41:40 2019
@@ -64,7 +64,6 @@ add_lldb_tool(lldb-server
  
  LINK_LIBS

lldbBase
-  lldbCore
lldbHost
lldbInitialization
lldbInterpreter

Modified: lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp?rev=359730&r1=359729&r2=359730&view=diff
==
--- lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp (original)
+++ lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp Wed May  1 14:41:40 
2019
@@ -8,7 +8,6 @@
  
  #include "LLDBServerUtilities.h"
  
-#include "lldb/Core/StreamFile.h"

  #include "lldb/Utility/Args.h"
  #include "lldb/Utility/Log.h"
  #include "lldb/Utility/StreamString.h"

Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?rev=359730&r1=359729&r2=359730&view=diff
==
--- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Wed May  1 14:41:40 2019
@@ -22,7 +22,6 @@
  #include "LLDBServerUtilities.h"
  #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h"
  #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
-#include "lldb/Core/PluginManager.h"
  #include "lldb/Host/ConnectionFileDescriptor.h"
  #include "lldb/Host/FileSystem.h"
  #include "lldb/Host/HostGetOpt.h"


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



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


[Lldb-commits] [PATCH] D61376: [lldb] [lit] Split 'register read' tests between zmm*, xmm16+, ymm16+

2019-05-02 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.

Thanks for splitting these. Since we deleted the zmm dotest tests, I think it's 
important to do this so we don't regress test coverage on darwin. (But somebody 
on the darwin side should take a look at adding support for [xy]mm registers 
too, as I expect their exclusion was just an omission, and fixing that might be 
as simple as defining a couple of new RegisterInfo structs)


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

https://reviews.llvm.org/D61376



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


[Lldb-commits] [PATCH] D61064: Object/Minidump: Add support for the ThreadList stream

2019-05-02 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359762: Object/Minidump: Add support for the ThreadList 
stream (authored by labath, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61064?vs=196435&id=197710#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61064

Files:
  llvm/trunk/include/llvm/BinaryFormat/Minidump.h
  llvm/trunk/include/llvm/Object/Minidump.h
  llvm/trunk/lib/Object/Minidump.cpp
  llvm/trunk/unittests/Object/MinidumpTest.cpp

Index: llvm/trunk/lib/Object/Minidump.cpp
===
--- llvm/trunk/lib/Object/Minidump.cpp
+++ llvm/trunk/lib/Object/Minidump.cpp
@@ -53,8 +53,9 @@
   return Result;
 }
 
-Expected> MinidumpFile::getModuleList() const {
-  auto OptionalStream = getRawStream(StreamType::ModuleList);
+template 
+Expected> MinidumpFile::getListStream(StreamType Stream) const {
+  auto OptionalStream = getRawStream(Stream);
   if (!OptionalStream)
 return createError("No such stream");
   auto ExpectedSize =
@@ -65,14 +66,18 @@
   size_t ListSize = ExpectedSize.get()[0];
 
   size_t ListOffset = 4;
-  // Some producers insert additional padding bytes to align the module list to
-  // 8-byte boundary. Check for that by comparing the module list size with the
-  // overall stream size.
-  if (ListOffset + sizeof(Module) * ListSize < OptionalStream->size())
+  // Some producers insert additional padding bytes to align the list to an
+  // 8-byte boundary. Check for that by comparing the list size with the overall
+  // stream size.
+  if (ListOffset + sizeof(T) * ListSize < OptionalStream->size())
 ListOffset = 8;
 
-  return getDataSliceAs(*OptionalStream, ListOffset, ListSize);
+  return getDataSliceAs(*OptionalStream, ListOffset, ListSize);
 }
+template Expected>
+MinidumpFile::getListStream(StreamType) const;
+template Expected>
+MinidumpFile::getListStream(StreamType) const;
 
 Expected>
 MinidumpFile::getDataSlice(ArrayRef Data, size_t Offset, size_t Size) {
Index: llvm/trunk/unittests/Object/MinidumpTest.cpp
===
--- llvm/trunk/unittests/Object/MinidumpTest.cpp
+++ llvm/trunk/unittests/Object/MinidumpTest.cpp
@@ -343,7 +343,7 @@
   5, 6, 7, 8, 9, 0, 1, 2, // Reserved1
   };
 
-  for (const std::vector &Data : {OneModule, PaddedModule}) {
+  for (ArrayRef Data : {OneModule, PaddedModule}) {
 auto ExpectedFile = create(Data);
 ASSERT_THAT_EXPECTED(ExpectedFile, Succeeded());
 const MinidumpFile &File = **ExpectedFile;
@@ -396,3 +396,70 @@
   const MinidumpFile &File = **ExpectedFile;
   EXPECT_THAT_EXPECTED(File.getModuleList(), Failed());
 }
+
+TEST(MinidumpFile, getThreadList) {
+  std::vector OneThread{
+  // Header
+  'M', 'D', 'M', 'P', 0x93, 0xa7, 0, 0, // Signature, Version
+  1, 0, 0, 0,   // NumberOfStreams,
+  32, 0, 0, 0,  // StreamDirectoryRVA
+  0, 1, 2, 3, 4, 5, 6, 7,   // Checksum, TimeDateStamp
+  0, 0, 0, 0, 0, 0, 0, 0,   // Flags
+// Stream Directory
+  3, 0, 0, 0, 52, 0, 0, 0,  // Type, DataSize,
+  44, 0, 0, 0,  // RVA
+  // ThreadList
+  1, 0, 0, 0, // NumberOfThreads
+  1, 2, 3, 4, 5, 6, 7, 8, // ThreadId, SuspendCount
+  9, 0, 1, 2, 3, 4, 5, 6, // PriorityClass, Priority
+  7, 8, 9, 0, 1, 2, 3, 4, // EnvironmentBlock
+  // Stack
+  5, 6, 7, 8, 9, 0, 1, 2, // StartOfMemoryRange
+  3, 4, 5, 6, 7, 8, 9, 0, // DataSize, RVA
+  // Context
+  1, 2, 3, 4, 5, 6, 7, 8, // DataSize, RVA
+  };
+  // Same as before, but with a padded thread list.
+  std::vector PaddedThread{
+  // Header
+  'M', 'D', 'M', 'P', 0x93, 0xa7, 0, 0, // Signature, Version
+  1, 0, 0, 0,   // NumberOfStreams,
+  32, 0, 0, 0,  // StreamDirectoryRVA
+  0, 1, 2, 3, 4, 5, 6, 7,   // Checksum, TimeDateStamp
+  0, 0, 0, 0, 0, 0, 0, 0,   // Flags
+// Stream Directory
+  3, 0, 0, 0, 56, 0, 0, 0,  // Type, DataSize,
+  44, 0, 0, 0,  // RVA
+  // ThreadList
+  1, 0, 0, 0, // NumberOfThreads
+  0, 0, 0, 0, // Padding
+  1, 2, 3, 4, 5, 6, 7, 8, // ThreadId, SuspendCount
+  9, 0, 1, 2, 3, 4, 5, 6, // PriorityClass, Priority
+  7, 8, 9, 0, 1, 2, 3, 4, // EnvironmentBlock
+  // Stack
+  5, 6, 7, 8, 9, 0, 1, 2, // StartOfMemoryRange
+  3, 4, 5, 6, 7, 8, 9, 0, // DataSize, RVA
+  // Context
+  1, 2, 3, 4, 5, 6, 7, 8, // DataSize, RVA
+  };
+
+  for (ArrayRef Data : {OneThread, PaddedThread}) {
+auto ExpectedFile = create(Data);
+ASSERT_THAT_E

[Lldb-commits] [PATCH] D61064: Object/Minidump: Add support for the ThreadList stream

2019-05-02 Thread Pavel Labath via Phabricator via lldb-commits
labath marked 2 inline comments as done.
labath added a comment.

Thanks for the review.




Comment at: unittests/Object/MinidumpTest.cpp:446
+
+  for (const std::vector &Data : {OneThread, PaddedThread}) {
+auto ExpectedFile = create(Data);

jhenderson wrote:
> I missed this in the other tests, but this could be an `ArrayRef` 
> instead of a `const std::vector &`. Feel free to leave it as is or 
> to update it in an NFC throughout this test afterwards, if you would prefer 
> to leave it to another patch.
There's just one more test besides this one, so I'll update everything in this 
patch.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61064



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


[Lldb-commits] [PATCH] D61361: PluginInstructionARM: avoid unnecessary link

2019-05-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I don't think this is a good way to solve this problem. The llvm's definition 
of dependencies http://llvm.org/docs/CodingStandards.html#library-layering 
explicitly that it is not the same as "the thing that's needed to make linkers 
happy" (emphasis mine):

  One library (both its headers and implementation) should only use things from 
the libraries listed in its dependencies.
  
  ***Some*** of this constraint can be enforced by classic Unix linkers...
  
  This doesn’t fully enforce all inter-library dependencies, and importantly 
doesn’t enforce header file circular dependencies created by inline functions. 
A good way to answer the “is this layered correctly” would be to consider 
whether a Unix linker would succeed at linking the program if all inline 
functions were defined out-of-line...

I am guessing that you the reason for this dependency is the headers defining 
various register constants. A good way to solve that would be to create a new 
library, and move all the headers of this kind there...


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61361



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


[Lldb-commits] [PATCH] D61423: MinidumpYAML: add support for the ThreadList stream

2019-05-02 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: amccarth, jhenderson, clayborg.
Herald added a project: LLVM.

The implementation is a pretty straightforward extension of the pattern
used for (de)serializing the ModuleList stream. Since there are other
streams which use the same format (MemoryList and MemoryList64, at
least). I tried to generalize the code a bit so that adding future
streams of this type can be done with less code.


Repository:
  rL LLVM

https://reviews.llvm.org/D61423

Files:
  include/llvm/ObjectYAML/MinidumpYAML.h
  lib/ObjectYAML/MinidumpYAML.cpp
  test/tools/obj2yaml/basic-minidump.yaml

Index: test/tools/obj2yaml/basic-minidump.yaml
===
--- test/tools/obj2yaml/basic-minidump.yaml
+++ test/tools/obj2yaml/basic-minidump.yaml
@@ -42,6 +42,15 @@
 Size of Image:   0x54555657
 Module Name: libb.so
 CodeView Record: 58595A5B
+  - Type:ThreadList
+Threads: 
+  - Thread Id:   0x5C5D5E5F
+Priority Class:  0x60616263
+Environment Block: 0x6465666768696A6B
+Stack:   
+  Start of Memory Range: 0x6C6D6E6F70717273
+  Content: 7475767778797A7B
+Context: 7C7D7E7F80818283
 ...
 
 # CHECK:  --- !minidump
@@ -86,4 +95,13 @@
 # CHECK-NEXT: Size of Image:   0x54555657
 # CHECK-NEXT: Module Name: libb.so
 # CHECK-NEXT: CodeView Record: 58595A5B
+# CHECK-NEXT:   - Type:ThreadList
+# CHECK-NEXT: Threads: 
+# CHECK-NEXT:   - Thread Id:   0x5C5D5E5F
+# CHECK-NEXT: Priority Class:  0x60616263
+# CHECK-NEXT: Environment Block: 0x6465666768696A6B
+# CHECK-NEXT: Stack:   
+# CHECK-NEXT:   Start of Memory Range: 0x6C6D6E6F70717273
+# CHECK-NEXT:   Content: 7475767778797A7B
+# CHECK-NEXT: Context: 7C7D7E7F80818283
 # CHECK-NEXT: ...
Index: lib/ObjectYAML/MinidumpYAML.cpp
===
--- lib/ObjectYAML/MinidumpYAML.cpp
+++ lib/ObjectYAML/MinidumpYAML.cpp
@@ -180,6 +180,8 @@
   case StreamType::LinuxProcStat:
   case StreamType::LinuxProcUptime:
 return StreamKind::TextContent;
+  case StreamType::ThreadList:
+return StreamKind::ThreadList;
   default:
 return StreamKind::RawContent;
   }
@@ -196,6 +198,8 @@
 return llvm::make_unique();
   case StreamKind::TextContent:
 return llvm::make_unique(Type);
+  case StreamKind::ThreadList:
+return llvm::make_unique();
   }
   llvm_unreachable("Unhandled stream kind!");
 }
@@ -323,19 +327,19 @@
   mapOptionalHex(IO, "File Date Low", Info.FileDateLow, 0);
 }
 
-void yaml::MappingTraits::mapping(
-IO &IO, ModuleListStream::ParsedModule &M) {
-  mapRequiredHex(IO, "Base of Image", M.Module.BaseOfImage);
-  mapRequiredHex(IO, "Size of Image", M.Module.SizeOfImage);
-  mapOptionalHex(IO, "Checksum", M.Module.Checksum, 0);
-  IO.mapOptional("Time Date Stamp", M.Module.TimeDateStamp,
+void yaml::MappingTraits::mapping(
+IO &IO, ModuleListStream::entry_type &M) {
+  mapRequiredHex(IO, "Base of Image", M.Entry.BaseOfImage);
+  mapRequiredHex(IO, "Size of Image", M.Entry.SizeOfImage);
+  mapOptionalHex(IO, "Checksum", M.Entry.Checksum, 0);
+  IO.mapOptional("Time Date Stamp", M.Entry.TimeDateStamp,
  support::ulittle32_t(0));
   IO.mapRequired("Module Name", M.Name);
-  IO.mapOptional("Version Info", M.Module.VersionInfo, VSFixedFileInfo());
+  IO.mapOptional("Version Info", M.Entry.VersionInfo, VSFixedFileInfo());
   IO.mapRequired("CodeView Record", M.CvRecord);
   IO.mapOptional("Misc Record", M.MiscRecord, yaml::BinaryRef());
-  mapOptionalHex(IO, "Reserved0", M.Module.Reserved0, 0);
-  mapOptionalHex(IO, "Reserved1", M.Module.Reserved1, 0);
+  mapOptionalHex(IO, "Reserved0", M.Entry.Reserved0, 0);
+  mapOptionalHex(IO, "Reserved1", M.Entry.Reserved1, 0);
 }
 
 static void streamMapping(yaml::IO &IO, RawContentStream &Stream) {
@@ -350,7 +354,7 @@
 }
 
 static void streamMapping(yaml::IO &IO, ModuleListStream &Stream) {
-  IO.mapRequired("Modules", Stream.Modules);
+  IO.mapRequired("Modules", Stream.Entries);
 }
 
 static void streamMapping(yaml::IO &IO, SystemInfoStream &Stream) {
@@ -386,6 +390,27 @@
   IO.mapOptional("Text", Stream.Text);
 }
 
+void yaml::MappingContextTraits::mapping(
+IO &IO, MemoryDescriptor &Memory, BinaryRef &Content) {
+  mapRequiredHex(IO, "Start of Memory Range", Memory.StartOfMemoryRange);
+  IO.mapRequired("Content", Content);
+}
+
+void yaml::MappingTraits::mapping(
+IO &IO, ThreadListStream::entry_type &T) {
+  mapRequiredHex(IO, "Thread Id", T.Entry.ThreadId);
+  mapOptionalHex(IO, "Suspend Count", T.Entry.SuspendCount, 0);
+  mapOptionalHex(IO, "Priority Class", T.Entry.PriorityClass, 0);
+  mapOptionalHex(IO, "Priority", T.Entry.Priority, 0);
+  mapOptionalHex(IO, "Environment Block", T.Entry.Environmen

[Lldb-commits] [lldb] r359765 - Fix MSVC build

2019-05-02 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu May  2 01:52:06 2019
New Revision: 359765

URL: http://llvm.org/viewvc/llvm-project?rev=359765&view=rev
Log:
Fix MSVC build

Address an ambiguity between lldb_private::Thread and
llvm::minidump::Thread. Follow-up to llvm r359762 (which introduced the
second type).

Modified:
lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.cpp
lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.cpp

Modified: 
lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.cpp?rev=359765&r1=359764&r2=359765&view=diff
==
--- lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.cpp 
Thu May  2 01:52:06 2019
@@ -463,7 +463,7 @@ static RegisterSet g_reg_sets[] = {
 constexpr size_t k_num_reg_sets = llvm::array_lengthof(g_reg_sets);
 
 RegisterContextMinidump_ARM::RegisterContextMinidump_ARM(
-Thread &thread, const DataExtractor &data, bool apple)
+lldb_private::Thread &thread, const DataExtractor &data, bool apple)
 : RegisterContext(thread, 0), m_apple(apple) {
   lldb::offset_t offset = 0;
   m_regs.context_flags = data.GetU32(&offset);

Modified: 
lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.cpp?rev=359765&r1=359764&r2=359765&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.cpp 
Thu May  2 01:52:06 2019
@@ -769,7 +769,7 @@ static RegisterSet g_reg_sets[] = {
 constexpr size_t k_num_reg_sets = llvm::array_lengthof(g_reg_sets);
 
 RegisterContextMinidump_ARM64::RegisterContextMinidump_ARM64(
-Thread &thread, const DataExtractor &data)
+lldb_private::Thread &thread, const DataExtractor &data)
 : RegisterContext(thread, 0) {
   lldb::offset_t offset = 0;
   m_regs.context_flags = data.GetU64(&offset);


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


[Lldb-commits] [PATCH] D61311: PostfixExpression: Use signed integers in IntegerNode

2019-05-02 Thread Pavel Labath via Phabricator via lldb-commits
labath marked an inline comment as done.
labath added inline comments.



Comment at: include/lldb/Symbol/PostfixExpression.h:97
 private:
-  uint32_t m_value;
+  int64_t m_value;
 };

clayborg wrote:
> Do we want to try and use lldb_private::Scalar here? Then this could handle 
> signed/unsigned ints, floats and anything else that comes along? Might need 
> to be renamed "ScalarNode"? All of the type promotion stuff is already built 
> into those classes.
I think that would be too generic for the current use case. For instance, 
that'd mean I'd have to figure out how to serialize the floats into a dwarf 
expression. I'm not sure if that's possible, but it doesn't seem terribly 
useful, as the purpose of these expressions is to compute addresses of stuff, 
and addresses are integral. If it turns out 64 bit signed int isn't enough, 
then I'd go for `llvm::APSInt`, but so far I don't see anything which would 
suggest that will ever be the case.


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

https://reviews.llvm.org/D61311



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


[Lldb-commits] [PATCH] D61299: Rename Minion to ASTImporterDelegate

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 197728.
teemperor added a comment.

- Added documentation.
- Fixed more references to 'minion' pointed out in the review.


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

https://reviews.llvm.org/D61299

Files:
  lldb/include/lldb/Symbol/ClangASTImporter.h
  lldb/source/Symbol/ClangASTImporter.cpp

Index: lldb/source/Symbol/ClangASTImporter.cpp
===
--- lldb/source/Symbol/ClangASTImporter.cpp
+++ lldb/source/Symbol/ClangASTImporter.cpp
@@ -58,12 +58,12 @@
 clang::QualType ClangASTImporter::CopyType(clang::ASTContext *dst_ast,
clang::ASTContext *src_ast,
clang::QualType type) {
-  MinionSP minion_sp(GetMinion(dst_ast, src_ast));
+  ImporterDelegateSP delegate_sp(GetDelegate(dst_ast, src_ast));
 
-  Minion::CxxModuleScope std_scope(*minion_sp, dst_ast);
+  ASTImporterDelegate::CxxModuleScope std_scope(*delegate_sp, dst_ast);
 
-  if (minion_sp)
-return minion_sp->Import(type);
+  if (delegate_sp)
+return delegate_sp->Import(type);
 
   return QualType();
 }
@@ -99,14 +99,14 @@
 clang::Decl *ClangASTImporter::CopyDecl(clang::ASTContext *dst_ast,
 clang::ASTContext *src_ast,
 clang::Decl *decl) {
-  MinionSP minion_sp;
+  ImporterDelegateSP delegate_sp;
 
-  minion_sp = GetMinion(dst_ast, src_ast);
+  delegate_sp = GetDelegate(dst_ast, src_ast);
 
-  Minion::CxxModuleScope std_scope(*minion_sp, dst_ast);
+  ASTImporterDelegate::CxxModuleScope std_scope(*delegate_sp, dst_ast);
 
-  if (minion_sp) {
-clang::Decl *result = minion_sp->Import(decl);
+  if (delegate_sp) {
+clang::Decl *result = delegate_sp->Import(decl);
 
 if (!result) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
@@ -254,9 +254,9 @@
 (unsigned long long)type, static_cast(src_ctx),
 static_cast(dst_ctx));
 
-  MinionSP minion_sp(GetMinion(dst_ctx, src_ctx));
+  ImporterDelegateSP delegate_sp(GetDelegate(dst_ctx, src_ctx));
 
-  if (!minion_sp)
+  if (!delegate_sp)
 return nullptr;
 
   std::set decls_to_deport;
@@ -270,11 +270,11 @@
 tag_type->getDecl());
   }
 
-  minion_sp->InitDeportWorkQueues(&decls_to_deport, &decls_already_deported);
+  delegate_sp->InitDeportWorkQueues(&decls_to_deport, &decls_already_deported);
 
   lldb::opaque_compiler_type_t result = CopyType(dst_ctx, src_ctx, type);
 
-  minion_sp->ExecuteDeportWorkQueues();
+  delegate_sp->ExecuteDeportWorkQueues();
 
   if (!result)
 return nullptr;
@@ -293,9 +293,9 @@
 decl->getDeclKindName(), static_cast(decl),
 static_cast(src_ctx), static_cast(dst_ctx));
 
-  MinionSP minion_sp(GetMinion(dst_ctx, src_ctx));
+  ImporterDelegateSP delegate_sp(GetDelegate(dst_ctx, src_ctx));
 
-  if (!minion_sp)
+  if (!delegate_sp)
 return nullptr;
 
   std::set decls_to_deport;
@@ -305,11 +305,11 @@
 
   decl_context_override.OverrideAllDeclsFromContainingFunction(decl);
 
-  minion_sp->InitDeportWorkQueues(&decls_to_deport, &decls_already_deported);
+  delegate_sp->InitDeportWorkQueues(&decls_to_deport, &decls_already_deported);
 
   clang::Decl *result = CopyDecl(dst_ctx, src_ctx, decl);
 
-  minion_sp->ExecuteDeportWorkQueues();
+  delegate_sp->ExecuteDeportWorkQueues();
 
   if (!result)
 return nullptr;
@@ -561,11 +561,13 @@
   if (!ClangASTContext::GetCompleteDecl(decl_origin.ctx, decl_origin.decl))
 return false;
 
-  MinionSP minion_sp(GetMinion(&decl->getASTContext(), decl_origin.ctx));
+  ImporterDelegateSP delegate_sp(
+  GetDelegate(&decl->getASTContext(), decl_origin.ctx));
 
-  Minion::CxxModuleScope std_scope(*minion_sp, &decl->getASTContext());
-  if (minion_sp)
-minion_sp->ImportDefinitionTo(decl, decl_origin.decl);
+  ASTImporterDelegate::CxxModuleScope std_scope(*delegate_sp,
+&decl->getASTContext());
+  if (delegate_sp)
+delegate_sp->ImportDefinitionTo(decl, decl_origin.decl);
 
   return true;
 }
@@ -579,10 +581,11 @@
   if (!ClangASTContext::GetCompleteDecl(origin_ast_ctx, origin_decl))
 return false;
 
-  MinionSP minion_sp(GetMinion(&decl->getASTContext(), origin_ast_ctx));
+  ImporterDelegateSP delegate_sp(
+  GetDelegate(&decl->getASTContext(), origin_ast_ctx));
 
-  if (minion_sp)
-minion_sp->ImportDefinitionTo(decl, origin_decl);
+  if (delegate_sp)
+delegate_sp->ImportDefinitionTo(decl, origin_decl);
 
   ASTContextMetadataSP context_md = GetContextMetadata(&decl->getASTContext());
 
@@ -605,11 +608,11 @@
   if (!ClangASTContext::GetCompleteDecl(decl_origin.ctx, decl_origin.decl))
 return false;
 
-  MinionSP minion_sp(
-  GetMinion(&interface_decl->getASTContext(), decl_origin.ctx));
+  ImporterDelegateSP delegate_sp(
+  GetDelegate(&interface_decl->g

[Lldb-commits] [lldb] r359773 - Inject only relevant local variables in the expression evaluation context

2019-05-02 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Thu May  2 03:12:56 2019
New Revision: 359773

URL: http://llvm.org/viewvc/llvm-project?rev=359773&view=rev
Log:
Inject only relevant local variables in the expression evaluation context

Summary:
In r259902, LLDB started injecting all the locals in every expression
evaluation. This fixed a bunch of issues, but also caused others, mostly
performance regressions on some codebases. The regressions were bad
enough that we added a setting in r274783 to control the behavior and
we have been shipping with the setting off to avoid the perf regressions.

This patch changes the logic injecting the local variables to only inject
the ones present in the expression typed by the user. The approach is
fairly simple and just scans the typed expression for every local name.
Hopefully this gives us the best of both world as it just realizes the
types of the variables really used by the expression.

Landing this requires the 2 other issues I pointed out today to be addressed
but I wanted to gather comments right away.

Original patch by Frédéric Riss!

Reviewers: jingham, clayborg, friss, shafik

Reviewed By: jingham, clayborg

Subscribers: teemperor, labath, lldb-commits

Tags: #lldb

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py

lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py?rev=359773&r1=359772&r2=359773&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py
 Thu May  2 03:12:56 2019
@@ -155,7 +155,9 @@ class TestMembersAndLocalsWithSameName(T
 frame = thread.GetSelectedFrame()
 self.assertTrue(frame.IsValid())
 
+self.enable_expression_log()
 val = frame.EvaluateExpression("a")
+self.disable_expression_log_and_check_for_locals(['a'])
 self.assertTrue(val.IsValid())
 self.assertEqual(val.GetValueAsUnsigned(), 12345)
 
@@ -189,6 +191,12 @@ class TestMembersAndLocalsWithSameName(T
 self.assertTrue(val.IsValid())
 self.assertEqual(val.GetValueAsUnsigned(), 10003)
 
+self.enable_expression_log()
+val = frame.EvaluateExpression("c-b")
+self.disable_expression_log_and_check_for_locals(['c','b'])
+self.assertTrue(val.IsValid())
+self.assertEqual(val.GetValueAsUnsigned(), 1)
+
 self.process.Continue()
 self.assertTrue(
 self.process.GetState() == lldb.eStateStopped,
@@ -211,6 +219,13 @@ class TestMembersAndLocalsWithSameName(T
 self.assertTrue(val.IsValid())
 self.assertEqual(val.GetValueAsUnsigned(), 778899)
 
+self.enable_expression_log()
+val = frame.EvaluateExpression("a+b")
+self.disable_expression_log_and_check_for_locals(['a','b'])
+self.assertTrue(val.IsValid())
+self.assertEqual(val.GetValueAsUnsigned(), 3)
+
+
 def _load_exe(self):
 self.build()
 
@@ -234,7 +249,9 @@ class TestMembersAndLocalsWithSameName(T
 frame = thread.GetSelectedFrame()
 self.assertTrue(frame.IsValid())
 
+self.enable_expression_log()
 val = frame.EvaluateExpression("a")
+self.disable_expression_log_and_check_for_locals([])
 self.assertTrue(val.IsValid())
 self.assertEqual(val.GetValueAsUnsigned(), 112233)
 
@@ -245,3 +262,23 @@ class TestMembersAndLocalsWithSameName(T
 val = frame.EvaluateExpression("c")
 self.assertTrue(val.IsValid())
 self.assertEqual(val.GetValueAsUnsigned(), 778899)
+
+def enable_expression_log(self):
+log_file = os.path.join(self.getBuildDir(), "expr.log")
+self.runCmd("log enable  -f '%s' lldb expr" % (log_file))
+
+def disable_expression_log_and_check_for_locals(self, variables):
+log_file = os.path.join(self.getBuildDir(), "expr.log")
+self.runCmd("log disable lldb expr")
+local_var_regex = re.compile(r".*__lldb_local_vars::(.*);")
+matched = []
+with open(log_file, 'r') as log:
+for line in log:
+if line.find('LLDB_BODY

[Lldb-commits] [PATCH] D46551: Inject only relevant local variables in the expression evaluation context

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB359773: Inject only relevant local variables in the 
expression evaluation context (authored by teemperor, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D46551?vs=196965&id=197729#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D46551

Files:
  
packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py
  source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.h
  source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
  source/Plugins/ExpressionParser/Clang/ClangUserExpression.h

Index: source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
===
--- source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
+++ source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
@@ -178,11 +178,12 @@
   std::vector GetModulesToImport(ExecutionContext &exe_ctx);
   void UpdateLanguageForExpr(DiagnosticManager &diagnostic_manager,
  ExecutionContext &exe_ctx,
- std::vector modules_to_import);
+ std::vector modules_to_import,
+ bool for_completion);
   bool SetupPersistentState(DiagnosticManager &diagnostic_manager,
ExecutionContext &exe_ctx);
   bool PrepareForParsing(DiagnosticManager &diagnostic_manager,
- ExecutionContext &exe_ctx);
+ ExecutionContext &exe_ctx, bool for_completion);
 
   ClangUserExpressionHelper m_type_system_helper;
 
Index: source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
===
--- source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
+++ source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
@@ -8,6 +8,9 @@
 
 #include "ClangExpressionSourceCode.h"
 
+#include "clang/Basic/CharInfo.h"
+#include "llvm/ADT/StringRef.h"
+
 #include "Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h"
 #include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h"
 #include "lldb/Symbol/Block.h"
@@ -161,8 +164,43 @@
   }
 }
 
+/// Checks if the expression body contains the given variable as a token.
+/// \param body The expression body.
+/// \param var The variable token we are looking for.
+/// \return True iff the expression body containes the variable as a token.
+static bool ExprBodyContainsVar(llvm::StringRef body, llvm::StringRef var) {
+  assert(var.find_if([](char c) { return !clang::isIdentifierBody(c); }) ==
+ llvm::StringRef::npos &&
+ "variable contains non-identifier chars?");
+
+  size_t start = 0;
+  // Iterate over all occurences of the variable string in our expression.
+  while ((start = body.find(var, start)) != llvm::StringRef::npos) {
+// We found our variable name in the expression. Check that the token
+// that contains our needle is equal to our variable and not just contains
+// the character sequence by accident.
+// Prevents situations where we for example inlcude the variable 'FOO' in an
+// expression like 'FOObar + 1'.
+bool has_characters_before =
+start != 0 && clang::isIdentifierBody(body[start - 1]);
+bool has_characters_after =
+start + var.size() < body.size() &&
+clang::isIdentifierBody(body[start + var.size()]);
+
+// Our token just contained the variable name as a substring. Continue
+// searching the rest of the expression.
+if (has_characters_before || has_characters_after) {
+  ++start;
+  continue;
+}
+return true;
+  }
+  return false;
+}
+
 static void AddLocalVariableDecls(const lldb::VariableListSP &var_list_sp,
-  StreamString &stream) {
+  StreamString &stream,
+  const std::string &expr) {
   for (size_t i = 0; i < var_list_sp->GetSize(); i++) {
 lldb::VariableSP var_sp = var_list_sp->GetVariableAtIndex(i);
 
@@ -170,15 +208,17 @@
 if (!var_name || var_name == "this" || var_name == ".block_descriptor")
   continue;
 
+if (!expr.empty() && !ExprBodyContainsVar(expr, var_name.GetStringRef()))
+  continue;
+
 stream.Printf("using $__lldb_local_vars::%s;\n", var_name.AsCString());
   }
 }
 
-bool ClangExpressionSourceCode::GetText(std::string &text,
-   lldb::LanguageType wrapping_language,
-   bool static_method,
-   ExecutionContext &exe_ctx, bool add_locals,
-   llvm::ArrayRef modules) const {
+bool ClangExpressionSourceCo

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

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor closed this revision.
teemperor added a comment.

This has been merged as rLLDB359699  but 
somehow Phabriactor hasn't figured out yet that this needs to be closed. 
Closing this manually.


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] r359777 - Rename Minion to ASTImporterDelegate

2019-05-02 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Thu May  2 03:58:33 2019
New Revision: 359777

URL: http://llvm.org/viewvc/llvm-project?rev=359777&view=rev
Log:
Rename Minion to ASTImporterDelegate

Summary:
I think there universal agreement that Minion isn't the best name for this 
class. This patch renames the class
 to ASTImporterDelegate to better reflect it's goal of monitoring and extending 
the ASTImporter.

Reviewers: aprantl, shafik, martong, a.sidorin, davide

Reviewed By: aprantl, shafik, davide

Subscribers: rnkovacs, davide, abidh, lldb-commits

Tags: #lldb

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

Modified:
lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
lldb/trunk/source/Symbol/ClangASTImporter.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTImporter.h?rev=359777&r1=359776&r2=359777&view=diff
==
--- lldb/trunk/include/lldb/Symbol/ClangASTImporter.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTImporter.h Thu May  2 03:58:33 2019
@@ -235,42 +235,52 @@ private:
 
   typedef std::map OriginMap;
 
-  class Minion : public clang::ASTImporter {
+  /// ASTImporter that intercepts and records the import process of the
+  /// underlying ASTImporter.
+  ///
+  /// This class updates the map from declarations to their original
+  /// declarations and can record and complete declarations that have been
+  /// imported in a certain interval.
+  ///
+  /// When intercepting a declaration import, the ASTImporterDelegate uses the
+  /// CxxModuleHandler to replace any missing or malformed declarations with
+  /// their counterpart from a C++ module.
+  class ASTImporterDelegate : public clang::ASTImporter {
   public:
-Minion(ClangASTImporter &master, clang::ASTContext *target_ctx,
-   clang::ASTContext *source_ctx)
+ASTImporterDelegate(ClangASTImporter &master, clang::ASTContext 
*target_ctx,
+clang::ASTContext *source_ctx)
 : clang::ASTImporter(*target_ctx, master.m_file_manager, *source_ctx,
  master.m_file_manager, true /*minimal*/),
   m_decls_to_deport(nullptr), m_decls_already_deported(nullptr),
   m_master(master), m_source_ctx(source_ctx) {}
 
-/// Scope guard that attaches a CxxModuleHandler to a Minion and deattaches
-/// it at the end of the scope. Supports being used multiple times on the
-/// same Minion instance in nested scopes.
+/// Scope guard that attaches a CxxModuleHandler to an ASTImporterDelegate
+/// and deattaches it at the end of the scope. Supports being used multiple
+/// times on the same ASTImporterDelegate instance in nested scopes.
 class CxxModuleScope {
-  /// The handler we attach to the Minion.
+  /// The handler we attach to the ASTImporterDelegate.
   CxxModuleHandler m_handler;
-  /// The Minion we are supposed to attach the handler to.
-  Minion &m_minion;
-  /// True iff we attached the handler to the Minion.
+  /// The ASTImporterDelegate we are supposed to attach the handler to.
+  ASTImporterDelegate &m_delegate;
+  /// True iff we attached the handler to the ASTImporterDelegate.
   bool m_valid = false;
 
 public:
-  CxxModuleScope(Minion &minion, clang::ASTContext *dst_ctx)
-  : m_minion(minion) {
-// If the minion doesn't have a CxxModuleHandler yet, create one
+  CxxModuleScope(ASTImporterDelegate &delegate, clang::ASTContext *dst_ctx)
+  : m_delegate(delegate) {
+// If the delegate doesn't have a CxxModuleHandler yet, create one
 // and attach it.
-if (!minion.m_std_handler) {
-  m_handler = CxxModuleHandler(minion, dst_ctx);
+if (!delegate.m_std_handler) {
+  m_handler = CxxModuleHandler(delegate, dst_ctx);
   m_valid = true;
-  minion.m_std_handler = &m_handler;
+  delegate.m_std_handler = &m_handler;
 }
   }
   ~CxxModuleScope() {
 if (m_valid) {
   // Make sure no one messed with the handler we placed.
-  assert(m_minion.m_std_handler == &m_handler);
-  m_minion.m_std_handler = nullptr;
+  assert(m_delegate.m_std_handler == &m_handler);
+  m_delegate.m_std_handler = nullptr;
 }
   }
 };
@@ -279,7 +289,7 @@ private:
 llvm::Expected ImportImpl(clang::Decl *From) override;
 
   public:
-// A call to "InitDeportWorkQueues" puts the minion into deport mode.
+// A call to "InitDeportWorkQueues" puts the delegate into deport mode.
 // In deport mode, every copied Decl that could require completion is
 // recorded and placed into the decls_to_deport set.
 //
@@ -287,8 +297,8 @@ private:
 // are in decls_to_deport, adding any Decls it sees along the way that it
 // hasn't already deported.  It proceeds until dec

[Lldb-commits] [PATCH] D61299: Rename Minion to ASTImporterDelegate

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359777: Rename Minion to ASTImporterDelegate (authored by 
teemperor, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61299?vs=197728&id=197740#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61299

Files:
  lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
  lldb/trunk/source/Symbol/ClangASTImporter.cpp

Index: lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
===
--- lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
+++ lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
@@ -235,42 +235,52 @@
 
   typedef std::map OriginMap;
 
-  class Minion : public clang::ASTImporter {
+  /// ASTImporter that intercepts and records the import process of the
+  /// underlying ASTImporter.
+  ///
+  /// This class updates the map from declarations to their original
+  /// declarations and can record and complete declarations that have been
+  /// imported in a certain interval.
+  ///
+  /// When intercepting a declaration import, the ASTImporterDelegate uses the
+  /// CxxModuleHandler to replace any missing or malformed declarations with
+  /// their counterpart from a C++ module.
+  class ASTImporterDelegate : public clang::ASTImporter {
   public:
-Minion(ClangASTImporter &master, clang::ASTContext *target_ctx,
-   clang::ASTContext *source_ctx)
+ASTImporterDelegate(ClangASTImporter &master, clang::ASTContext *target_ctx,
+clang::ASTContext *source_ctx)
 : clang::ASTImporter(*target_ctx, master.m_file_manager, *source_ctx,
  master.m_file_manager, true /*minimal*/),
   m_decls_to_deport(nullptr), m_decls_already_deported(nullptr),
   m_master(master), m_source_ctx(source_ctx) {}
 
-/// Scope guard that attaches a CxxModuleHandler to a Minion and deattaches
-/// it at the end of the scope. Supports being used multiple times on the
-/// same Minion instance in nested scopes.
+/// Scope guard that attaches a CxxModuleHandler to an ASTImporterDelegate
+/// and deattaches it at the end of the scope. Supports being used multiple
+/// times on the same ASTImporterDelegate instance in nested scopes.
 class CxxModuleScope {
-  /// The handler we attach to the Minion.
+  /// The handler we attach to the ASTImporterDelegate.
   CxxModuleHandler m_handler;
-  /// The Minion we are supposed to attach the handler to.
-  Minion &m_minion;
-  /// True iff we attached the handler to the Minion.
+  /// The ASTImporterDelegate we are supposed to attach the handler to.
+  ASTImporterDelegate &m_delegate;
+  /// True iff we attached the handler to the ASTImporterDelegate.
   bool m_valid = false;
 
 public:
-  CxxModuleScope(Minion &minion, clang::ASTContext *dst_ctx)
-  : m_minion(minion) {
-// If the minion doesn't have a CxxModuleHandler yet, create one
+  CxxModuleScope(ASTImporterDelegate &delegate, clang::ASTContext *dst_ctx)
+  : m_delegate(delegate) {
+// If the delegate doesn't have a CxxModuleHandler yet, create one
 // and attach it.
-if (!minion.m_std_handler) {
-  m_handler = CxxModuleHandler(minion, dst_ctx);
+if (!delegate.m_std_handler) {
+  m_handler = CxxModuleHandler(delegate, dst_ctx);
   m_valid = true;
-  minion.m_std_handler = &m_handler;
+  delegate.m_std_handler = &m_handler;
 }
   }
   ~CxxModuleScope() {
 if (m_valid) {
   // Make sure no one messed with the handler we placed.
-  assert(m_minion.m_std_handler == &m_handler);
-  m_minion.m_std_handler = nullptr;
+  assert(m_delegate.m_std_handler == &m_handler);
+  m_delegate.m_std_handler = nullptr;
 }
   }
 };
@@ -279,7 +289,7 @@
 llvm::Expected ImportImpl(clang::Decl *From) override;
 
   public:
-// A call to "InitDeportWorkQueues" puts the minion into deport mode.
+// A call to "InitDeportWorkQueues" puts the delegate into deport mode.
 // In deport mode, every copied Decl that could require completion is
 // recorded and placed into the decls_to_deport set.
 //
@@ -287,8 +297,8 @@
 // are in decls_to_deport, adding any Decls it sees along the way that it
 // hasn't already deported.  It proceeds until decls_to_deport is empty.
 //
-// These calls must be paired.  Leaving a minion in deport mode or trying
-// to start deport minion with a new pair of queues will result in an
+// These calls must be paired.  Leaving a delegate in deport mode or trying
+// to start deport delegate with a new pair of queues will result in an
 // assertion failure.
 

[Lldb-commits] [PATCH] D61431: [lldb] [lit] Introduce tests for writing YMM registers

2019-05-02 Thread Michał Górny via Phabricator via lldb-commits
mgorny created this revision.
mgorny added reviewers: labath, JDevlieghere, krytarowski.

https://reviews.llvm.org/D61431

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

Index: lldb/lit/Register/x86-ymm-write.test
===
--- /dev/null
+++ lldb/lit/Register/x86-ymm-write.test
@@ -0,0 +1,28 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86 && native-cpu-avx
+# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+
+process continue
+# CHECK: process continue
+
+# CHECK-DAG: ymm0 = 0x828486888a8c8e81838587898b8d8f80030507090b0d0f00020406080a0c0e01
+# CHECK-DAG: ymm1 = 0x929496989a9c9e91939597999b9d9f90131517191b1d1f10121416181a1c1e11
+# CHECK-DAG: ymm2 = 0xa2a4a6a8aaacaea1a3a5a7a9abadafa0232527292b2d2f20222426282a2c2e21
+# CHECK-DAG: ymm3 = 0xb2b4b6b8babcbeb1b3b5b7b9bbbdbfb0333537393b3d3f30323436383a3c3e31
+# CHECK-DAG: ymm4 = 0xc2c4c6c8cacccec1c3c5c7c9cbcdcfc0434547494b4d4f40424446484a4c4e41
+# CHECK-DAG: ymm5 = 0xd2d4d6d8dadcded1d3d5d7d9dbdddfd0535557595b5d5f50525456585a5c5e51
+# CHECK-DAG: ymm6 = 0xe2e4e6e8eaeceee1e3e5e7e9ebedefe0636567696b6d6f60626466686a6c6e61
+# CHECK-DAG: ymm7 = 0xf2f4f6f8fafcfef1f3f5f7f9fbfdfff0737577797b7d7f70727476787a7c7e71
+
+# CHECK: Process {{[0-9]+}} exited with status = 0
Index: lldb/lit/Register/x86-64-ymm-write.test
===
--- /dev/null
+++ lldb/lit/Register/x86-64-ymm-write.test
@@ -0,0 +1,44 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86_64 && native-cpu-avx
+# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write ymm8 "{0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03}"
+register write ymm9 "{0x90 0x9f 0x9d 0x9

[Lldb-commits] [lldb] r359779 - Add std::stack and std::queue support to CxxModuleHandler

2019-05-02 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Thu May  2 04:25:50 2019
New Revision: 359779

URL: http://llvm.org/viewvc/llvm-project?rev=359779&view=rev
Log:
Add std::stack and std::queue support to CxxModuleHandler

Reviewers: aprantl, shafik

Reviewed By: aprantl, shafik

Subscribers: lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/Makefile

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/TestQueue.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/stack/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/stack/Makefile

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/stack/TestStack.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/stack/main.cpp
Modified:
lldb/trunk/source/Symbol/CxxModuleHandler.cpp

Added: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/Makefile?rev=359779&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/Makefile
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/Makefile
 Thu May  2 04:25:50 2019
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+USE_LIBCPP := 1
+CXXFLAGS += $(MANDATORY_CXXMODULE_BUILD_CFLAGS)
+CXX_SOURCES := main.cpp
+include $(LEVEL)/Makefile.rules

Added: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/TestQueue.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/TestQueue.py?rev=359779&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/TestQueue.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/TestQueue.py
 Thu May  2 04:25:50 2019
@@ -0,0 +1,47 @@
+"""
+Tests std::queue functionality.
+"""
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestQueue(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+# FIXME: This should work on more setups, so remove these
+# skipIf's in the future.
+@add_test_categories(["libc++"])
+@skipIf(compiler=no_match("clang"))
+@skipIf(oslist=no_match(["linux"]))
+@skipIf(debug_info=no_match(["dwarf"]))
+def test(self):
+self.build()
+
+lldbutil.run_to_source_breakpoint(self,
+"// Set break point at this line.", lldb.SBFileSpec("main.cpp"))
+
+self.runCmd("settings set target.import-std-module true")
+
+# Test std::queue functionality with a std::deque.
+self.expect("expr q_deque.pop()")
+self.expect("expr q_deque.push({4})")
+self.expect("expr (size_t)q_deque.size()", substrs=['(size_t) $0 = 1'])
+self.expect("expr (int)q_deque.front().i", substrs=['(int) $1 = 4'])
+self.expect("expr (int)q_deque.back().i", substrs=['(int) $2 = 4'])
+self.expect("expr q_deque.empty()", substrs=['(bool) $3 = false'])
+self.expect("expr q_deque.pop()")
+self.expect("expr q_deque.emplace(5)")
+self.expect("expr (int)q_deque.front().i", substrs=['(int) $4 = 5'])
+
+# Test std::queue functionality with a std::list.
+self.expect("expr q_list.pop()")
+self.expect("expr q_list.push({4})")
+self.expect("expr (size_t)q_list.size()", substrs=['(size_t) $5 = 1'])
+self.expect("expr (int)q_list.front().i", substrs=['(int) $6 = 4'])
+self.expect("expr (int)q_list.back().i", substrs=['(int) $7 = 4'])
+self.expect("expr q_list.empty()", substrs=['(bool) $8 = false'])
+self.expect("expr q_list.pop()")
+self.expect("expr q_list.emplace(5)")
+self.expect("expr (int)q_list.front().i", substrs=['(int) $9 = 5'])

Added: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/main.cpp?rev=359779&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/main.cpp
 (

[Lldb-commits] [lldb] r359780 - [lldb] [lit] Split 'register read' tests between zmm*, xmm16+, ymm16+

2019-05-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu May  2 04:26:30 2019
New Revision: 359780

URL: http://llvm.org/viewvc/llvm-project?rev=359780&view=rev
Log:
[lldb] [lit] Split 'register read' tests between zmm*, xmm16+, ymm16+

Since Darwin target implements support for zmm* registers without
matching support for the respectively added xmm* and ymm* registers,
split the tests for each register group.  To reduce code duplication,
the tests are using the same source file (which sets more registers
than necessary but that should not cause any harm).

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

Added:
lldb/trunk/lit/Register/x86-64-xmm16-read.test
lldb/trunk/lit/Register/x86-64-ymm16-read.test
Modified:
lldb/trunk/lit/Register/x86-64-zmm-read.test

Added: lldb/trunk/lit/Register/x86-64-xmm16-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-xmm16-read.test?rev=359780&view=auto
==
--- lldb/trunk/lit/Register/x86-64-xmm16-read.test (added)
+++ lldb/trunk/lit/Register/x86-64-xmm16-read.test Thu May  2 04:26:30 2019
@@ -0,0 +1,30 @@
+# XFAIL: system-freebsd
+# XFAIL: system-linux
+# XFAIL: system-netbsd
+# XFAIL: system-windows
+# XFAIL: system-darwin
+# REQUIRES: native && target-x86_64 && 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: xmm16 = {0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x01 0x0e 0x0c 
0x0a 0x08 0x06 0x04 0x02}
+# CHECK-DAG: xmm17 = {0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x11 0x1e 0x1c 
0x1a 0x18 0x16 0x14 0x12}
+# CHECK-DAG: xmm18 = {0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0x21 0x2e 0x2c 
0x2a 0x28 0x26 0x24 0x22}
+# CHECK-DAG: xmm19 = {0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0x31 0x3e 0x3c 
0x3a 0x38 0x36 0x34 0x32}
+# CHECK-DAG: xmm20 = {0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0x41 0x4e 0x4c 
0x4a 0x48 0x46 0x44 0x42}
+# CHECK-DAG: xmm21 = {0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0x51 0x5e 0x5c 
0x5a 0x58 0x56 0x54 0x52}
+# CHECK-DAG: xmm22 = {0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 0x61 0x6e 0x6c 
0x6a 0x68 0x66 0x64 0x62}
+# CHECK-DAG: xmm23 = {0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 0x71 0x7e 0x7c 
0x7a 0x78 0x76 0x74 0x72}
+# CHECK-DAG: xmm24 = {0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 
0x8a 0x88 0x86 0x84 0x82}
+# CHECK-DAG: xmm25 = {0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 
0x9a 0x98 0x96 0x94 0x92}
+# CHECK-DAG: xmm26 = {0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 
0xaa 0xa8 0xa6 0xa4 0xa2}
+# CHECK-DAG: xmm27 = {0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 
0xba 0xb8 0xb6 0xb4 0xb2}
+# CHECK-DAG: xmm28 = {0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 
0xca 0xc8 0xc6 0xc4 0xc2}
+# CHECK-DAG: xmm29 = {0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 
0xda 0xd8 0xd6 0xd4 0xd2}
+# CHECK-DAG: xmm30 = {0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 
0xea 0xe8 0xe6 0xe4 0xe2}
+# CHECK-DAG: xmm31 = {0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 
0xfa 0xf8 0xf6 0xf4 0xf2}
+
+process continue
+# CHECK: Process {{[0-9]+}} exited with status = 0

Added: lldb/trunk/lit/Register/x86-64-ymm16-read.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-ymm16-read.test?rev=359780&view=auto
==
--- lldb/trunk/lit/Register/x86-64-ymm16-read.test (added)
+++ lldb/trunk/lit/Register/x86-64-ymm16-read.test Thu May  2 04:26:30 2019
@@ -0,0 +1,30 @@
+# XFAIL: system-freebsd
+# XFAIL: system-linux
+# XFAIL: system-netbsd
+# XFAIL: system-windows
+# XFAIL: system-darwin
+# REQUIRES: native && target-x86_64 && 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: ymm16 = {0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x01 0x0e 0x0c 
0x0a 0x08 0x06 0x04 0x02 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x80 0x8f 0x8d 
0x8b 0x89 0x87 0x85 0x83}
+# CHECK-DAG: ymm17 = {0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x11 0x1e 0x1c 
0x1a 0x18 0x16 0x14 0x12 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 0x90 0x9f 0x9d 
0x9b 0x99 0x97 0x95 0x93}
+# CHECK-DAG: ymm18 = {0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0x21 0x2e 0x2c 
0x2a 0x28 0x26 0x24 0x22 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 0xa0 0xaf 0xad 
0xab 0xa9 0xa7 0xa5 0xa3}
+# CHECK-DAG: ymm19 = {0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0x31 0x3e 0x3c 
0x3a 0x38 0x36 0x34 0x32 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 0xb0 0xbf 0xbd 
0xbb 0xb9 0xb7 0xb5 0xb3}
+# CHECK-DAG: ymm20 = {0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0x41 0x4e 0x4c 
0x4a 0x48 0x46 0x44 0x42 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2 0xc0 0xcf 0xcd 
0xcb 0xc9 0xc7 0xc5 0xc3}
+# CHECK-DAG: ymm21 = {0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0x51 0x5e 0x5c 
0x5a 0x58 0x56 0x54 0x52 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2 0xd0 0

[Lldb-commits] [PATCH] D61305: Add std::stack and std::queue support to CxxModuleHandler

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359779: Add std::stack and std::queue support to 
CxxModuleHandler (authored by teemperor, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61305?vs=197300&id=197744#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61305

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/TestQueue.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/main.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/stack/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/stack/TestStack.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/stack/main.cpp
  lldb/trunk/source/Symbol/CxxModuleHandler.cpp

Index: lldb/trunk/source/Symbol/CxxModuleHandler.cpp
===
--- lldb/trunk/source/Symbol/CxxModuleHandler.cpp
+++ lldb/trunk/source/Symbol/CxxModuleHandler.cpp
@@ -24,6 +24,8 @@
   "deque",
   "forward_list",
   "list",
+  "queue",
+  "stack",
   "vector",
   // pointers
   "shared_ptr",
Index: lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/TestQueue.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/TestQueue.py
+++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/TestQueue.py
@@ -0,0 +1,47 @@
+"""
+Tests std::queue functionality.
+"""
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestQueue(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+# FIXME: This should work on more setups, so remove these
+# skipIf's in the future.
+@add_test_categories(["libc++"])
+@skipIf(compiler=no_match("clang"))
+@skipIf(oslist=no_match(["linux"]))
+@skipIf(debug_info=no_match(["dwarf"]))
+def test(self):
+self.build()
+
+lldbutil.run_to_source_breakpoint(self,
+"// Set break point at this line.", lldb.SBFileSpec("main.cpp"))
+
+self.runCmd("settings set target.import-std-module true")
+
+# Test std::queue functionality with a std::deque.
+self.expect("expr q_deque.pop()")
+self.expect("expr q_deque.push({4})")
+self.expect("expr (size_t)q_deque.size()", substrs=['(size_t) $0 = 1'])
+self.expect("expr (int)q_deque.front().i", substrs=['(int) $1 = 4'])
+self.expect("expr (int)q_deque.back().i", substrs=['(int) $2 = 4'])
+self.expect("expr q_deque.empty()", substrs=['(bool) $3 = false'])
+self.expect("expr q_deque.pop()")
+self.expect("expr q_deque.emplace(5)")
+self.expect("expr (int)q_deque.front().i", substrs=['(int) $4 = 5'])
+
+# Test std::queue functionality with a std::list.
+self.expect("expr q_list.pop()")
+self.expect("expr q_list.push({4})")
+self.expect("expr (size_t)q_list.size()", substrs=['(size_t) $5 = 1'])
+self.expect("expr (int)q_list.front().i", substrs=['(int) $6 = 4'])
+self.expect("expr (int)q_list.back().i", substrs=['(int) $7 = 4'])
+self.expect("expr q_list.empty()", substrs=['(bool) $8 = false'])
+self.expect("expr q_list.pop()")
+self.expect("expr q_list.emplace(5)")
+self.expect("expr (int)q_list.front().i", substrs=['(int) $9 = 5'])
Index: lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/main.cpp
===
--- lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/main.cpp
+++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/main.cpp
@@ -0,0 +1,16 @@
+#include 
+#include 
+#include 
+
+struct C {
+  // Constructor for testing emplace.
+  C(int i) : i(i) {};
+  int i;
+};
+
+int main(int argc, char **argv) {
+  // std::deque is the default container.
+  std::queue q_deque({{1}});
+  std::queue> q_list({{1}});
+  return 0; // Set break point at this line.
+}
Index: lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/Makefile
===
--- lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/Makefile
+++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/queue/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+US

[Lldb-commits] [PATCH] D61376: [lldb] [lit] Split 'register read' tests between zmm*, xmm16+, ymm16+

2019-05-02 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB359780: [lldb] [lit] Split 'register read' 
tests between zmm*, xmm16+, ymm16+ (authored by mgorny, committed by ).
Herald added a subscriber: teemperor.
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D61376?vs=197541&id=197745#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61376

Files:
  lit/Register/x86-64-xmm16-read.test
  lit/Register/x86-64-ymm16-read.test
  lit/Register/x86-64-zmm-read.test

Index: lit/Register/x86-64-ymm16-read.test
===
--- lit/Register/x86-64-ymm16-read.test
+++ lit/Register/x86-64-ymm16-read.test
@@ -0,0 +1,30 @@
+# XFAIL: system-freebsd
+# XFAIL: system-linux
+# XFAIL: system-netbsd
+# XFAIL: system-windows
+# XFAIL: system-darwin
+# REQUIRES: native && target-x86_64 && 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: ymm16 = {0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83}
+# CHECK-DAG: ymm17 = {0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93}
+# CHECK-DAG: ymm18 = {0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3}
+# CHECK-DAG: ymm19 = {0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3}
+# CHECK-DAG: ymm20 = {0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2 0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3}
+# CHECK-DAG: ymm21 = {0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2 0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3}
+# CHECK-DAG: ymm22 = {0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2 0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3}
+# CHECK-DAG: ymm23 = {0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3}
+# CHECK-DAG: ymm24 = {0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03}
+# CHECK-DAG: ymm25 = {0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13}
+# CHECK-DAG: ymm26 = {0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23}
+# CHECK-DAG: ymm27 = {0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33}
+# CHECK-DAG: ymm28 = {0xc0 0xcf 0xcd 0xcb 0xc9 0xc7 0xc5 0xc3 0xc1 0xce 0xcc 0xca 0xc8 0xc6 0xc4 0xc2 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 0x4b 0x49 0x47 0x45 0x43}
+# CHECK-DAG: ymm29 = {0xd0 0xdf 0xdd 0xdb 0xd9 0xd7 0xd5 0xd3 0xd1 0xde 0xdc 0xda 0xd8 0xd6 0xd4 0xd2 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 0x5b 0x59 0x57 0x55 0x53}
+# CHECK-DAG: ymm30 = {0xe0 0xef 0xed 0xeb 0xe9 0xe7 0xe5 0xe3 0xe1 0xee 0xec 0xea 0xe8 0xe6 0xe4 0xe2 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 0x6b 0x69 0x67 0x65 0x63}
+# CHECK-DAG: ymm31 = {0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 0x7b 0x79 0x77 0x75 0x73}
+
+process continue
+# CHECK: Process {{[0-9]+}} exited with status = 0
Index: lit/Register/x86-64-xmm16-read.test
===
--- lit/Register/x86-64-xmm16-read.test
+++ lit/Register/x86-64-xmm16-read.test
@@ -0,0 +1,30 @@
+# XFAIL: system-freebsd
+# XFAIL: system-linux
+# XFAIL: system-netbsd
+# XFAIL: system-windows
+# XFAIL: system-darwin
+# REQUIRES: native && target-x86_64 && 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: xmm16 = {0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02}
+# CHECK-DAG: xmm17 = {0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12}
+# CHECK-DAG: xmm18 = {0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22}
+# CHECK-DAG: xmm19 = {0x

[Lldb-commits] [PATCH] D61438: [ASTImporter] Use llvm::Expected and Error in the importer API

2019-05-02 Thread Gabor Marton via Phabricator via lldb-commits
martong created this revision.
martong added reviewers: shafik, teemperor, aprantl, a_sidorin, balazske.
Herald added subscribers: lldb-commits, cfe-commits, gamesh411, Szelethus, 
dkrupp, rnkovacs.
Herald added a reviewer: a.sidorin.
Herald added projects: clang, LLDB.

This is the final phase of the refactoring towards using llvm::Expected
and llvm::Error in the ASTImporter API.
This involves the following:

- remove old Import functions which returned with a pointer,
- use the Import_New functions (which return with Err or Expected) everywhere 
and handle their return value
- rename Import_New functions to Import

This affects both Clang and LLDB.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61438

Files:
  clang/include/clang/AST/ASTImporter.h
  clang/lib/AST/ASTImporter.cpp
  clang/lib/AST/ExternalASTMerger.cpp
  clang/lib/CrossTU/CrossTranslationUnit.cpp
  clang/lib/Frontend/ASTMerge.cpp
  clang/unittests/AST/ASTImporterTest.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/ClangASTImporter.cpp
  lldb/source/Symbol/CxxModuleHandler.cpp

Index: lldb/source/Symbol/CxxModuleHandler.cpp
===
--- lldb/source/Symbol/CxxModuleHandler.cpp
+++ lldb/source/Symbol/CxxModuleHandler.cpp
@@ -218,8 +218,10 @@
   for (const TemplateArgument &arg : foreign_args.asArray()) {
 switch (arg.getKind()) {
 case TemplateArgument::Type: {
-  llvm::Expected type = m_importer->Import_New(arg.getAsType());
+  llvm::Expected type = m_importer->Import(arg.getAsType());
   if (!type) {
+// FIXME log? Indicate error to user?
+lldbassert(0 && "Couldn't import a type!");
 llvm::consumeError(type.takeError());
 return {};
   }
@@ -229,8 +231,10 @@
 case TemplateArgument::Integral: {
   llvm::APSInt integral = arg.getAsIntegral();
   llvm::Expected type =
-  m_importer->Import_New(arg.getIntegralType());
+  m_importer->Import(arg.getIntegralType());
   if (!type) {
+// FIXME log? Indicate error to user?
+lldbassert(0 && "Couldn't import a type!");
 llvm::consumeError(type.takeError());
 return {};
   }
Index: lldb/source/Symbol/ClangASTImporter.cpp
===
--- lldb/source/Symbol/ClangASTImporter.cpp
+++ lldb/source/Symbol/ClangASTImporter.cpp
@@ -62,8 +62,15 @@
 
   ASTImporterDelegate::CxxModuleScope std_scope(*delegate_sp, dst_ast);
 
-  if (delegate_sp)
-return delegate_sp->Import(type);
+  if (delegate_sp) {
+if (llvm::Expected ret_or_error = delegate_sp->Import(type))
+  return *ret_or_error;
+else {
+  // FIXME log? Indicate error to user?
+  lldbassert(0 && "Couldn't import a type!");
+  llvm::consumeError(ret_or_error.takeError());
+}
+  }
 
   return QualType();
 }
@@ -106,7 +113,7 @@
   ASTImporterDelegate::CxxModuleScope std_scope(*delegate_sp, dst_ast);
 
   if (delegate_sp) {
-clang::Decl *result = delegate_sp->Import(decl);
+llvm::Expected result = delegate_sp->Import(decl);
 
 if (!result) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
@@ -127,9 +134,14 @@
   "metadata 0x%" PRIx64,
   decl->getDeclKindName(), user_id);
   }
+
+  // FIXME log?
+  llvm::consumeError(result.takeError());
+
+  return nullptr;
 }
 
-return result;
+return *result;
   }
 
   return nullptr;
@@ -641,7 +653,11 @@
 TagDecl *origin_tag_decl = llvm::dyn_cast(decl_origin.decl);
 
 for (Decl *origin_child_decl : origin_tag_decl->decls()) {
-  delegate_sp->Import(origin_child_decl);
+  llvm::Expected imported_or_err =
+  delegate_sp->Import(origin_child_decl);
+  if (!imported_or_err)
+// FIXME return with false?
+consumeError(imported_or_err.takeError());
 }
 
 if (RecordDecl *record_decl = dyn_cast(origin_tag_decl)) {
@@ -666,7 +682,11 @@
   llvm::dyn_cast(decl_origin.decl);
 
   for (Decl *origin_child_decl : origin_interface_decl->decls()) {
-delegate_sp->Import(origin_child_decl);
+llvm::Expected imported_or_err =
+delegate_sp->Import(origin_child_decl);
+if (!imported_or_err)
+  // FIXME return with false?
+  consumeError(imported_or_err.takeError());
   }
 
   return true;
@@ -919,7 +939,16 @@
   to_cxx_record->startDefinition();
   */
 
-  ImportDefinition(from);
+  llvm::Error Err = ImportDefinition(from);
+  if (Err) {
+// FIXME Indicate import error to user?
+Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
+if (log)
+  log->Printf("[ClangASTImporter] Error during importing definition!");
+lldbassert(0 && "Coul

[Lldb-commits] [PATCH] D61431: [lldb] [lit] Introduce tests for writing YMM registers

2019-05-02 Thread Michał Górny via Phabricator via lldb-commits
mgorny updated this revision to Diff 197760.
mgorny added a comment.

Switch test output to resemble LLDB output more. However, I've added extra 
space around `{` and `}` to make output routine simpler.


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

https://reviews.llvm.org/D61431

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

Index: lldb/lit/Register/x86-ymm-write.test
===
--- /dev/null
+++ lldb/lit/Register/x86-ymm-write.test
@@ -0,0 +1,28 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86 && native-cpu-avx
+# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+
+process continue
+# CHECK: process continue
+
+# 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: Process {{[0-9]+}} exited with status = 0
Index: lldb/lit/Register/x86-64-ymm-write.test
===
--- /dev/null
+++ lldb/lit/Register/x86-64-ymm-write.test
@@ -0,0 +1,44 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86_64 && native-cpu-avx
+# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register

[Lldb-commits] [lldb] r359783 - [lldb] [lit] Introduce tests for writing YMM registers

2019-05-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu May  2 05:55:44 2019
New Revision: 359783

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

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

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

Added: lldb/trunk/lit/Register/Inputs/x86-ymm-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-ymm-write.cpp?rev=359783&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-ymm-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-ymm-write.cpp Thu May  2 05:55:44 2019
@@ -0,0 +1,77 @@
+#include 
+#include 
+#include 
+
+union alignas(32) ymm_t {
+  uint64_t as_uint64[4];
+  uint8_t as_uint8[32];
+};
+
+int main() {
+  constexpr ymm_t ymm_fill = {
+.as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F,
+   0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }
+  };
+
+  ymm_t ymm[16];
+
+  asm volatile(
+"vmovaps  %1, %%ymm0\n\t"
+"vmovaps  %1, %%ymm1\n\t"
+"vmovaps  %1, %%ymm2\n\t"
+"vmovaps  %1, %%ymm3\n\t"
+"vmovaps  %1, %%ymm4\n\t"
+"vmovaps  %1, %%ymm5\n\t"
+"vmovaps  %1, %%ymm6\n\t"
+"vmovaps  %1, %%ymm7\n\t"
+#if defined(__x86_64__) || defined(_M_X64)
+"vmovaps  %1, %%ymm8\n\t"
+"vmovaps  %1, %%ymm9\n\t"
+"vmovaps  %1, %%ymm10\n\t"
+"vmovaps  %1, %%ymm11\n\t"
+"vmovaps  %1, %%ymm12\n\t"
+"vmovaps  %1, %%ymm13\n\t"
+"vmovaps  %1, %%ymm14\n\t"
+"vmovaps  %1, %%ymm15\n\t"
+#endif
+"\n\t"
+"int3\n\t"
+"\n\t"
+"lea %0, %%rbx\n\t"
+"vmovaps %%ymm0,  0x000(%%rbx)\n\t"
+"vmovaps %%ymm1,  0x020(%%rbx)\n\t"
+"vmovaps %%ymm2,  0x040(%%rbx)\n\t"
+"vmovaps %%ymm3,  0x060(%%rbx)\n\t"
+"vmovaps %%ymm4,  0x080(%%rbx)\n\t"
+"vmovaps %%ymm5,  0x0A0(%%rbx)\n\t"
+"vmovaps %%ymm6,  0x0C0(%%rbx)\n\t"
+"vmovaps %%ymm7,  0x0E0(%%rbx)\n\t"
+#if defined(__x86_64__) || defined(_M_X64)
+"vmovaps %%ymm8,  0x100(%%rbx)\n\t"
+"vmovaps %%ymm9,  0x120(%%rbx)\n\t"
+"vmovaps %%ymm10, 0x140(%%rbx)\n\t"
+"vmovaps %%ymm11, 0x160(%%rbx)\n\t"
+"vmovaps %%ymm12, 0x180(%%rbx)\n\t"
+"vmovaps %%ymm13, 0x1A0(%%rbx)\n\t"
+"vmovaps %%ymm14, 0x1C0(%%rbx)\n\t"
+"vmovaps %%ymm15, 0x1E0(%%rbx)\n\t"
+#endif
+: "=m"(ymm)
+: "m"(ymm_fill)
+: "%ymm0", "%ymm1", "%ymm2", "%ymm3", "%ymm4", "%ymm5", "%ymm6", "%ymm7",
+#if defined(__x86_64__) || defined(_M_X64)
+  "%ymm8", "%ymm9", "%ymm10", "%ymm11", "%ymm12", "%ymm13", "%ymm14",
+  "%ymm15",
+#endif
+  "%rbx"
+  );
+
+  for (int i = 0; i < 16; ++i) {
+printf("ymm%d = { ", i);
+for (int j = 0; j < sizeof(ymm->as_uint8); ++j)
+  printf("0x%02x ", ymm[i].as_uint8[j]);
+printf("}\n");
+  }
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-ymm-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-ymm-write.test?rev=359783&view=auto
==
--- lldb/trunk/lit/Register/x86-64-ymm-write.test (added)
+++ lldb/trunk/lit/Register/x86-64-ymm-write.test Thu May  2 05:55:44 2019
@@ -0,0 +1,44 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86_64 && native-cpu-avx
+# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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 0x

[Lldb-commits] [lldb] r359784 - [lldb] [lit] Use LLDB-like output for XMM registers in write tests

2019-05-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu May  2 05:55:54 2019
New Revision: 359784

URL: http://llvm.org/viewvc/llvm-project?rev=359784&view=rev
Log:
[lldb] [lit] Use LLDB-like output for XMM registers in write tests

Modified:
lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
lldb/trunk/lit/Register/x86-64-write.test
lldb/trunk/lit/Register/x86-mm-xmm-write.test

Modified: lldb/trunk/lit/Register/Inputs/x86-64-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-64-write.cpp?rev=359784&r1=359783&r2=359784&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-64-write.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-64-write.cpp Thu May  2 05:55:54 2019
@@ -2,12 +2,15 @@
 #include 
 #include 
 
-struct alignas(16) xmm_t {
-  uint64_t a, b;
+union alignas(16) xmm_t {
+  uint64_t as_uint64[2];
+  uint8_t as_uint8[16];
 };
 
 int main() {
-  constexpr xmm_t xmm_fill = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F };
+  constexpr xmm_t xmm_fill = {
+.as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }
+  };
 
   uint64_t r64[8];
   xmm_t xmm[8];
@@ -60,8 +63,12 @@ int main() {
 
   for (int i = 0; i < 8; ++i)
 printf("r%d = 0x%016" PRIx64 "\n", i+8, r64[i]);
-  for (int i = 0; i < 8; ++i)
-printf("xmm%d = 0x%016" PRIx64 "%016" PRIx64 "\n", i+8, xmm[i].b, 
xmm[i].a);
+  for (int i = 0; i < 8; ++i) {
+printf("xmm%d = { ", i+8);
+for (int j = 0; j < sizeof(xmm->as_uint8); ++j)
+  printf("0x%02x ", xmm[i].as_uint8[j]);
+printf("}\n");
+  }
 
   return 0;
 }

Modified: lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp?rev=359784&r1=359783&r2=359784&view=diff
==
--- lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp (original)
+++ lldb/trunk/lit/Register/Inputs/x86-mm-xmm-write.cpp Thu May  2 05:55:54 2019
@@ -2,12 +2,15 @@
 #include 
 #include 
 
-struct alignas(16) xmm_t {
-  uint64_t a, b;
+union alignas(16) xmm_t {
+  uint64_t as_uint64[2];
+  uint8_t as_uint8[16];
 };
 
 int main() {
-  constexpr xmm_t xmm_fill = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F };
+  constexpr xmm_t xmm_fill = {
+.as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }
+  };
 
   uint64_t mm[8];
   xmm_t xmm[8];
@@ -60,8 +63,12 @@ int main() {
 
   for (int i = 0; i < 8; ++i)
 printf("mm%d = 0x%016" PRIx64 "\n", i, mm[i]);
-  for (int i = 0; i < 8; ++i)
-printf("xmm%d = 0x%016" PRIx64 "%016" PRIx64 "\n", i, xmm[i].b, xmm[i].a);
+  for (int i = 0; i < 8; ++i) {
+printf("xmm%d = { ", i);
+for (int j = 0; j < sizeof(xmm->as_uint8); ++j)
+  printf("0x%02x ", xmm[i].as_uint8[j]);
+printf("}\n");
+  }
 
   return 0;
 }

Modified: lldb/trunk/lit/Register/x86-64-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-write.test?rev=359784&r1=359783&r2=359784&view=diff
==
--- lldb/trunk/lit/Register/x86-64-write.test (original)
+++ lldb/trunk/lit/Register/x86-64-write.test Thu May  2 05:55:54 2019
@@ -35,13 +35,13 @@ process continue
 # CHECK-DAG: r14 = 0x6162636465666768
 # CHECK-DAG: r15 = 0x7172737475767778
 
-# CHECK-DAG: xmm8 = 0x030507090b0d0f00020406080a0c0e01
-# CHECK-DAG: xmm9 = 0x131517191b1d1f10121416181a1c1e11
-# CHECK-DAG: xmm10 = 0x232527292b2d2f20222426282a2c2e21
-# CHECK-DAG: xmm11 = 0x333537393b3d3f30323436383a3c3e31
-# CHECK-DAG: xmm12 = 0x434547494b4d4f40424446484a4c4e41
-# CHECK-DAG: xmm13 = 0x535557595b5d5f50525456585a5c5e51
-# CHECK-DAG: xmm14 = 0x636567696b6d6f60626466686a6c6e61
-# CHECK-DAG: xmm15 = 0x737577797b7d7f70727476787a7c7e71
+# CHECK-DAG: xmm8 = { 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02 0x00 0x0f 0x0d 
0x0b 0x09 0x07 0x05 0x03 }
+# CHECK-DAG: xmm9 = { 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12 0x10 0x1f 0x1d 
0x1b 0x19 0x17 0x15 0x13 }
+# CHECK-DAG: xmm10 = { 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22 0x20 0x2f 0x2d 
0x2b 0x29 0x27 0x25 0x23 }
+# CHECK-DAG: xmm11 = { 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32 0x30 0x3f 0x3d 
0x3b 0x39 0x37 0x35 0x33 }
+# CHECK-DAG: xmm12 = { 0x41 0x4e 0x4c 0x4a 0x48 0x46 0x44 0x42 0x40 0x4f 0x4d 
0x4b 0x49 0x47 0x45 0x43 }
+# CHECK-DAG: xmm13 = { 0x51 0x5e 0x5c 0x5a 0x58 0x56 0x54 0x52 0x50 0x5f 0x5d 
0x5b 0x59 0x57 0x55 0x53 }
+# CHECK-DAG: xmm14 = { 0x61 0x6e 0x6c 0x6a 0x68 0x66 0x64 0x62 0x60 0x6f 0x6d 
0x6b 0x69 0x67 0x65 0x63 }
+# CHECK-DAG: xmm15 = { 0x71 0x7e 0x7c 0x7a 0x78 0x76 0x74 0x72 0x70 0x7f 0x7d 
0x7b 0x79 0x77 0x75 0x73 }
 
 # CHECK: Process {{[0-9]+}} exited with status = 0

Modified: lldb/trunk/lit/Register/x86-mm-xmm-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-mm-xmm-write.test?rev=359784&r1=359783&r2=359784&view=diff
===

[Lldb-commits] [PATCH] D61431: [lldb] [lit] Introduce tests for writing YMM registers

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

Changed prior to commit:
  https://reviews.llvm.org/D61431?vs=197760&id=197762#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61431

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

Index: lit/Register/x86-ymm-write.test
===
--- lit/Register/x86-ymm-write.test
+++ lit/Register/x86-ymm-write.test
@@ -0,0 +1,28 @@
+# XFAIL: system-windows
+# REQUIRES: native && target-x86 && native-cpu-avx
+# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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}"
+
+process continue
+# CHECK: process continue
+
+# 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: Process {{[0-9]+}} exited with status = 0
Index: lit/Register/Inputs/x86-ymm-write.cpp
===
--- lit/Register/Inputs/x86-ymm-write.cpp
+++ lit/Register/Inputs/x86-ymm-write.cpp
@@ -0,0 +1,77 @@
+#include 
+#include 
+#include 
+
+union alignas(32) ymm_t {
+  uint64_t as_uint64[4];
+  uint8_t as_uint8[32];
+};
+
+int main() {
+  constexpr ymm_t ymm_fill = {
+.as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F,
+   0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }
+  };
+
+  ymm_t ymm[16];
+
+  asm volatile(
+"vmovaps  %1, %%ymm0\n\t"
+"vmovaps  %1, %%ymm1\n\t"
+"vmovaps  %1, %%ymm2\n\t"
+"vmovaps  %1, %%ymm3\n\t"
+"vmovaps  %1, %%ymm4\n\t"
+"vmovaps  %1, %%ymm5\n\t"
+"vmovaps  %1, %%ymm6\n\t"
+"vmovaps  %1, %%ymm7\n\t"
+#if defined(__x86_64__) || defined(_M_X64)
+"vmovaps  %1, %%ymm8\n\t"
+"vmovaps  %1, %%ymm9\n\t"
+"vmovaps  %1, %%ymm10\n\t"
+"vmovaps  %1, %%ymm11\n\

[Lldb-commits] [PATCH] D61439: [lldb] [lit] Add write tests for ZMM registers

2019-05-02 Thread Michał Górny via Phabricator via lldb-commits
mgorny created this revision.
mgorny added reviewers: labath, JDevlieghere, krytarowski.

As before, it's only build-tested as I don't have access to any AVX512-capable 
hardware.


https://reviews.llvm.org/D61439

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

Index: lldb/lit/Register/x86-zmm-write.test
===
--- /dev/null
+++ lldb/lit/Register/x86-zmm-write.test
@@ -0,0 +1,31 @@
+# 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-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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 0x7b 0x79 0x77 0x75 0x73 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2}"
+register write zmm4 "{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 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02}"
+register write zmm5 "{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 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12}"
+register write zmm6 "{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 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22}"
+register write zmm7 "{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 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32}"
+
+process continue
+# CHECK: process continue
+
+# 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 0x7b 0x79 0x77 0x75 0x73 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2 }
+# CHECK-DAG: 

[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Konrad Kleine via Phabricator via lldb-commits
kkleine created this revision.
Herald added subscribers: lldb-commits, kadircet, arphaman.
Herald added a project: LLDB.

According to [C128] "Virtual functions should specify exactly one
of `virtual`, `override`, or `final`", I've added override where a
virtual function is overriden but the explicit `override` keyword
was missing. Whenever both `virtual` and `override` were specified,
I removed `virtual`. As C.128 puts it:

> [...] writing more than one of these three is both redundant and
>  a potential source of errors.

I anticipate a discussion about whether or not to add `override` to
destructors but I went for it because of an example in [ISOCPP1000].
Let me repeat the comment for you here:

Consider this code:

  struct Base {
virtual ~Base(){}
  };
  
  struct SubClass : Base {
~SubClass() {
  std::cout << "It works!\n";
}
  };
  
  int main() {
std::unique_ptr ptr = std::make_unique();
  }

If for some odd reason somebody removes the `virtual` keyword from the
`Base` struct, the code will no longer print `It works!`. So adding
`override` to destructors actively protects us from accidentally
breaking out code at runtime.

[C128]: 
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c128-virtual-functions-should-specify-exactly-one-of-virtual-override-or-final
[ISOCPP1000]: 
https://github.com/isocpp/CppCoreGuidelines/issues/1000#issuecomment-476951555


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61440

Files:
  lldb/include/lldb/Core/Architecture.h
  lldb/include/lldb/Core/StreamBuffer.h
  lldb/include/lldb/Core/ValueObjectVariable.h
  lldb/include/lldb/Target/DynamicLoader.h
  lldb/include/lldb/Target/StackFrameRecognizer.h
  lldb/include/lldb/Target/StructuredDataPlugin.h
  lldb/include/lldb/Utility/Baton.h
  lldb/include/lldb/Utility/DataBufferLLVM.h
  lldb/include/lldb/Utility/StringExtractorGDBRemote.h
  lldb/source/API/SBBreakpointOptionCommon.h
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/ObjC/NSDictionary.h
  lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/PostfixExpression.cpp
  lldb/source/Target/StructuredDataPlugin.cpp
  lldb/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp
  lldb/unittests/Editline/EditlineTest.cpp
  lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
  lldb/unittests/Symbol/TestClangASTContext.cpp
  lldb/unittests/Target/ProcessInstanceInfoTest.cpp

Index: lldb/unittests/Target/ProcessInstanceInfoTest.cpp
===
--- lldb/unittests/Target/ProcessInstanceInfoTest.cpp
+++ lldb/unittests/Target/ProcessInstanceInfoTest.cpp
@@ -16,13 +16,13 @@
 /// for odd ones.
 class DummyUserIDResolver : public UserIDResolver {
 protected:
-  llvm::Optional DoGetUserName(id_t uid) {
+  llvm::Optional DoGetUserName(id_t uid) override {
 if (uid % 2)
   return ("user" + llvm::Twine(uid)).str();
 return llvm::None;
   }
 
-  llvm::Optional DoGetGroupName(id_t gid) {
+  llvm::Optional DoGetGroupName(id_t gid) override {
 if (gid % 2)
   return ("group" + llvm::Twine(gid)).str();
 return llvm::None;
Index: lldb/unittests/Symbol/TestClangASTContext.cpp
===
--- lldb/unittests/Symbol/TestClangASTContext.cpp
+++ lldb/unittests/Symbol/TestClangASTContext.cpp
@@ -34,12 +34,12 @@
 FileSystem::Terminate();
   }
 
-  virtual void SetUp() override {
+  void SetUp() override {
 std::string triple = HostInfo::GetTargetTriple();
 m_ast.reset(new ClangASTContext(triple.c_str()));
   }
 
-  virtual void TearDown() override { m_ast.reset(); }
+  void TearDown() override { m_ast.reset(); }
 
 protected:
   std::unique_ptr m_ast;
Index: lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
===
--- 

[Lldb-commits] [PATCH] D61439: [lldb] [lit] Add write tests for AVX-512 registers (zmm, xmm15+, ymm15+)

2019-05-02 Thread Michał Górny via Phabricator via lldb-commits
mgorny updated this revision to Diff 197772.
mgorny retitled this revision from "[lldb] [lit] Add write tests for ZMM 
registers" to "[lldb] [lit] Add write tests for AVX-512 registers (zmm,  
xmm15+, ymm15+)".
mgorny added a comment.

Added xmm15+ and ymm15+ tests.


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

https://reviews.llvm.org/D61439

Files:
  lldb/lit/Register/Inputs/x86-zmm-write.cpp
  lldb/lit/Register/x86-64-xmm16-write.test
  lldb/lit/Register/x86-64-ymm16-write.test
  lldb/lit/Register/x86-64-zmm-write.test
  lldb/lit/Register/x86-zmm-write.test

Index: lldb/lit/Register/x86-zmm-write.test
===
--- /dev/null
+++ lldb/lit/Register/x86-zmm-write.test
@@ -0,0 +1,31 @@
+# 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-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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 0x7b 0x79 0x77 0x75 0x73 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2}"
+register write zmm4 "{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 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02}"
+register write zmm5 "{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 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12}"
+register write zmm6 "{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 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22}"
+register write zmm7 "{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 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32}"
+
+process continue
+# CHECK: process continue
+
+# 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 

[Lldb-commits] [lldb] r359787 - [lldb] [lit] Mark x86-64-ymm-write XFAIL on Darwin

2019-05-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu May  2 07:03:42 2019
New Revision: 359787

URL: http://llvm.org/viewvc/llvm-project?rev=359787&view=rev
Log:
[lldb] [lit] Mark x86-64-ymm-write XFAIL on Darwin

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

Modified: lldb/trunk/lit/Register/x86-64-ymm-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-ymm-write.test?rev=359787&r1=359786&r2=359787&view=diff
==
--- lldb/trunk/lit/Register/x86-64-ymm-write.test (original)
+++ lldb/trunk/lit/Register/x86-64-ymm-write.test Thu May  2 07:03:42 2019
@@ -1,3 +1,4 @@
+# XFAIL: system-darwin
 # XFAIL: system-windows
 # REQUIRES: native && target-x86_64 && native-cpu-avx
 # RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t


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


[Lldb-commits] [PATCH] D61423: MinidumpYAML: add support for the ThreadList stream

2019-05-02 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

lgtm


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61423



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


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

2019-05-02 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

Jim: this is a modified version of the patch we had talked about a while ago 
with needed fixes for making sure the inline function call site is the same as 
the starting file and line. We have iterated on this locally already, so I am 
good with this patch. Let us know what you think.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61292



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


[Lldb-commits] [lldb] r359794 - Fix the compile RUN line in x86-64-ymm-write.test

2019-05-02 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu May  2 08:16:01 2019
New Revision: 359794

URL: http://llvm.org/viewvc/llvm-project?rev=359794&view=rev
Log:
Fix the compile RUN line in x86-64-ymm-write.test

Optimistically assuming this was the result of the darwin failure too,
so removing the XFAIL there.

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

Modified: lldb/trunk/lit/Register/x86-64-ymm-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-ymm-write.test?rev=359794&r1=359793&r2=359794&view=diff
==
--- lldb/trunk/lit/Register/x86-64-ymm-write.test (original)
+++ lldb/trunk/lit/Register/x86-64-ymm-write.test Thu May  2 08:16:01 2019
@@ -1,7 +1,6 @@
-# XFAIL: system-darwin
 # XFAIL: system-windows
 # REQUIRES: native && target-x86_64 && native-cpu-avx
-# RUN: %clangxx %p/Inputs/x86-ymm-read.cpp -o %t
+# RUN: %clangxx %p/Inputs/x86-ymm-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] [PATCH] D61361: PluginInstructionARM: avoid unnecessary link

2019-05-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

My point is that we shouldn't need to differentiate between "link" dependencies 
and "other" dependencies, as it's not a well-defined boundary. It's easy to 
turn one into the other by moving things in or out of line. Hence my suggestion 
- move the required things into a different (new?) module.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61361



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


[Lldb-commits] [PATCH] D61361: PluginInstructionARM: avoid unnecessary link

2019-05-02 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd updated this revision to Diff 197793.
compnerd added a comment.

convert link to a proper dependency


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61361

Files:
  source/Plugins/Instruction/ARM/CMakeLists.txt


Index: source/Plugins/Instruction/ARM/CMakeLists.txt
===
--- source/Plugins/Instruction/ARM/CMakeLists.txt
+++ source/Plugins/Instruction/ARM/CMakeLists.txt
@@ -8,7 +8,7 @@
 lldbInterpreter
 lldbSymbol
 lldbTarget
-lldbPluginProcessUtility
   LINK_COMPONENTS
 Support
   )
+add_dependencies(lldbPluginInstructionARM PRIVATE lldbPluginProcessUtility)


Index: source/Plugins/Instruction/ARM/CMakeLists.txt
===
--- source/Plugins/Instruction/ARM/CMakeLists.txt
+++ source/Plugins/Instruction/ARM/CMakeLists.txt
@@ -8,7 +8,7 @@
 lldbInterpreter
 lldbSymbol
 lldbTarget
-lldbPluginProcessUtility
   LINK_COMPONENTS
 Support
   )
+add_dependencies(lldbPluginInstructionARM PRIVATE lldbPluginProcessUtility)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61361: PluginInstructionARM: avoid unnecessary link

2019-05-02 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd added a comment.

@labath - I don't have a problem with the dependency - we can do a 
`add_dependency` for the plugin.  My issue is that this should not be linked 
against.  This mess of dependencies makes it difficult to track down the bloat 
in `lldb-server`.  Currently, `lldb-server` weighs in at ~9M while `gdb-server` 
is ~700K.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61361



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


[Lldb-commits] [PATCH] D61361: PluginInstructionARM: avoid unnecessary link

2019-05-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Or another thing: if one sees a header from module X being included in file Y, 
then it's reasonable to assume it's fair game to include another file from the 
same module X is fair game. But this creates a two classes of header files: 
files in X, which don't have a link dependency, and those that do...


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61361



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


[Lldb-commits] [lldb] r359795 - Reinstate xfail-darwin in x86-64-ymm-write.test

2019-05-02 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu May  2 08:38:09 2019
New Revision: 359795

URL: http://llvm.org/viewvc/llvm-project?rev=359795&view=rev
Log:
Reinstate xfail-darwin in x86-64-ymm-write.test

It turns out writing into ymm registers really does not work there.

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

Modified: lldb/trunk/lit/Register/x86-64-ymm-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-ymm-write.test?rev=359795&r1=359794&r2=359795&view=diff
==
--- lldb/trunk/lit/Register/x86-64-ymm-write.test (original)
+++ lldb/trunk/lit/Register/x86-64-ymm-write.test Thu May  2 08:38:09 2019
@@ -1,3 +1,4 @@
+# XFAIL: system-darwin
 # XFAIL: system-windows
 # REQUIRES: native && target-x86_64 && native-cpu-avx
 # RUN: %clangxx %p/Inputs/x86-ymm-write.cpp -o %t


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


[Lldb-commits] [PATCH] D61439: [lldb] [lit] Add write tests for AVX-512 registers (zmm, xmm15+, ymm15+)

2019-05-02 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.

The tests look fine to me, but given that mac doesn't support writing to ymm 
registers, I'd be surprised if these were to pass too (so I'd add system-darwin 
to the list of XFAILs too).

At that point, we've run out of systems where this test can possibly pass, so 
it's kinda hard to check that it is written correctly, but since you've went 
through the trouble of writing it, I suppose we can include it here for future 
reference.


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

https://reviews.llvm.org/D61439



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


[Lldb-commits] [PATCH] D61360: Initialization: remove ObjectContainer from Common

2019-05-02 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd added inline comments.



Comment at: source/API/SystemInitializerFull.cpp:132-133
 
+  ObjectContainerBSDArchive::Initialize();
+  ObjectContainerUniversalMachO::Initialize();
+

labath wrote:
> xiaobai wrote:
> > You need to include the headers for these classes
> And remove them from `SystemInitializerCommon.h`
They never were in `SystemInitializerCommon.h`


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61360



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


[Lldb-commits] [PATCH] D61360: Initialization: remove ObjectContainer from Common

2019-05-02 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd updated this revision to Diff 197797.
compnerd marked 6 inline comments as done.
compnerd added a comment.

address feedback


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61360

Files:
  source/API/SystemInitializerFull.cpp
  source/Initialization/CMakeLists.txt
  source/Initialization/SystemInitializerCommon.cpp


Index: source/Initialization/SystemInitializerCommon.cpp
===
--- source/Initialization/SystemInitializerCommon.cpp
+++ source/Initialization/SystemInitializerCommon.cpp
@@ -101,16 +101,10 @@

   process_gdb_remote::ProcessGDBRemoteLog::Initialize();

-  // Initialize plug-ins
-  ObjectContainerBSDArchive::Initialize();
-
   EmulateInstructionARM::Initialize();
   EmulateInstructionMIPS::Initialize();
   EmulateInstructionMIPS64::Initialize();

-  // Apple/Darwin hosted plugins
-  ObjectContainerUniversalMachO::Initialize();
-
 #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
   ProcessPOSIXLog::Initialize();
 #endif
@@ -124,14 +118,11 @@
 void SystemInitializerCommon::Terminate() {
   static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
   Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
-  ObjectContainerBSDArchive::Terminate();

   EmulateInstructionARM::Terminate();
   EmulateInstructionMIPS::Terminate();
   EmulateInstructionMIPS64::Terminate();

-  ObjectContainerUniversalMachO::Terminate();
-
 #if defined(_MSC_VER)
   ProcessWindowsLog::Terminate();
 #endif
Index: source/Initialization/CMakeLists.txt
===
--- source/Initialization/CMakeLists.txt
+++ source/Initialization/CMakeLists.txt
@@ -17,8 +17,6 @@
 lldbPluginInstructionARM
 lldbPluginInstructionMIPS
 lldbPluginInstructionMIPS64
-lldbPluginObjectContainerBSDArchive
-lldbPluginObjectContainerMachOArchive
 lldbPluginProcessGDBRemote
 ${EXTRA_PLUGINS}
 ${LLDB_SYSTEM_LIBS}
Index: source/API/SystemInitializerFull.cpp
===
--- source/API/SystemInitializerFull.cpp
+++ source/API/SystemInitializerFull.cpp
@@ -58,6 +58,8 @@
 #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
 #include 
"Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h"
 #include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h"
+#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"
+#include 
"Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h"
 #include "Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h"
 #include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
 #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
@@ -129,6 +131,9 @@
   ObjectFileMachO::Initialize();
   ObjectFilePECOFF::Initialize();

+  ObjectContainerBSDArchive::Initialize();
+  ObjectContainerUniversalMachO::Initialize();
+
   ScriptInterpreterNone::Initialize();

 #ifndef LLDB_DISABLE_PYTHON
@@ -360,6 +365,9 @@
   ObjectFileMachO::Terminate();
   ObjectFilePECOFF::Terminate();

+  ObjectContainerBSDArchive::Terminate();
+  ObjectContainerUniversalMachO::Terminate();
+
   // Now shutdown the common parts, in reverse order.
   SystemInitializerCommon::Terminate();
 }


Index: source/Initialization/SystemInitializerCommon.cpp
===
--- source/Initialization/SystemInitializerCommon.cpp
+++ source/Initialization/SystemInitializerCommon.cpp
@@ -101,16 +101,10 @@

   process_gdb_remote::ProcessGDBRemoteLog::Initialize();

-  // Initialize plug-ins
-  ObjectContainerBSDArchive::Initialize();
-
   EmulateInstructionARM::Initialize();
   EmulateInstructionMIPS::Initialize();
   EmulateInstructionMIPS64::Initialize();

-  // Apple/Darwin hosted plugins
-  ObjectContainerUniversalMachO::Initialize();
-
 #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
   ProcessPOSIXLog::Initialize();
 #endif
@@ -124,14 +118,11 @@
 void SystemInitializerCommon::Terminate() {
   static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
   Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
-  ObjectContainerBSDArchive::Terminate();

   EmulateInstructionARM::Terminate();
   EmulateInstructionMIPS::Terminate();
   EmulateInstructionMIPS64::Terminate();

-  ObjectContainerUniversalMachO::Terminate();
-
 #if defined(_MSC_VER)
   ProcessWindowsLog::Terminate();
 #endif
Index: source/Initialization/CMakeLists.txt
===
--- source/Initialization/CMakeLists.txt
+++ source/Initialization/CMakeLists.txt
@@ -17,8 +17,6 @@
 lldbPluginInstructionARM
 lldbPluginInstructionMIPS
 lldbPluginInstructionMIPS64
-lldbPluginObjectContainerBSDArchive
-lldbPluginObjectContainerMachOArchive
 lldbPluginProcessGDBRemote
 ${EXTRA_PLUGINS}
 ${LLDB_SYSTEM_LIBS}
Index: source/

[Lldb-commits] [lldb] r359797 - [lldb] [lit] Add write tests for AVX-512 registers (zmm, xmm15+, ymm15+)

2019-05-02 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu May  2 09:10:35 2019
New Revision: 359797

URL: http://llvm.org/viewvc/llvm-project?rev=359797&view=rev
Log:
[lldb] [lit] Add write tests for AVX-512 registers (zmm, xmm15+, ymm15+)

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

Added:
lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp
lldb/trunk/lit/Register/x86-64-xmm16-write.test
lldb/trunk/lit/Register/x86-64-ymm16-write.test
lldb/trunk/lit/Register/x86-64-zmm-write.test
lldb/trunk/lit/Register/x86-zmm-write.test

Added: lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp?rev=359797&view=auto
==
--- lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp (added)
+++ lldb/trunk/lit/Register/Inputs/x86-zmm-write.cpp Thu May  2 09:10:35 2019
@@ -0,0 +1,113 @@
+#include 
+#include 
+#include 
+
+union alignas(64) zmm_t {
+  uint64_t as_uint64[8];
+  uint8_t as_uint8[64];
+};
+
+int main() {
+  constexpr zmm_t zmm_fill = {
+.as_uint64 = { 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F,
+   0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F,
+   0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F,
+   0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F }
+  };
+
+  zmm_t zmm[32];
+
+  asm volatile(
+"vmovaps  %1, %%zmm0\n\t"
+"vmovaps  %1, %%zmm1\n\t"
+"vmovaps  %1, %%zmm2\n\t"
+"vmovaps  %1, %%zmm3\n\t"
+"vmovaps  %1, %%zmm4\n\t"
+"vmovaps  %1, %%zmm5\n\t"
+"vmovaps  %1, %%zmm6\n\t"
+"vmovaps  %1, %%zmm7\n\t"
+#if defined(__x86_64__) || defined(_M_X64)
+"vmovaps  %1, %%zmm8\n\t"
+"vmovaps  %1, %%zmm9\n\t"
+"vmovaps  %1, %%zmm10\n\t"
+"vmovaps  %1, %%zmm11\n\t"
+"vmovaps  %1, %%zmm12\n\t"
+"vmovaps  %1, %%zmm13\n\t"
+"vmovaps  %1, %%zmm14\n\t"
+"vmovaps  %1, %%zmm15\n\t"
+"vmovaps  %1, %%zmm16\n\t"
+"vmovaps  %1, %%zmm17\n\t"
+"vmovaps  %1, %%zmm18\n\t"
+"vmovaps  %1, %%zmm19\n\t"
+"vmovaps  %1, %%zmm20\n\t"
+"vmovaps  %1, %%zmm21\n\t"
+"vmovaps  %1, %%zmm22\n\t"
+"vmovaps  %1, %%zmm23\n\t"
+"vmovaps  %1, %%zmm24\n\t"
+"vmovaps  %1, %%zmm25\n\t"
+"vmovaps  %1, %%zmm26\n\t"
+"vmovaps  %1, %%zmm27\n\t"
+"vmovaps  %1, %%zmm28\n\t"
+"vmovaps  %1, %%zmm29\n\t"
+"vmovaps  %1, %%zmm30\n\t"
+"vmovaps  %1, %%zmm31\n\t"
+#endif
+"\n\t"
+"int3\n\t"
+"\n\t"
+"lea %0, %%rbx\n\t"
+"vmovaps %%zmm0,  0x000(%%rbx)\n\t"
+"vmovaps %%zmm1,  0x040(%%rbx)\n\t"
+"vmovaps %%zmm2,  0x080(%%rbx)\n\t"
+"vmovaps %%zmm3,  0x0C0(%%rbx)\n\t"
+"vmovaps %%zmm4,  0x100(%%rbx)\n\t"
+"vmovaps %%zmm5,  0x140(%%rbx)\n\t"
+"vmovaps %%zmm6,  0x180(%%rbx)\n\t"
+"vmovaps %%zmm7,  0x1C0(%%rbx)\n\t"
+#if defined(__x86_64__) || defined(_M_X64)
+"vmovaps %%zmm8,  0x200(%%rbx)\n\t"
+"vmovaps %%zmm9,  0x240(%%rbx)\n\t"
+"vmovaps %%zmm10, 0x280(%%rbx)\n\t"
+"vmovaps %%zmm11, 0x2C0(%%rbx)\n\t"
+"vmovaps %%zmm12, 0x300(%%rbx)\n\t"
+"vmovaps %%zmm13, 0x340(%%rbx)\n\t"
+"vmovaps %%zmm14, 0x380(%%rbx)\n\t"
+"vmovaps %%zmm15, 0x3C0(%%rbx)\n\t"
+"vmovaps %%zmm16, 0x400(%%rbx)\n\t"
+"vmovaps %%zmm17, 0x440(%%rbx)\n\t"
+"vmovaps %%zmm18, 0x480(%%rbx)\n\t"
+"vmovaps %%zmm19, 0x4C0(%%rbx)\n\t"
+"vmovaps %%zmm20, 0x500(%%rbx)\n\t"
+"vmovaps %%zmm21, 0x540(%%rbx)\n\t"
+"vmovaps %%zmm22, 0x580(%%rbx)\n\t"
+"vmovaps %%zmm23, 0x5C0(%%rbx)\n\t"
+"vmovaps %%zmm24, 0x600(%%rbx)\n\t"
+"vmovaps %%zmm25, 0x640(%%rbx)\n\t"
+"vmovaps %%zmm26, 0x680(%%rbx)\n\t"
+"vmovaps %%zmm27, 0x6C0(%%rbx)\n\t"
+"vmovaps %%zmm28, 0x700(%%rbx)\n\t"
+"vmovaps %%zmm29, 0x740(%%rbx)\n\t"
+"vmovaps %%zmm30, 0x780(%%rbx)\n\t"
+"vmovaps %%zmm31, 0x7C0(%%rbx)\n\t"
+#endif
+: "=m"(zmm)
+: "m"(zmm_fill)
+: "%zmm0", "%zmm1", "%zmm2", "%zmm3", "%zmm4", "%zmm5", "%zmm6", "%zmm7",
+#if defined(__x86_64__) || defined(_M_X64)
+  "%zmm8", "%zmm9", "%zmm10", "%zmm11", "%zmm12", "%zmm13", "%zmm14",
+  "%zmm15", "%zmm16", "%zmm17", "%zmm18", "%zmm19", "%zmm20", "%zmm21",
+  "%zmm22", "%zmm23", "%zmm24", "%zmm25", "%zmm26", "%zmm27", "%zmm28",
+  "%zmm29", "%zmm30", "%zmm31",
+#endif
+  "%rbx"
+  );
+
+  for (int i = 0; i < 32; ++i) {
+printf("zmm%d = { ", i);
+for (int j = 0; j < sizeof(zmm->as_uint8); ++j)
+  printf("0x%02x ", zmm[i].as_uint8[j]);
+printf("}\n");
+  }
+
+  return 0;
+}

Added: lldb/trunk/lit/Register/x86-64-xmm16-write.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Register/x86-64-xmm16-write.test?rev=359797&view=auto
==
--- lldb/trunk/lit/Register/x86-64-xmm16-write.test (added)
+++ lldb/trunk/lit/Register/x86-64-xmm16-write.test Thu May  2 09:10:35 2019
@@ -0,0 +1,48 @@
+# XFAIL: system-darwin
+# XFAIL: system-freebsd
+# XFAI

[Lldb-commits] [PATCH] D61439: [lldb] [lit] Add write tests for AVX-512 registers (zmm, xmm15+, ymm15+)

2019-05-02 Thread Michał Górny via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB359797: [lldb] [lit] Add write tests for AVX-512 
registers (zmm, xmm15+, ymm15+) (authored by mgorny, committed by ).
Herald added a subscriber: teemperor.
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D61439?vs=197772&id=197799#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61439

Files:
  lit/Register/Inputs/x86-zmm-write.cpp
  lit/Register/x86-64-xmm16-write.test
  lit/Register/x86-64-ymm16-write.test
  lit/Register/x86-64-zmm-write.test
  lit/Register/x86-zmm-write.test

Index: lit/Register/x86-zmm-write.test
===
--- lit/Register/x86-zmm-write.test
+++ lit/Register/x86-zmm-write.test
@@ -0,0 +1,31 @@
+# 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-write.cpp -o %t
+# RUN: %lldb -b -s %s %t | FileCheck %s
+process launch
+
+register write 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}"
+register write 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}"
+register write 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}"
+register write 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 0x7b 0x79 0x77 0x75 0x73 0xf0 0xff 0xfd 0xfb 0xf9 0xf7 0xf5 0xf3 0xf1 0xfe 0xfc 0xfa 0xf8 0xf6 0xf4 0xf2}"
+register write zmm4 "{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 0x81 0x8e 0x8c 0x8a 0x88 0x86 0x84 0x82 0x80 0x8f 0x8d 0x8b 0x89 0x87 0x85 0x83 0x00 0x0f 0x0d 0x0b 0x09 0x07 0x05 0x03 0x01 0x0e 0x0c 0x0a 0x08 0x06 0x04 0x02}"
+register write zmm5 "{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 0x91 0x9e 0x9c 0x9a 0x98 0x96 0x94 0x92 0x90 0x9f 0x9d 0x9b 0x99 0x97 0x95 0x93 0x10 0x1f 0x1d 0x1b 0x19 0x17 0x15 0x13 0x11 0x1e 0x1c 0x1a 0x18 0x16 0x14 0x12}"
+register write zmm6 "{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 0xa1 0xae 0xac 0xaa 0xa8 0xa6 0xa4 0xa2 0xa0 0xaf 0xad 0xab 0xa9 0xa7 0xa5 0xa3 0x20 0x2f 0x2d 0x2b 0x29 0x27 0x25 0x23 0x21 0x2e 0x2c 0x2a 0x28 0x26 0x24 0x22}"
+register write zmm7 "{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 0xb1 0xbe 0xbc 0xba 0xb8 0xb6 0xb4 0xb2 0xb0 0xbf 0xbd 0xbb 0xb9 0xb7 0xb5 0xb3 0x30 0x3f 0x3d 0x3b 0x39 0x37 0x35 0x33 0x31 0x3e 0x3c 0x3a 0x38 0x36 0x34 0x32}"
+
+process continue
+# CHECK: process continue
+
+# 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 }
+# CHE

[Lldb-commits] [PATCH] D61439: [lldb] [lit] Add write tests for AVX-512 registers (zmm, xmm15+, ymm15+)

2019-05-02 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

Thanks. Now you'll have proper motivation to add AVX-512 support to Linux ;-).


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61439



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


[Lldb-commits] [PATCH] D61361: PluginInstructionARM: avoid unnecessary link

2019-05-02 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd added a comment.

@labath - but that is the reality of this: there *are* two classes of 
dependencies.  I think that if we try to split up all the modules into linked 
libraries and header-only libraries, we are going to make an even bigger mess 
than what we have.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61361



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


[Lldb-commits] [PATCH] D61451: Hide runtime support values such as clang's __vla_expr from frame variable

2019-05-02 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl created this revision.
aprantl added a reviewer: jingham.
Herald added a project: LLDB.

by respecting the "artificial" attribute on variables. Function arguments that 
are artificial and useful to end-users are being whitelisted by the language 
runtime.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61451

Files:
  lldb/include/lldb/Target/CPPLanguageRuntime.h
  lldb/include/lldb/Target/ObjCLanguageRuntime.h
  lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
  lldb/source/Target/CPPLanguageRuntime.cpp
  lldb/source/Target/ObjCLanguageRuntime.cpp

Index: lldb/source/Target/ObjCLanguageRuntime.cpp
===
--- lldb/source/Target/ObjCLanguageRuntime.cpp
+++ lldb/source/Target/ObjCLanguageRuntime.cpp
@@ -16,6 +16,7 @@
 #include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/Type.h"
 #include "lldb/Symbol/TypeList.h"
+#include "lldb/Symbol/Variable.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/Log.h"
@@ -37,6 +38,25 @@
   m_isa_to_descriptor_stop_id(UINT32_MAX), m_complete_class_cache(),
   m_negative_complete_class_cache() {}
 
+bool ObjCLanguageRuntime::IsWhitelistedRuntimeValue(ConstString name) {
+  static ConstString g_self = ConstString("self");
+  static ConstString g_cmd = ConstString("_cmd");
+  return name == g_self || name == g_cmd;
+}
+
+bool ObjCLanguageRuntime::IsRuntimeSupportValue(ValueObject &valobj) {
+  // All runtime support values have to be marked as artificial by the
+  // compiler. But not all artificial variables should be hidden from
+  // the user.
+  if (!valobj.GetVariable())
+return false;
+  if (!valobj.GetVariable()->IsArtificial())
+return false;
+
+  // Whitelist "self" and "_cmd".
+  return !IsWhitelistedRuntimeValue(valobj.GetName());
+}
+
 bool ObjCLanguageRuntime::AddClass(ObjCISA isa,
const ClassDescriptorSP &descriptor_sp,
const char *class_name) {
Index: lldb/source/Target/CPPLanguageRuntime.cpp
===
--- lldb/source/Target/CPPLanguageRuntime.cpp
+++ lldb/source/Target/CPPLanguageRuntime.cpp
@@ -7,6 +7,7 @@
 //===--===//
 
 #include "lldb/Target/CPPLanguageRuntime.h"
+#include "lldb/Target/ObjCLanguageRuntime.h"
 
 #include 
 
@@ -15,6 +16,7 @@
 #include "llvm/ADT/StringRef.h"
 
 #include "lldb/Symbol/Block.h"
+#include "lldb/Symbol/Variable.h"
 #include "lldb/Symbol/VariableList.h"
 
 #include "lldb/Core/PluginManager.h"
@@ -31,12 +33,30 @@
 using namespace lldb;
 using namespace lldb_private;
 
+static ConstString g_this = ConstString("this");
+
 // Destructor
 CPPLanguageRuntime::~CPPLanguageRuntime() {}
 
 CPPLanguageRuntime::CPPLanguageRuntime(Process *process)
 : LanguageRuntime(process) {}
 
+bool CPPLanguageRuntime::IsRuntimeSupportValue(ValueObject &valobj) {
+  // All runtime support values have to be marked as artificial by the
+  // compiler. But not all artificial variables should be hidden from
+  // the user.
+  if (!valobj.GetVariable())
+return false;
+  if (!valobj.GetVariable()->IsArtificial())
+return false;
+
+  // Whitelist "this" and since there is no ObjC++ runtime, any ObjC names.
+  ConstString name = valobj.GetName();
+  if (name == g_this)
+return true;
+  return !ObjCLanguageRuntime::IsWhitelistedRuntimeValue(name);
+}
+
 bool CPPLanguageRuntime::GetObjectDescription(Stream &str,
   ValueObject &object) {
   // C++ has no generic way to do this.
@@ -317,7 +337,7 @@
   StackFrameSP frame = thread.GetStackFrameAtIndex(0);
 
   if (frame) {
-ValueObjectSP value_sp = frame->FindVariable(ConstString("this"));
+ValueObjectSP value_sp = frame->FindVariable(g_this);
 
 CPPLanguageRuntime::LibCppStdFunctionCallableInfo callable_info =
 FindLibCppStdFunctionCallableInfo(value_sp);
Index: lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
===
--- lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
+++ lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
@@ -14,12 +14,23 @@
 _, process, _, _ = lldbutil.run_to_source_breakpoint(
 self, "break here", lldb.SBFileSpec('main.c'))
 
+# Make sure no helper expressions show up in frame variable.
+var_opts = lldb.SBVariablesOptions()
+var_opts.SetIncludeArguments(False)
+var_opts.SetIncludeLocals(True)
+var_opts.SetInScopeOnly(True)
+var_opts.SetIncludeStatics(False)
+var_opts.SetIncludeRuntimeSupportValues(False)
+var_opts.SetUseDynamic(lldb.eDynamicCanRunTarget)
+all_locals = self.frame().GetVariables(var_opts)
+self.assertEqual(len(all_locals), 1)
+
 def test(a, arr

[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

Thank you!  LGTM, in general we avoid "large" refactoring changes to avoid 
polluting the blame list but the changes are relatively local and they are good 
changes that can catch real bugs in the future. I would like a second set of 
eyes though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 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.

LGTM module some minor code style issues (You removed some `virtual`s but 
didn't fix the indentation of the parameters on the next line, see the inline 
comments for examples).




Comment at: lldb/include/lldb/Utility/Baton.h:67
+  void GetDescription(Stream *s,
   lldb::DescriptionLevel level) const override {}
 

code style



Comment at: lldb/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp:306
+  bool DoExecute(lldb::SBDebugger debugger, char **command,
+ lldb::SBCommandReturnObject &result) override {
 

code style



Comment at: lldb/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp:351
+  bool DoExecute(lldb::SBDebugger debugger, char **command,
+ lldb::SBCommandReturnObject &result) override {
 

code style


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


[Lldb-commits] [PATCH] D61451: Hide runtime support values such as clang's __vla_expr from frame variable

2019-05-02 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

Could you add a comment (probably best in LanguageRuntime.h) saying what a 
RuntimeSupportValue is?

Also, so far as I can tell, this patch works because we use the CPP language 
runtime for C++ methods is an ObjC++ file, and the ObjCLanguageRuntime for ObjC 
methods in ditto.  That is surely the right thing to do, but it would be good 
to ensure that there's a test that asserts this behavior.  I'm sure there must 
be but didn't see on a quick scan.  Can you make sure there's such tests and if 
not add one?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61451



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


[Lldb-commits] [lldb] r359807 - [test] TestSharedPtr -> TestSharedPtrDbgInfoContent

2019-05-02 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu May  2 10:35:18 2019
New Revision: 359807

URL: http://llvm.org/viewvc/llvm-project?rev=359807&view=rev
Log:
[test] TestSharedPtr -> TestSharedPtrDbgInfoContent

Two tests cannot share the same name, because they will generate an
identical trace file. When that happens, this can lead to a race
condition where dotest fails when trying to move both files into the
trace directory, because the file has already been moved. Additionally,
the trace will have been overwritten by the test that finishes last.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/shared_ptr-dbg-info-content/TestSharedPtrDbgInfoContent.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/shared_ptr-dbg-info-content/TestSharedPtrDbgInfoContent.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/shared_ptr-dbg-info-content/TestSharedPtrDbgInfoContent.py?rev=359807&r1=359806&r2=359807&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/shared_ptr-dbg-info-content/TestSharedPtrDbgInfoContent.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/import-std-module/shared_ptr-dbg-info-content/TestSharedPtrDbgInfoContent.py
 Thu May  2 10:35:18 2019
@@ -6,7 +6,7 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
-class TestSharedPtr(TestBase):
+class TestSharedPtrDbgInfoContent(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 


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


[Lldb-commits] [PATCH] D61438: [ASTImporter] Use llvm::Expected and Error in the importer API

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

I think the best way to handle these errors in LLDB is to just log and then 
return some default value. That should make the current command print an error, 
which is better than terminating LLDB.

Otherwise the LLDB part of this patch LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61438



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


[Lldb-commits] [PATCH] D61360: Initialization: remove ObjectContainer from Common

2019-05-02 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added inline comments.
This revision is now accepted and ready to land.



Comment at: source/API/SystemInitializerFull.cpp:132-133
 
+  ObjectContainerBSDArchive::Initialize();
+  ObjectContainerUniversalMachO::Initialize();
+

compnerd wrote:
> labath wrote:
> > xiaobai wrote:
> > > You need to include the headers for these classes
> > And remove them from `SystemInitializerCommon.h`
> They never were in `SystemInitializerCommon.h`
they are in SystemInitializerCommon.cpp (sorry, I typed the file name by 
memory, didn't double check). Please remove the include from there, and this is 
good.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61360



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


[Lldb-commits] [lldb] r359810 - Initialization: remove ObjectContainer from Common

2019-05-02 Thread Saleem Abdulrasool via lldb-commits
Author: compnerd
Date: Thu May  2 11:11:44 2019
New Revision: 359810

URL: http://llvm.org/viewvc/llvm-project?rev=359810&view=rev
Log:
Initialization: remove ObjectContainer from Common

This restructures the initialization path to move the ObjectContainer
initialization into the *full* initialization path. This is not needed
for the lldb-server initialization path. This helps strip off ~1MiB
from the binary.

Modified:
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/Initialization/CMakeLists.txt
lldb/trunk/source/Initialization/SystemInitializerCommon.cpp

Modified: lldb/trunk/source/API/SystemInitializerFull.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SystemInitializerFull.cpp?rev=359810&r1=359809&r2=359810&view=diff
==
--- lldb/trunk/source/API/SystemInitializerFull.cpp (original)
+++ lldb/trunk/source/API/SystemInitializerFull.cpp Thu May  2 11:11:44 2019
@@ -58,6 +58,8 @@
 #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
 #include 
"Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h"
 #include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h"
+#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"
+#include 
"Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h"
 #include "Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h"
 #include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
 #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
@@ -129,6 +131,9 @@ llvm::Error SystemInitializerFull::Initi
   ObjectFileMachO::Initialize();
   ObjectFilePECOFF::Initialize();
 
+  ObjectContainerBSDArchive::Initialize();
+  ObjectContainerUniversalMachO::Initialize();
+
   ScriptInterpreterNone::Initialize();
 
 #ifndef LLDB_DISABLE_PYTHON
@@ -360,6 +365,9 @@ void SystemInitializerFull::Terminate()
   ObjectFileMachO::Terminate();
   ObjectFilePECOFF::Terminate();
 
+  ObjectContainerBSDArchive::Terminate();
+  ObjectContainerUniversalMachO::Terminate();
+
   // Now shutdown the common parts, in reverse order.
   SystemInitializerCommon::Terminate();
 }

Modified: lldb/trunk/source/Initialization/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/CMakeLists.txt?rev=359810&r1=359809&r2=359810&view=diff
==
--- lldb/trunk/source/Initialization/CMakeLists.txt (original)
+++ lldb/trunk/source/Initialization/CMakeLists.txt Thu May  2 11:11:44 2019
@@ -17,8 +17,6 @@ add_lldb_library(lldbInitialization
 lldbPluginInstructionARM
 lldbPluginInstructionMIPS
 lldbPluginInstructionMIPS64
-lldbPluginObjectContainerBSDArchive
-lldbPluginObjectContainerMachOArchive
 lldbPluginProcessGDBRemote
 ${EXTRA_PLUGINS}
 ${LLDB_SYSTEM_LIBS}

Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=359810&r1=359809&r2=359810&view=diff
==
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original)
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Thu May  2 
11:11:44 2019
@@ -11,8 +11,6 @@
 #include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
 #include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
 #include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
-#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"
-#include 
"Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h"
 #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/Host.h"
@@ -101,16 +99,10 @@ llvm::Error SystemInitializerCommon::Ini
 
   process_gdb_remote::ProcessGDBRemoteLog::Initialize();
 
-  // Initialize plug-ins
-  ObjectContainerBSDArchive::Initialize();
-
   EmulateInstructionARM::Initialize();
   EmulateInstructionMIPS::Initialize();
   EmulateInstructionMIPS64::Initialize();
 
-  // Apple/Darwin hosted plugins
-  ObjectContainerUniversalMachO::Initialize();
-
 #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
   ProcessPOSIXLog::Initialize();
 #endif
@@ -124,14 +116,11 @@ llvm::Error SystemInitializerCommon::Ini
 void SystemInitializerCommon::Terminate() {
   static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
   Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
-  ObjectContainerBSDArchive::Terminate();
 
   EmulateInstructionARM::Terminate();
   EmulateInstructionMIPS::Terminate();
   EmulateInstructionMIPS64::Terminate();
 
-  ObjectContainerUniversalMachO::Terminate();
-
 #if defined(_MSC_VER)
   ProcessWindowsLog::Terminate();
 #endif


___
lldb-commits mailing list
lldb-commits@lists.llvm.org

[Lldb-commits] [PATCH] D61360: Initialization: remove ObjectContainer from Common

2019-05-02 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd closed this revision.
compnerd added a comment.

SVN r359810


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61360



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


[Lldb-commits] [lldb] r359811 - gdb-remote: reduce some inclusion of Target/Process.h

2019-05-02 Thread Saleem Abdulrasool via lldb-commits
Author: compnerd
Date: Thu May  2 11:15:03 2019
New Revision: 359811

URL: http://llvm.org/viewvc/llvm-project?rev=359811&view=rev
Log:
gdb-remote: reduce some inclusion of Target/Process.h

Reduce the inclusion of Target/Process.h to help isolate why Process is being
preserved during the build of `lldb-server`.

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp?rev=359811&r1=359810&r2=359811&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp Thu 
May  2 11:15:03 2019
@@ -10,7 +10,6 @@
 
 #include "llvm/ADT/StringExtras.h"
 
-#include "lldb/Target/Process.h"
 #include "lldb/Target/UnixSignals.h"
 #include "lldb/Utility/LLDBAssert.h"
 

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=359811&r1=359810&r2=359811&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Thu 
May  2 11:15:03 2019
@@ -19,13 +19,14 @@
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/Pipe.h"
+#include "lldb/Host/ProcessLaunchInfo.h"
 #include "lldb/Host/Socket.h"
 #include "lldb/Host/StringConvert.h"
 #include "lldb/Host/ThreadLauncher.h"
 #include "lldb/Host/common/TCPSocket.h"
 #include "lldb/Host/posix/ConnectionFileDescriptorPosix.h"
 #include "lldb/Target/Platform.h"
-#include "lldb/Target/Process.h"
+#include "lldb/Utility/Event.h"
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/RegularExpression.h"

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=359811&r1=359810&r2=359811&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h 
Thu May  2 11:15:03 2019
@@ -17,12 +17,12 @@
 #include 
 #include 
 
-#include "lldb/Target/Process.h"
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/StreamGDBRemote.h"
 #include "lldb/Utility/StructuredData.h"
 
 #include "llvm/ADT/Optional.h"
+#include "llvm/Support/VersionTuple.h"
 
 namespace lldb_private {
 namespace process_gdb_remote {

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp?rev=359811&r1=359810&r2=359811&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
 Thu May  2 11:15:03 2019
@@ -28,12 +28,12 @@
 #include "lldb/Interpreter/OptionArgParser.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/Platform.h"
-#include "lldb/Target/Process.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/JSON.h"
 #include "lldb/Utility/Log.h"
 #include "lldb/Utility/StreamGDBRemote.h"
 #include "lldb/Utility/StreamString.h"
+#include "lldb/Utility/StructuredData.h"
 #include "llvm/ADT/Triple.h"
 
 #include "ProcessGDBRemoteLog.h"

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h?rev=359811&r1=359810&r2=359811&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
 (origina

[Lldb-commits] [PATCH] D61394: Remove unnecessary check in SymbolFileDWARF::ParseImportedModules

2019-05-02 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.

True.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61394



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


[Lldb-commits] [lldb] r359813 - Remove unnecessary check in SymbolFileDWARF::ParseImportedModules

2019-05-02 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Thu May  2 11:26:58 2019
New Revision: 359813

URL: http://llvm.org/viewvc/llvm-project?rev=359813&view=rev
Log:
Remove unnecessary check in SymbolFileDWARF::ParseImportedModules

Summary:
This check seems unnecessary as we already assert the same condition above and 
also access `sc.comp_unit`
before this check.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: jdoerfert, lldb-commits

Tags: #lldb

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=359813&r1=359812&r2=359813&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Thu May  2 
11:26:58 2019
@@ -909,9 +909,6 @@ bool SymbolFileDWARF::ParseImportedModul
 return false;
   UpdateExternalModuleListIfNeeded();
 
-  if (!sc.comp_unit)
-return false;
-
   const DWARFDIE die = dwarf_cu->DIE();
   if (!die)
 return false;


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


[Lldb-commits] [lldb] r359812 - Disable TestArgumentPassingRestrictions for clang < 7

2019-05-02 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu May  2 11:26:46 2019
New Revision: 359812

URL: http://llvm.org/viewvc/llvm-project?rev=359812&view=rev
Log:
Disable TestArgumentPassingRestrictions for clang < 7

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/

Modified:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py?rev=359812&r1=359811&r2=359812&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/argument_passing_restrictions/TestArgumentPassingRestrictions.py
 Thu May  2 11:26:46 2019
@@ -9,16 +9,17 @@ and to also make sure that the ASTImport
 setting when importing the CXXRecordDecl via setArgPassingRestrictions.
 """
 
-
 import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+
 class TestArgumentPassingRestrictions(TestBase):
 
   mydir = TestBase.compute_mydir(__file__)
 
+  @skipIf(compiler="clang", compiler_version=['<', '7.0'])
   def test_argument_passing_restrictions(self):
 self.build()
 


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


[Lldb-commits] [PATCH] D61394: Remove unnecessary check in SymbolFileDWARF::ParseImportedModules

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359813: Remove unnecessary check in 
SymbolFileDWARF::ParseImportedModules (authored by teemperor, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61394?vs=197607&id=197833#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61394

Files:
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp


Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -909,9 +909,6 @@
 return false;
   UpdateExternalModuleListIfNeeded();
 
-  if (!sc.comp_unit)
-return false;
-
   const DWARFDIE die = dwarf_cu->DIE();
   if (!die)
 return false;


Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -909,9 +909,6 @@
 return false;
   UpdateExternalModuleListIfNeeded();
 
-  if (!sc.comp_unit)
-return false;
-
   const DWARFDIE die = dwarf_cu->DIE();
   if (!die)
 return false;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r359816 - gdb-remote: fix the build on Windows

2019-05-02 Thread Saleem Abdulrasool via lldb-commits
Author: compnerd
Date: Thu May  2 12:09:58 2019
New Revision: 359816

URL: http://llvm.org/viewvc/llvm-project?rev=359816&view=rev
Log:
gdb-remote: fix the build on Windows

Windows does not have a definition for `mode_t`.  Include the appropriate
header.

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=359816&r1=359815&r2=359816&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h 
Thu May  2 12:09:58 2019
@@ -20,6 +20,9 @@
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/StreamGDBRemote.h"
 #include "lldb/Utility/StructuredData.h"
+#if defined(_WIN32)
+#include "lldb/Host/windows/PosixApi.h"
+#endif
 
 #include "llvm/ADT/Optional.h"
 #include "llvm/Support/VersionTuple.h"


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


[Lldb-commits] [PATCH] D61451: Hide runtime support values such as clang's __vla_expr from frame variable

2019-05-02 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

In D61451#1488186 , @jingham wrote:

> Could you add a comment (probably best in LanguageRuntime.h) saying what a 
> RuntimeSupportValue is?


Done.

> Also, so far as I can tell, this patch works because we use the CPP language 
> runtime for C++ methods is an ObjC++ file, and the ObjCLanguageRuntime for 
> ObjC methods in ditto.  That is surely the right thing to do, but it would be 
> good to ensure that there's a test that asserts this behavior.  I'm sure 
> there must be but didn't see on a quick scan.  Can you make sure there's such 
> tests and if not add one?

I'm not sure what exactly you want me to test there. Can you elaborate?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61451



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


[Lldb-commits] [lldb] r359817 - Initialization: correct macro usage

2019-05-02 Thread Saleem Abdulrasool via lldb-commits
Author: compnerd
Date: Thu May  2 12:25:18 2019
New Revision: 359817

URL: http://llvm.org/viewvc/llvm-project?rev=359817&view=rev
Log:
Initialization: correct macro usage

`_MSC_VER` indiciates that you are building with MSVC, not that you are building
for Windows.  Use `_WIN32` (which identifies Win32 and Win64).

Modified:
lldb/trunk/source/Initialization/SystemInitializerCommon.cpp

Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=359817&r1=359816&r2=359817&view=diff
==
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original)
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Thu May  2 
12:25:18 2019
@@ -24,7 +24,7 @@
 #include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
 #endif
 
-#if defined(_MSC_VER)
+#if defined(_WIN32)
 #include "Plugins/Process/Windows/Common/ProcessWindowsLog.h"
 #include "lldb/Host/windows/windows.h"
 #endif
@@ -41,7 +41,7 @@ SystemInitializerCommon::SystemInitializ
 SystemInitializerCommon::~SystemInitializerCommon() {}
 
 llvm::Error SystemInitializerCommon::Initialize() {
-#if defined(_MSC_VER)
+#if defined(_WIN32)
   const char *disable_crash_dialog_var = getenv("LLDB_DISABLE_CRASH_DIALOG");
   if (disable_crash_dialog_var &&
   llvm::StringRef(disable_crash_dialog_var).equals_lower("true")) {
@@ -106,7 +106,7 @@ llvm::Error SystemInitializerCommon::Ini
 #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
   ProcessPOSIXLog::Initialize();
 #endif
-#if defined(_MSC_VER)
+#if defined(_WIN32)
   ProcessWindowsLog::Initialize();
 #endif
 
@@ -121,7 +121,7 @@ void SystemInitializerCommon::Terminate(
   EmulateInstructionMIPS::Terminate();
   EmulateInstructionMIPS64::Terminate();
 
-#if defined(_MSC_VER)
+#if defined(_WIN32)
   ProcessWindowsLog::Terminate();
 #endif
 


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


[Lldb-commits] [PATCH] D61451: Hide runtime support values such as clang's __vla_expr from frame variable

2019-05-02 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 197843.

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

https://reviews.llvm.org/D61451

Files:
  lldb/include/lldb/Target/CPPLanguageRuntime.h
  lldb/include/lldb/Target/LanguageRuntime.h
  lldb/include/lldb/Target/ObjCLanguageRuntime.h
  lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
  lldb/source/Target/CPPLanguageRuntime.cpp
  lldb/source/Target/ObjCLanguageRuntime.cpp

Index: lldb/source/Target/ObjCLanguageRuntime.cpp
===
--- lldb/source/Target/ObjCLanguageRuntime.cpp
+++ lldb/source/Target/ObjCLanguageRuntime.cpp
@@ -16,6 +16,7 @@
 #include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/Type.h"
 #include "lldb/Symbol/TypeList.h"
+#include "lldb/Symbol/Variable.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/Log.h"
@@ -37,6 +38,25 @@
   m_isa_to_descriptor_stop_id(UINT32_MAX), m_complete_class_cache(),
   m_negative_complete_class_cache() {}
 
+bool ObjCLanguageRuntime::IsWhitelistedRuntimeValue(ConstString name) {
+  static ConstString g_self = ConstString("self");
+  static ConstString g_cmd = ConstString("_cmd");
+  return name == g_self || name == g_cmd;
+}
+
+bool ObjCLanguageRuntime::IsRuntimeSupportValue(ValueObject &valobj) {
+  // All runtime support values have to be marked as artificial by the
+  // compiler. But not all artificial variables should be hidden from
+  // the user.
+  if (!valobj.GetVariable())
+return false;
+  if (!valobj.GetVariable()->IsArtificial())
+return false;
+
+  // Whitelist "self" and "_cmd".
+  return !IsWhitelistedRuntimeValue(valobj.GetName());
+}
+
 bool ObjCLanguageRuntime::AddClass(ObjCISA isa,
const ClassDescriptorSP &descriptor_sp,
const char *class_name) {
Index: lldb/source/Target/CPPLanguageRuntime.cpp
===
--- lldb/source/Target/CPPLanguageRuntime.cpp
+++ lldb/source/Target/CPPLanguageRuntime.cpp
@@ -7,6 +7,7 @@
 //===--===//
 
 #include "lldb/Target/CPPLanguageRuntime.h"
+#include "lldb/Target/ObjCLanguageRuntime.h"
 
 #include 
 
@@ -15,6 +16,7 @@
 #include "llvm/ADT/StringRef.h"
 
 #include "lldb/Symbol/Block.h"
+#include "lldb/Symbol/Variable.h"
 #include "lldb/Symbol/VariableList.h"
 
 #include "lldb/Core/PluginManager.h"
@@ -31,12 +33,30 @@
 using namespace lldb;
 using namespace lldb_private;
 
+static ConstString g_this = ConstString("this");
+
 // Destructor
 CPPLanguageRuntime::~CPPLanguageRuntime() {}
 
 CPPLanguageRuntime::CPPLanguageRuntime(Process *process)
 : LanguageRuntime(process) {}
 
+bool CPPLanguageRuntime::IsRuntimeSupportValue(ValueObject &valobj) {
+  // All runtime support values have to be marked as artificial by the
+  // compiler. But not all artificial variables should be hidden from
+  // the user.
+  if (!valobj.GetVariable())
+return false;
+  if (!valobj.GetVariable()->IsArtificial())
+return false;
+
+  // Whitelist "this" and since there is no ObjC++ runtime, any ObjC names.
+  ConstString name = valobj.GetName();
+  if (name == g_this)
+return true;
+  return !ObjCLanguageRuntime::IsWhitelistedRuntimeValue(name);
+}
+
 bool CPPLanguageRuntime::GetObjectDescription(Stream &str,
   ValueObject &object) {
   // C++ has no generic way to do this.
@@ -317,7 +337,7 @@
   StackFrameSP frame = thread.GetStackFrameAtIndex(0);
 
   if (frame) {
-ValueObjectSP value_sp = frame->FindVariable(ConstString("this"));
+ValueObjectSP value_sp = frame->FindVariable(g_this);
 
 CPPLanguageRuntime::LibCppStdFunctionCallableInfo callable_info =
 FindLibCppStdFunctionCallableInfo(value_sp);
Index: lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
===
--- lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
+++ lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
@@ -14,12 +14,23 @@
 _, process, _, _ = lldbutil.run_to_source_breakpoint(
 self, "break here", lldb.SBFileSpec('main.c'))
 
+# Make sure no helper expressions show up in frame variable.
+var_opts = lldb.SBVariablesOptions()
+var_opts.SetIncludeArguments(False)
+var_opts.SetIncludeLocals(True)
+var_opts.SetInScopeOnly(True)
+var_opts.SetIncludeStatics(False)
+var_opts.SetIncludeRuntimeSupportValues(False)
+var_opts.SetUseDynamic(lldb.eDynamicCanRunTarget)
+all_locals = self.frame().GetVariables(var_opts)
+self.assertEqual(len(all_locals), 1)
+
 def test(a, array):
 for i in range(a):
 self.expect("fr v vla[%d]"%i, substrs=["int", "%d"%(a-i)])
 self.expect("expr

[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk added a comment.

In D61440#1488174 , @teemperor wrote:

> LGTM module some minor code style issues (You removed some `virtual`s but 
> didn't fix the indentation of the parameters on the next line, see the inline 
> comments for examples).


@teemperor I would have loved to use clang-format for this but apparently the 
LLDB code is still manually formatted. It would be a bliss to just use the LLVM 
clang-format style and never ever talk about "style" again.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Konrad Kleine via Phabricator via lldb-commits
kkleine updated this revision to Diff 197846.
kkleine added a comment.

- Fix https://reviews.llvm.org/D61440#inline-545102
- Fix https://reviews.llvm.org/D61440#inline-545098
- Fix https://reviews.llvm.org/D61440#inline-545099


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440

Files:
  lldb/include/lldb/Core/Architecture.h
  lldb/include/lldb/Core/StreamBuffer.h
  lldb/include/lldb/Core/ValueObjectVariable.h
  lldb/include/lldb/Target/DynamicLoader.h
  lldb/include/lldb/Target/StackFrameRecognizer.h
  lldb/include/lldb/Target/StructuredDataPlugin.h
  lldb/include/lldb/Utility/Baton.h
  lldb/include/lldb/Utility/DataBufferLLVM.h
  lldb/include/lldb/Utility/StringExtractorGDBRemote.h
  lldb/source/API/SBBreakpointOptionCommon.h
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/ObjC/NSDictionary.h
  lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/PostfixExpression.cpp
  lldb/source/Target/StructuredDataPlugin.cpp
  lldb/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp
  lldb/unittests/Editline/EditlineTest.cpp
  lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
  lldb/unittests/Symbol/TestClangASTContext.cpp
  lldb/unittests/Target/ProcessInstanceInfoTest.cpp

Index: lldb/unittests/Target/ProcessInstanceInfoTest.cpp
===
--- lldb/unittests/Target/ProcessInstanceInfoTest.cpp
+++ lldb/unittests/Target/ProcessInstanceInfoTest.cpp
@@ -16,13 +16,13 @@
 /// for odd ones.
 class DummyUserIDResolver : public UserIDResolver {
 protected:
-  llvm::Optional DoGetUserName(id_t uid) {
+  llvm::Optional DoGetUserName(id_t uid) override {
 if (uid % 2)
   return ("user" + llvm::Twine(uid)).str();
 return llvm::None;
   }
 
-  llvm::Optional DoGetGroupName(id_t gid) {
+  llvm::Optional DoGetGroupName(id_t gid) override {
 if (gid % 2)
   return ("group" + llvm::Twine(gid)).str();
 return llvm::None;
Index: lldb/unittests/Symbol/TestClangASTContext.cpp
===
--- lldb/unittests/Symbol/TestClangASTContext.cpp
+++ lldb/unittests/Symbol/TestClangASTContext.cpp
@@ -34,12 +34,12 @@
 FileSystem::Terminate();
   }
 
-  virtual void SetUp() override {
+  void SetUp() override {
 std::string triple = HostInfo::GetTargetTriple();
 m_ast.reset(new ClangASTContext(triple.c_str()));
   }
 
-  virtual void TearDown() override { m_ast.reset(); }
+  void TearDown() override { m_ast.reset(); }
 
 protected:
   std::unique_ptr m_ast;
Index: lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
===
--- lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
+++ lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
@@ -29,11 +29,11 @@
   unsigned stop_reply_called = 0;
   std::vector structured_data_packets;
 
-  void HandleAsyncStdout(llvm::StringRef out) { output += out; }
-  void HandleAsyncMisc(llvm::StringRef data) { misc_data += data; }
-  void HandleStopReply() { ++stop_reply_called; }
+  void HandleAsyncStdout(llvm::StringRef out) override { output += out; }
+  void HandleAsyncMisc(llvm::StringRef data) override { misc_data += data; }
+  void HandleStopReply() override { ++stop_reply_called; }
 
-  void HandleAsyncStructuredDataPacket(llvm::StringRef data) {
+  void HandleAsyncStructuredDataPacket(llvm::StringRef data) override {
 structured_data_packets.push_back(data);
   }
 };
Index: lldb/unittests/Editline/EditlineTest.cpp
===
--- lldb/unittests/Editline/EditlineTest.cpp
+++ lldb/unittests/Editline/EditlineTest.cpp
@@ -250,7 +250,7 @@
 setenv("TERM", "vt100", 1);
   }
 
-  void SetUp() {
+  void SetUp() override {
 

[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk added a comment.

@teemperor I would have loved to use clang-format for this but apparently the 
LLDB code is still manually formatted. It would be a bliss to just use the LLVM 
clang-format style and never ever talk about "style" again.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

In D61440#1488424 , @kwk wrote:

> In D61440#1488174 , @teemperor wrote:
>
> > LGTM module some minor code style issues (You removed some `virtual`s but 
> > didn't fix the indentation of the parameters on the next line, see the 
> > inline comments for examples).
>
>
> @teemperor I would have loved to use clang-format for this but apparently the 
> LLDB code is still manually formatted. It would be a bliss to just use the 
> LLVM clang-format style and never ever talk about "style" again.


I assume you mean running clang-format manually on each file? If yes, then 
check out git-clang-format 

 which works just fine in these situations.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.

FYI, I still think there are some style issues there (e.g. the 
AppleObjCRuntimeV2.cpp change makes it longer than 80 chars) but I can just 
clang-format this before committing.

Otherwise, unless someone objects to this change I'll merge this tomorrow. 
Thanks for the patch @kkleine!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk added a comment.

In D61440#1488450 , @teemperor wrote:

> FYI, I still think there are some style issues there (e.g. the 
> AppleObjCRuntimeV2.cpp change makes it longer than 80 chars) but I can just 
> clang-format this before committing.
>
> Otherwise, unless someone objects to this change I'll merge this tomorrow. 
> Thanks for the patch @kkleine!


@teemperor I've formatted the AppleObjCRuntimeV2.cpp using `git clang-format` 
and it worked. Thank you for pointing me this handy tool. But as you probably 
can see now in commit 0b4b24065a12678c773f8c3f0fc722e50405fc85, not all the 
changes were related to the `override` keyword.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Konrad Kleine via Phabricator via lldb-commits
kkleine updated this revision to Diff 197848.
kkleine added a comment.

- Address formatting issues brought up in 
https://reviews.llvm.org/D61440#1488450


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440

Files:
  lldb/include/lldb/Core/Architecture.h
  lldb/include/lldb/Core/StreamBuffer.h
  lldb/include/lldb/Core/ValueObjectVariable.h
  lldb/include/lldb/Target/DynamicLoader.h
  lldb/include/lldb/Target/StackFrameRecognizer.h
  lldb/include/lldb/Target/StructuredDataPlugin.h
  lldb/include/lldb/Utility/Baton.h
  lldb/include/lldb/Utility/DataBufferLLVM.h
  lldb/include/lldb/Utility/StringExtractorGDBRemote.h
  lldb/source/API/SBBreakpointOptionCommon.h
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/ObjC/NSDictionary.h
  lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/PostfixExpression.cpp
  lldb/source/Target/StructuredDataPlugin.cpp
  lldb/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp
  lldb/unittests/Editline/EditlineTest.cpp
  lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
  lldb/unittests/Symbol/TestClangASTContext.cpp
  lldb/unittests/Target/ProcessInstanceInfoTest.cpp

Index: lldb/unittests/Target/ProcessInstanceInfoTest.cpp
===
--- lldb/unittests/Target/ProcessInstanceInfoTest.cpp
+++ lldb/unittests/Target/ProcessInstanceInfoTest.cpp
@@ -16,13 +16,13 @@
 /// for odd ones.
 class DummyUserIDResolver : public UserIDResolver {
 protected:
-  llvm::Optional DoGetUserName(id_t uid) {
+  llvm::Optional DoGetUserName(id_t uid) override {
 if (uid % 2)
   return ("user" + llvm::Twine(uid)).str();
 return llvm::None;
   }
 
-  llvm::Optional DoGetGroupName(id_t gid) {
+  llvm::Optional DoGetGroupName(id_t gid) override {
 if (gid % 2)
   return ("group" + llvm::Twine(gid)).str();
 return llvm::None;
Index: lldb/unittests/Symbol/TestClangASTContext.cpp
===
--- lldb/unittests/Symbol/TestClangASTContext.cpp
+++ lldb/unittests/Symbol/TestClangASTContext.cpp
@@ -34,12 +34,12 @@
 FileSystem::Terminate();
   }
 
-  virtual void SetUp() override {
+  void SetUp() override {
 std::string triple = HostInfo::GetTargetTriple();
 m_ast.reset(new ClangASTContext(triple.c_str()));
   }
 
-  virtual void TearDown() override { m_ast.reset(); }
+  void TearDown() override { m_ast.reset(); }
 
 protected:
   std::unique_ptr m_ast;
Index: lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
===
--- lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
+++ lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
@@ -29,11 +29,11 @@
   unsigned stop_reply_called = 0;
   std::vector structured_data_packets;
 
-  void HandleAsyncStdout(llvm::StringRef out) { output += out; }
-  void HandleAsyncMisc(llvm::StringRef data) { misc_data += data; }
-  void HandleStopReply() { ++stop_reply_called; }
+  void HandleAsyncStdout(llvm::StringRef out) override { output += out; }
+  void HandleAsyncMisc(llvm::StringRef data) override { misc_data += data; }
+  void HandleStopReply() override { ++stop_reply_called; }
 
-  void HandleAsyncStructuredDataPacket(llvm::StringRef data) {
+  void HandleAsyncStructuredDataPacket(llvm::StringRef data) override {
 structured_data_packets.push_back(data);
   }
 };
Index: lldb/unittests/Editline/EditlineTest.cpp
===
--- lldb/unittests/Editline/EditlineTest.cpp
+++ lldb/unittests/Editline/EditlineTest.cpp
@@ -250,7 +250,7 @@
 setenv("TERM", "vt100", 1);
   }
 
-  void SetUp() {
+  void SetUp() override {
 FileSystem::Initialize();
 
 // Validate the editline adapter.
@@ -26

[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

Not sure how you invoke git clang-format, but I assume you specified the wrong 
commit range...

I personally use some custom command that executes this `git rebase -i 
--autosquash -x 'git clang-format master && git commit -a --amend --no-edit' 
master` which essentially clang-formats all your git commits (i.e. the ones 
that are in the local branch but not in master). So if you have the original 
version of this diff as its own git commit on a separate branch then this 
command should do all the work for you.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


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

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

This makes sense to me.  Pinning the extension to the call site prevented all 
the cases I could think of where this might go wrong.

I had a bunch of small comments inline.




Comment at: lldb/include/lldb/Symbol/Block.h:191-196
+  /// @param[in] file
+  /// the file to match at the call site.
+  ///
+  /// @param[in] line
+  /// the line to match at the call site.
+  ///

The docs don't match the function signature.



Comment at: lldb/include/lldb/Symbol/Declaration.h:112-113
+  ///
+  /// Compares the specification from \a rhs. If the file specifications are
+  /// equal, then continue to compare the line.
+  ///

The argument is not called "rhs" anymore.

I'm not at all sure of the value of returning > < here.  If you get > or < you 
have no way of knowing if that's because the files don't match, in which case 
so far as I can see the ordering is not useful, or if they are in the same file 
but with greater or lesser line number.  To actually use the < or > you would 
have to go back and compare the files again anyway, so for all practical 
purposes you're really just returning a bool...  And certainly that's how you 
are using it.

You were probably just copying the behavior from the function above, but that 
one doesn't make much sense either...



Comment at: lldb/include/lldb/Symbol/LineEntry.h:135
+  /// @param[in] include_inlined_functions
+  /// Whether to include inlined functions at the same line are not.
+  ///

are -> or



Comment at: lldb/include/lldb/Symbol/LineEntry.h:140
+  AddressRange GetSameLineContiguousAddressRange(
+  bool include_inlined_functions = false) const;
 

We try to avoid default arguments unless there's a good reason, and in this 
case it looks like you pass the argument explicitly in almost all the uses, so 
I would make this a regular argument.



Comment at: lldb/source/Core/AddressRange.cpp:131
+  lhs_end_addr != rhs_base_addr)
+// The ranges don't intercept at all on the right side of this range.
+return false;

intercept -> intersect



Comment at: lldb/source/Symbol/LineEntry.cpp:199
+  auto symbol_context_scope = lldb::eSymbolContextLineEntry;
+  Declaration find_call_site(original_file, line);
+  if (include_inlined_functions)

start_call_site would be a clearer name for this.  find_call_site doesn't say 
what it is.



Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:60-87
+#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 ": did not return errc::success.\n"  
\
+<< "error number: " << ASSERT_NO_ERROR_ec.value() << "\n"  
\
+<< "error message: " << ASSERT_NO_ERROR_ec.message() << "\n";  
\

These defines don't seem specific to this test, is there a more general place 
you could put them?



Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:96-122
+llvm::Expected LineEntryTest::GetModule() {
+  if (m_module_sp)
+return m_module_sp;
+
+  std::string yaml = GetInputFilePath("inlined-functions.yaml");
+  llvm::SmallString<128> obj;
+

It looks like this bit of business has been copied around in a bunch of other 
tests in the unittest framework.  Could we put this in a common place (like 
make a LLDBUnitTest : testing::Test class that does this?



Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:193-194
+int result = sum2(a, b) + sum2(c, d);
+return result;
+}
+

Can you make the return here not trivial (like return result + 5)}  The way you 
have written the line return line doesn't contribute any code so you would step 
all the way out to the caller, but it would be good to test that we didn't just 
extend the range to our caller, i.e. that next on "int result ="... stops at 
the "return result" which it should do except in your example line 13 
contributes no code. 



Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:279
+*/
\ No newline at end of file


Add newline.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61292



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


Re: [Lldb-commits] [PATCH] D61451: Hide runtime support values such as clang's __vla_expr from frame variable

2019-05-02 Thread Jim Ingham via lldb-commits
If we did this wrong, then either stopping in a C++ method in a .mm file would 
suppress "this" (if we mistakenly used the ObjC Runtime's 
"RuntimeSupportValue") or stopping in an ObjC method in a .mm file would 
suppress "self and _cmd" (if we used the C++ Runtime's RuntimeSupportValue).  
So we need a test that has a .mm file and stops in both a C++ method and an 
ObjC method and demonstrates that "frame var" shows "this" or "self & _cmd" 
respectively.

Jim


> On May 2, 2019, at 12:22 PM, Adrian Prantl via Phabricator 
>  wrote:
> 
> aprantl added a comment.
> 
> In D61451#1488186 , @jingham wrote:
> 
>> Could you add a comment (probably best in LanguageRuntime.h) saying what a 
>> RuntimeSupportValue is?
> 
> 
> Done.
> 
>> Also, so far as I can tell, this patch works because we use the CPP language 
>> runtime for C++ methods is an ObjC++ file, and the ObjCLanguageRuntime for 
>> ObjC methods in ditto.  That is surely the right thing to do, but it would 
>> be good to ensure that there's a test that asserts this behavior.  I'm sure 
>> there must be but didn't see on a quick scan.  Can you make sure there's 
>> such tests and if not add one?
> 
> I'm not sure what exactly you want me to test there. Can you elaborate?
> 
> 
> Repository:
>  rG LLVM Github Monorepo
> 
> CHANGES SINCE LAST ACTION
>  https://reviews.llvm.org/D61451/new/
> 
> https://reviews.llvm.org/D61451
> 
> 
> 

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


[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk added a comment.

In D61440#1488470 , @teemperor wrote:

> Not sure how you invoke git clang-format, but I assume you specified the 
> wrong commit range...


That is correct in this case I've used clang format directly on the whole file. 
Sorry if that was a noob mistake.

> I personally use some custom command that executes this `git rebase -i 
> --autosquash -x 'git clang-format master && git commit -a --amend --no-edit' 
> master` which essentially clang-formats all your git commits (i.e. the ones 
> that are in the local branch but not in master). So if you have the original 
> version of this diff as its own git commit on a separate branch then this 
> command should do all the work for you.

Thank you for that tip. Unfortunately I've started not on a branch and when I 
create it now things become complicated. I'm not famiiar enough with the `arc` 
tool and will do some reading before just calling `arc diff` next time. Because 
when I do that now after rebasing, `arc` tries to upload a commit that is no 
longer in my history.

How do you handle rebasing or squashing here? When I run your special command 
from above, it will rewrite the git history which to me is a no go when I send 
my code to review. If all these reviews are going to happen on Github anytime, 
then you would embrace having an append-only history.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


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

2019-05-02 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: lldb/include/lldb/Symbol/Declaration.h:113
+  /// Compares the specification from \a rhs. If the file specifications are
+  /// equal, then continue to compare the line.
+  ///

How about just returning a bool:
```
bool FileAndLineEqual(const Declaration &rhs);
```



Comment at: lldb/include/lldb/Symbol/LineEntry.h:140
+  AddressRange GetSameLineContiguousAddressRange(
+  bool include_inlined_functions = false) const;
 

jingham wrote:
> We try to avoid default arguments unless there's a good reason, and in this 
> case it looks like you pass the argument explicitly in almost all the uses, 
> so I would make this a regular argument.
We tried that but the patch becomes a lot bigger if so. Happy to add all the 
other changes back, or we can make a new fucntion?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61292



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


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

2019-05-02 Thread Jim Ingham via Phabricator via lldb-commits
jingham added inline comments.



Comment at: lldb/include/lldb/Symbol/Declaration.h:113
+  /// Compares the specification from \a rhs. If the file specifications are
+  /// equal, then continue to compare the line.
+  ///

clayborg wrote:
> How about just returning a bool:
> ```
> bool FileAndLineEqual(const Declaration &rhs);
> ```
That would be great.  The whole "Compare" thing for Declarations doesn't make 
any sense to me.  If you were trying to put Declarations in a container that 
required an ordering???  But that's not what this is for.



Comment at: lldb/include/lldb/Symbol/LineEntry.h:140
+  AddressRange GetSameLineContiguousAddressRange(
+  bool include_inlined_functions = false) const;
 

clayborg wrote:
> jingham wrote:
> > We try to avoid default arguments unless there's a good reason, and in this 
> > case it looks like you pass the argument explicitly in almost all the uses, 
> > so I would make this a regular argument.
> We tried that but the patch becomes a lot bigger if so. Happy to add all the 
> other changes back, or we can make a new fucntion?
Besides the declaration and definition, I only see 5 uses of 
GetSameLineContiguousAddressRange in lldb, and you've touched three of them.  
Am I missing something?  If not, might as well change the other two.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61292



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


[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

You don't have to use arc, you can also just update the code via the "Update 
diff" button and upload a patch file. So it doesn't really matter how you 
organize your local git branch as long as you can produce a patch file from the 
changes. Phabricator takes care of making diffs between the patches you upload, 
so there is always a change history here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


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

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



Comment at: lldb/include/lldb/Symbol/Declaration.h:112-113
+  ///
+  /// Compares the specification from \a rhs. If the file specifications are
+  /// equal, then continue to compare the line.
+  ///

jingham wrote:
> The argument is not called "rhs" anymore.
> 
> I'm not at all sure of the value of returning > < here.  If you get > or < 
> you have no way of knowing if that's because the files don't match, in which 
> case so far as I can see the ordering is not useful, or if they are in the 
> same file but with greater or lesser line number.  To actually use the < or > 
> you would have to go back and compare the files again anyway, so for all 
> practical purposes you're really just returning a bool...  And certainly 
> that's how you are using it.
> 
> You were probably just copying the behavior from the function above, but that 
> one doesn't make much sense either...
Oh, originally it was rhs but then I renamed and forgot to update the 
documentation.
Just to give some context: the reason I used the same interface was to provide 
a consistent API in the methods that do comparisons, but I see what you mean, 
I'll change it then.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61292



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


[Lldb-commits] [PATCH] D61451: Hide runtime support values such as clang's __vla_expr from frame variable

2019-05-02 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 197871.
aprantl added a comment.

Thanks you! There was indeed a bug that prevented us from recognizing the 
correct runtime for the C++ `this` pointer.


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

https://reviews.llvm.org/D61451

Files:
  lldb/include/lldb/Target/CPPLanguageRuntime.h
  lldb/include/lldb/Target/LanguageRuntime.h
  lldb/include/lldb/Target/ObjCLanguageRuntime.h
  lldb/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
  lldb/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/Makefile
  
lldb/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py
  lldb/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/main.mm
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Target/CPPLanguageRuntime.cpp
  lldb/source/Target/ObjCLanguageRuntime.cpp

Index: lldb/source/Target/ObjCLanguageRuntime.cpp
===
--- lldb/source/Target/ObjCLanguageRuntime.cpp
+++ lldb/source/Target/ObjCLanguageRuntime.cpp
@@ -16,6 +16,7 @@
 #include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/Type.h"
 #include "lldb/Symbol/TypeList.h"
+#include "lldb/Symbol/Variable.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/Log.h"
@@ -37,6 +38,25 @@
   m_isa_to_descriptor_stop_id(UINT32_MAX), m_complete_class_cache(),
   m_negative_complete_class_cache() {}
 
+bool ObjCLanguageRuntime::IsWhitelistedRuntimeValue(ConstString name) {
+  static ConstString g_self = ConstString("self");
+  static ConstString g_cmd = ConstString("_cmd");
+  return name == g_self || name == g_cmd;
+}
+
+bool ObjCLanguageRuntime::IsRuntimeSupportValue(ValueObject &valobj) {
+  // All runtime support values have to be marked as artificial by the
+  // compiler. But not all artificial variables should be hidden from
+  // the user.
+  if (!valobj.GetVariable())
+return false;
+  if (!valobj.GetVariable()->IsArtificial())
+return false;
+
+  // Whitelist "self" and "_cmd".
+  return !IsWhitelistedRuntimeValue(valobj.GetName());
+}
+
 bool ObjCLanguageRuntime::AddClass(ObjCISA isa,
const ClassDescriptorSP &descriptor_sp,
const char *class_name) {
Index: lldb/source/Target/CPPLanguageRuntime.cpp
===
--- lldb/source/Target/CPPLanguageRuntime.cpp
+++ lldb/source/Target/CPPLanguageRuntime.cpp
@@ -7,6 +7,7 @@
 //===--===//
 
 #include "lldb/Target/CPPLanguageRuntime.h"
+#include "lldb/Target/ObjCLanguageRuntime.h"
 
 #include 
 
@@ -15,6 +16,7 @@
 #include "llvm/ADT/StringRef.h"
 
 #include "lldb/Symbol/Block.h"
+#include "lldb/Symbol/Variable.h"
 #include "lldb/Symbol/VariableList.h"
 
 #include "lldb/Core/PluginManager.h"
@@ -31,12 +33,30 @@
 using namespace lldb;
 using namespace lldb_private;
 
+static ConstString g_this = ConstString("this");
+
 // Destructor
 CPPLanguageRuntime::~CPPLanguageRuntime() {}
 
 CPPLanguageRuntime::CPPLanguageRuntime(Process *process)
 : LanguageRuntime(process) {}
 
+bool CPPLanguageRuntime::IsRuntimeSupportValue(ValueObject &valobj) {
+  // All runtime support values have to be marked as artificial by the
+  // compiler. But not all artificial variables should be hidden from
+  // the user.
+  if (!valobj.GetVariable())
+return false;
+  if (!valobj.GetVariable()->IsArtificial())
+return false;
+
+  // Whitelist "this" and since there is no ObjC++ runtime, any ObjC names.
+  ConstString name = valobj.GetName();
+  if (name == g_this)
+return false;
+  return !ObjCLanguageRuntime::IsWhitelistedRuntimeValue(name);
+}
+
 bool CPPLanguageRuntime::GetObjectDescription(Stream &str,
   ValueObject &object) {
   // C++ has no generic way to do this.
@@ -317,7 +337,7 @@
   StackFrameSP frame = thread.GetStackFrameAtIndex(0);
 
   if (frame) {
-ValueObjectSP value_sp = frame->FindVariable(ConstString("this"));
+ValueObjectSP value_sp = frame->FindVariable(g_this);
 
 CPPLanguageRuntime::LibCppStdFunctionCallableInfo callable_info =
 FindLibCppStdFunctionCallableInfo(value_sp);
Index: lldb/source/Symbol/ClangASTContext.cpp
===
--- lldb/source/Symbol/ClangASTContext.cpp
+++ lldb/source/Symbol/ClangASTContext.cpp
@@ -4257,9 +4257,11 @@
   if (qual_type->isAnyPointerType()) {
 if (qual_type->isObjCObjectPointerType())
   return lldb::eLanguageTypeObjC;
+if (qual_type->getPointeeCXXRecordDecl())
+  return lldb::eLanguageTypeC_plus_plus;
 
 clang::QualType pointee_type(qual_type->getPointeeType());
-if (pointee_type->getPointeeCXXRecordDecl() != nullptr)
+if (pointee_type->getPointeeCXXRecordDecl())
   return lldb::

[Lldb-commits] [PATCH] D61469: [Alias] Add 're' alias for register

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

This patch makes `re` an alias for `register`. Currently `re` gives you 
the choice between `register` and `reproducer`. Given that you use `register` a 
lot more often, `register` should win for the common substring.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61469

Files:
  
lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
  lldb/source/Interpreter/CommandInterpreter.cpp


Index: lldb/source/Interpreter/CommandInterpreter.cpp
===
--- lldb/source/Interpreter/CommandInterpreter.cpp
+++ lldb/source/Interpreter/CommandInterpreter.cpp
@@ -429,6 +429,11 @@
 AddAlias("var", cmd_obj_sp);
 AddAlias("vo", cmd_obj_sp, "--object-description");
   }
+
+  cmd_obj_sp = GetCommandSPExact("register", false);
+  if (cmd_obj_sp) {
+AddAlias("re", cmd_obj_sp);
+  }
 }
 
 void CommandInterpreter::Clear() {
Index: 
lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
===
--- 
lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
+++ 
lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
@@ -187,7 +187,8 @@
 elif not value.IsValid():
 return  # If register doesn't exist, skip this test
 
-self.runCmd("register write " + register + " \'" + new_value + "\'")
+# Also test the 're' alias.
+self.runCmd("re write " + register + " \'" + new_value + "\'")
 self.expect(
 "register read " +
 register,


Index: lldb/source/Interpreter/CommandInterpreter.cpp
===
--- lldb/source/Interpreter/CommandInterpreter.cpp
+++ lldb/source/Interpreter/CommandInterpreter.cpp
@@ -429,6 +429,11 @@
 AddAlias("var", cmd_obj_sp);
 AddAlias("vo", cmd_obj_sp, "--object-description");
   }
+
+  cmd_obj_sp = GetCommandSPExact("register", false);
+  if (cmd_obj_sp) {
+AddAlias("re", cmd_obj_sp);
+  }
 }
 
 void CommandInterpreter::Clear() {
Index: lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
@@ -187,7 +187,8 @@
 elif not value.IsValid():
 return  # If register doesn't exist, skip this test
 
-self.runCmd("register write " + register + " \'" + new_value + "\'")
+# Also test the 're' alias.
+self.runCmd("re write " + register + " \'" + new_value + "\'")
 self.expect(
 "register read " +
 register,
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r359832 - Initialization: move InstructionEmulation to full initialization

2019-05-02 Thread Saleem Abdulrasool via lldb-commits
Author: compnerd
Date: Thu May  2 14:49:29 2019
New Revision: 359832

URL: http://llvm.org/viewvc/llvm-project?rev=359832&view=rev
Log:
Initialization: move InstructionEmulation to full initialization

The debug server does not need to use the instruction emulation.  This helps
reduce the size of the final lldb-server binary by another ~100K (~1% savings).

Modified:
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/Initialization/CMakeLists.txt
lldb/trunk/source/Initialization/SystemInitializerCommon.cpp

Modified: lldb/trunk/source/API/SystemInitializerFull.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SystemInitializerFull.cpp?rev=359832&r1=359831&r2=359832&view=diff
==
--- lldb/trunk/source/API/SystemInitializerFull.cpp (original)
+++ lldb/trunk/source/API/SystemInitializerFull.cpp Thu May  2 14:49:29 2019
@@ -43,7 +43,10 @@
 #include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
 #include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
 #include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"
+#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
 #include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
+#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
+#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
 #include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h"
 #include "Plugins/InstrumentationRuntime/ASan/ASanRuntime.h"
 #include 
"Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
@@ -202,8 +205,13 @@ llvm::Error SystemInitializerFull::Initi
   SymbolFileSymtab::Initialize();
   UnwindAssemblyInstEmulation::Initialize();
   UnwindAssembly_x86::Initialize();
+
+  EmulateInstructionARM::Initialize();
   EmulateInstructionARM64::Initialize();
+  EmulateInstructionMIPS::Initialize();
+  EmulateInstructionMIPS64::Initialize();
   EmulateInstructionPPC64::Initialize();
+
   SymbolFileDWARFDebugMap::Initialize();
   ItaniumABILanguageRuntime::Initialize();
   AppleObjCRuntimeV2::Initialize();
@@ -304,8 +312,13 @@ void SystemInitializerFull::Terminate()
   SymbolFileSymtab::Terminate();
   UnwindAssembly_x86::Terminate();
   UnwindAssemblyInstEmulation::Terminate();
+
+  EmulateInstructionARM::Terminate();
   EmulateInstructionARM64::Terminate();
+  EmulateInstructionMIPS::Terminate();
+  EmulateInstructionMIPS64::Terminate();
   EmulateInstructionPPC64::Terminate();
+
   SymbolFileDWARFDebugMap::Terminate();
   ItaniumABILanguageRuntime::Terminate();
   AppleObjCRuntimeV2::Terminate();

Modified: lldb/trunk/source/Initialization/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/CMakeLists.txt?rev=359832&r1=359831&r2=359832&view=diff
==
--- lldb/trunk/source/Initialization/CMakeLists.txt (original)
+++ lldb/trunk/source/Initialization/CMakeLists.txt Thu May  2 14:49:29 2019
@@ -14,9 +14,6 @@ add_lldb_library(lldbInitialization
   LINK_LIBS
 lldbCore
 lldbHost
-lldbPluginInstructionARM
-lldbPluginInstructionMIPS
-lldbPluginInstructionMIPS64
 lldbPluginProcessGDBRemote
 ${EXTRA_PLUGINS}
 ${LLDB_SYSTEM_LIBS}

Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=359832&r1=359831&r2=359832&view=diff
==
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original)
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Thu May  2 
14:49:29 2019
@@ -8,9 +8,6 @@
 
 #include "lldb/Initialization/SystemInitializerCommon.h"
 
-#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
-#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
-#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
 #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/Host.h"
@@ -99,10 +96,6 @@ llvm::Error SystemInitializerCommon::Ini
 
   process_gdb_remote::ProcessGDBRemoteLog::Initialize();
 
-  EmulateInstructionARM::Initialize();
-  EmulateInstructionMIPS::Initialize();
-  EmulateInstructionMIPS64::Initialize();
-
 #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
   ProcessPOSIXLog::Initialize();
 #endif
@@ -117,10 +110,6 @@ void SystemInitializerCommon::Terminate(
   static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
   Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
 
-  EmulateInstructionARM::Terminate();
-  EmulateInstructionMIPS::Terminate();
-  EmulateInstructionMIPS64::Terminate();
-
 #if defined(_WIN32)
   ProcessWindowsLog::Terminate();
 #endif


___
lldb-commits mailing list
lldb-comm

[Lldb-commits] [PATCH] D61451: Hide runtime support values such as clang's __vla_expr from frame variable

2019-05-02 Thread Jim Ingham via Phabricator via lldb-commits
jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

LGTM


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

https://reviews.llvm.org/D61451



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


[Lldb-commits] [PATCH] D59960: Fix for ambiguous lookup in expressions between local variable and namespace

2019-05-02 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

@teemperor @jingham @clayborg I believe now that 
https://reviews.llvm.org/D46551 is landed the performance concerns should be 
addressed.


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

https://reviews.llvm.org/D59960



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


[Lldb-commits] [PATCH] D60957: Read ObjC class names in one large read, instead of reading them individually

2019-05-02 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda abandoned this revision.
jasonmolenda added a comment.

I had some more revisions on this patch, but I finally understood that I was 
solving the wrong problem with this patchset.  lldb should not fetch class 
names up front when scanning the objective c class tables, they should only be 
read lazily as we evaluate an expression.  The fact that we're reading names 
during the table scan is the problem that needs to be fixed.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60957



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


[Lldb-commits] [lldb] r359841 - Hide runtime support values such as clang's __vla_expr from frame variable

2019-05-02 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu May  2 16:07:23 2019
New Revision: 359841

URL: http://llvm.org/viewvc/llvm-project?rev=359841&view=rev
Log:
Hide runtime support values such as clang's __vla_expr from frame variable

by respecting the "artificial" attribute on variables. Function
arguments that are artificial and useful to end-users are being
whitelisted by the language runtime.



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

Added:
lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/

lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/Makefile

lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/main.mm
Modified:
lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h
lldb/trunk/include/lldb/Target/LanguageRuntime.h
lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Target/CPPLanguageRuntime.cpp
lldb/trunk/source/Target/ObjCLanguageRuntime.cpp

Modified: lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h?rev=359841&r1=359840&r2=359841&view=diff
==
--- lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h Thu May  2 16:07:23 2019
@@ -63,6 +63,7 @@ public:
   lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread,
   bool stop_others);
 
+  bool IsRuntimeSupportValue(ValueObject &valobj) override;
 protected:
   // Classes that inherit from CPPLanguageRuntime can see and modify these
   CPPLanguageRuntime(Process *process);

Modified: lldb/trunk/include/lldb/Target/LanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/LanguageRuntime.h?rev=359841&r1=359840&r2=359841&view=diff
==
--- lldb/trunk/include/lldb/Target/LanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/LanguageRuntime.h Thu May  2 16:07:23 2019
@@ -143,6 +143,8 @@ public:
 return false;
   }
 
+  /// Identify whether a value is a language implementation detaul
+  /// that should be hidden from the user interface by default.
   virtual bool IsRuntimeSupportValue(ValueObject &valobj) { return false; }
 
   virtual void ModulesDidLoad(const ModuleList &module_list) {}

Modified: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h?rev=359841&r1=359840&r2=359841&view=diff
==
--- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h Thu May  2 16:07:23 
2019
@@ -292,6 +292,11 @@ public:
   bool GetTypeBitSize(const CompilerType &compiler_type,
   uint64_t &size) override;
 
+  /// Check whether the name is "self" or "_cmd" and should show up in
+  /// "frame variable".
+  static bool IsWhitelistedRuntimeValue(ConstString name);
+  bool IsRuntimeSupportValue(ValueObject &valobj) override;
+
 protected:
   // Classes that inherit from ObjCLanguageRuntime can see and modify these
   ObjCLanguageRuntime(Process *process);

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py?rev=359841&r1=359840&r2=359841&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Thu May  2 
16:07:23 2019
@@ -14,12 +14,23 @@ class TestVLA(TestBase):
 _, process, _, _ = lldbutil.run_to_source_breakpoint(
 self, "break here", lldb.SBFileSpec('main.c'))
 
+# Make sure no helper expressions show up in frame variable.
+var_opts = lldb.SBVariablesOptions()
+var_opts.SetIncludeArguments(False)
+var_opts.SetIncludeLocals(True)
+var_opts.SetInScopeOnly(True)
+var_opts.SetIncludeStatics(False)
+var_opts.SetIncludeRuntimeSupportValues(False)
+var_opts.SetUseDynamic(lldb.eDynamicCanRunTarget)
+all_locals = self.frame().GetVariables(var_opts)
+self.assertEqual(len(all_locals), 1)
+
 def test(a, array):
 for i in range(a):
 self.expect("fr v vla[%d]"%i, substrs=["int", "%d"%(a-i)])
 self.expect("expr vla[%d]"%i, substrs=["int", "%d"

[Lldb-commits] [PATCH] D61451: Hide runtime support values such as clang's __vla_expr from frame variable

2019-05-02 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359841: Hide runtime support values such as clang's 
__vla_expr from frame variable (authored by adrian, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61451?vs=197871&id=197887#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61451

Files:
  lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h
  lldb/trunk/include/lldb/Target/LanguageRuntime.h
  lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
  lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
  
lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py
  
lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/main.mm
  lldb/trunk/source/Symbol/ClangASTContext.cpp
  lldb/trunk/source/Target/CPPLanguageRuntime.cpp
  lldb/trunk/source/Target/ObjCLanguageRuntime.cpp

Index: lldb/trunk/include/lldb/Target/LanguageRuntime.h
===
--- lldb/trunk/include/lldb/Target/LanguageRuntime.h
+++ lldb/trunk/include/lldb/Target/LanguageRuntime.h
@@ -143,6 +143,8 @@
 return false;
   }
 
+  /// Identify whether a value is a language implementation detaul
+  /// that should be hidden from the user interface by default.
   virtual bool IsRuntimeSupportValue(ValueObject &valobj) { return false; }
 
   virtual void ModulesDidLoad(const ModuleList &module_list) {}
Index: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
===
--- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
+++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
@@ -292,6 +292,11 @@
   bool GetTypeBitSize(const CompilerType &compiler_type,
   uint64_t &size) override;
 
+  /// Check whether the name is "self" or "_cmd" and should show up in
+  /// "frame variable".
+  static bool IsWhitelistedRuntimeValue(ConstString name);
+  bool IsRuntimeSupportValue(ValueObject &valobj) override;
+
 protected:
   // Classes that inherit from ObjCLanguageRuntime can see and modify these
   ObjCLanguageRuntime(Process *process);
Index: lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h
===
--- lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h
+++ lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h
@@ -63,6 +63,7 @@
   lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread,
   bool stop_others);
 
+  bool IsRuntimeSupportValue(ValueObject &valobj) override;
 protected:
   // Classes that inherit from CPPLanguageRuntime can see and modify these
   CPPLanguageRuntime(Process *process);
Index: lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py
@@ -0,0 +1,47 @@
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+import lldbsuite.test.lldbutil as lldbutil
+import os
+import unittest2
+
+
+class TestObjCXXHideRuntimeSupportValues(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def setUp(self):
+TestBase.setUp(self)
+
+def test_hide_runtime_support_values(self):
+self.build()
+_, process, _, _ = lldbutil.run_to_source_breakpoint(
+self, 'break here', lldb.SBFileSpec('main.mm'))
+
+var_opts = lldb.SBVariablesOptions()
+var_opts.SetIncludeArguments(True)
+var_opts.SetIncludeLocals(True)
+var_opts.SetInScopeOnly(True)
+var_opts.SetIncludeStatics(False)
+var_opts.SetIncludeRuntimeSupportValues(False)
+var_opts.SetUseDynamic(lldb.eDynamicCanRunTarget)
+values = self.frame().GetVariables(var_opts)
+
+def shows_var(name):
+for value in values:
+if value.name == name:
+return True
+return False
+# ObjC method.
+values = self.frame().GetVariables(var_opts)
+self.assertFalse(shows_var("this"))
+self.assertTrue(shows_var("self"))
+self.assertTrue(shows_var("_cmd"))
+self.assertTrue(shows_var("c"))
+
+process.Continue()
+# C++ method.
+values = self.frame().GetVariables(var_opts)
+self.assertTrue(shows_var("this"))
+self.assertFalse(shows_var("self"))
+self.assertFalse(shows_var("_cmd"))
Index

[Lldb-commits] [lldb] r359843 - Upstreaming an apple local patch by Frederic Riss.

2019-05-02 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu May  2 16:14:26 2019
New Revision: 359843

URL: http://llvm.org/viewvc/llvm-project?rev=359843&view=rev
Log:
Upstreaming an apple local patch by Frederic Riss.

lldb has an expression that runs in the inferior process to collect
the isa values and hash of the class names for classes in the
system's shared cache.  In recent OSes, swift classes are in this
table and the function the jitted expression calls returns demangled
names.  We need to compute the hashes based on the mangled names.
So for these names, return a hash value of 0 which indicates that
lldb should read the class name directly out of the runtime tables
and compute the hash itself.

When this patch is absent, the lldb+swift testsuite has many failures
on a recent macOS system; there isn't a direct non-swift way to
test for this being correct.




Modified:

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

Modified: 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=359843&r1=359842&r2=359843&view=diff
==
--- 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 Thu May  2 16:14:26 2019
@@ -289,7 +289,18 @@ __lldb_apple_objc_v2_get_shared_cache_cl
 const char *s = name;
 uint32_t h = 5381;
 for (unsigned char c = *s; c; c = *++s)
+{
+// class_getName demangles swift names and the hash 
must
+// be calculated on the mangled name.  hash==0 means 
lldb
+// will fetch the mangled name and compute the hash in
+// ParseClassInfoArray.
+if (c == '.')
+{
+h = 0;
+break;
+}
 h = ((h << 5) + h) + c;
+}
 class_infos[idx].hash = h;
 }
 else
@@ -321,7 +332,18 @@ __lldb_apple_objc_v2_get_shared_cache_cl
 const char *s = name;
 uint32_t h = 5381;
 for (unsigned char c = *s; c; c = *++s)
+{
+// class_getName demangles swift names and the hash 
must
+// be calculated on the mangled name.  hash==0 means 
lldb
+// will fetch the mangled name and compute the hash in
+// ParseClassInfoArray.
+if (c == '.')
+{
+h = 0;
+break;
+} 
 h = ((h << 5) + h) + c;
+}
 class_infos[idx].hash = h;
 }
 ++idx;
@@ -1488,7 +1510,16 @@ uint32_t AppleObjCRuntimeV2::ParseClassI
   // Read the 32 bit hash for the class name
   const uint32_t name_hash = data.GetU32(&offset);
   ClassDescriptorSP descriptor_sp(new ClassDescriptorV2(*this, isa, NULL));
-  AddClass(isa, descriptor_sp, name_hash);
+
+  // The code in g_get_shared_cache_class_info_body sets the value of the 
hash
+  // to 0 to signal a demangled symbol. We use class_getName() in that 
code to
+  // find the class name, but this returns a demangled name for Swift 
symbols.
+  // For those symbols, recompute the hash here by reading their name from 
the
+  // runtime.
+  if (name_hash)
+AddClass(isa, descriptor_sp, name_hash);
+  else
+AddClass(isa, descriptor_sp, 
descriptor_sp->GetClassName().AsCString(nullptr));
   num_parsed++;
   if (should_log)
 log->Printf("AppleObjCRuntimeV2 added isa=0x%" PRIx64


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


[Lldb-commits] [lldb] r359846 - Fix tests on non-Darwin platforms.

2019-05-02 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Thu May  2 16:49:55 2019
New Revision: 359846

URL: http://llvm.org/viewvc/llvm-project?rev=359846&view=rev
Log:
Fix tests on non-Darwin platforms.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py

lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py?rev=359846&r1=359845&r2=359846&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Thu May  2 
16:49:55 2019
@@ -23,7 +23,8 @@ class TestVLA(TestBase):
 var_opts.SetIncludeRuntimeSupportValues(False)
 var_opts.SetUseDynamic(lldb.eDynamicCanRunTarget)
 all_locals = self.frame().GetVariables(var_opts)
-self.assertEqual(len(all_locals), 1)
+for value in all_locals:
+self.assertFalse("vla_expr" in value.name)
 
 def test(a, array):
 for i in range(a):

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py?rev=359846&r1=359845&r2=359846&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py
 Thu May  2 16:49:55 2019
@@ -13,6 +13,10 @@ class TestObjCXXHideRuntimeSupportValues
 def setUp(self):
 TestBase.setUp(self)
 
+@skipIfFreeBSD
+@skipIfLinux
+@skipIfWindows
+@skipIfNetBSD
 def test_hide_runtime_support_values(self):
 self.build()
 _, process, _, _ = lldbutil.run_to_source_breakpoint(


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


[Lldb-commits] [lldb] r359847 - RegisterContextLLDB::GetFullUnwindPlanForFrame has four verbose

2019-05-02 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu May  2 16:49:56 2019
New Revision: 359847

URL: http://llvm.org/viewvc/llvm-project?rev=359847&view=rev
Log:
RegisterContextLLDB::GetFullUnwindPlanForFrame has four verbose
logging messages that are written the same, making it difficult to
know for certain which code path was taken based on a logfile.  Add
some words to make each unique.

Right now the ordering for finding a FullUnwindPlan (ignoring
fallback unwind plan logic) is

1. If this is a _sigtramp like function, try eh_frame which is
   hand written on darwin systems to account for finding the
   saved register context correctly.

2. Ask the DynamicLoader if eh_frame should be preferred for
   this frame.  Some binaries on the system may have hand-written
   eh_frame and the DynamicLoader is the source for this.  (primarily
   this is for hand-written assembly in the objc runtime, and we tell
   lldb to trust that for functions in libobjc.dylib.)

3. if 0th frame, use GetUnwindPlanAtNonCallSite plan.

4. GetUnwindPlanAtCallSite {for 0th or any other}

5. GetUnwindPlanAtNonCallSite {now for non-0th frames, only if not from a 
compiler? hm.}

6. GetUnwindPlanArchitectureDefaultAtFunctionEntry if we're on the first 
instruction

7. Architectural default unwind plan ABI::CreateDefaultUnwindPlan


I'm moving #6 -- DefaultAtFunctionEntry -- up to between #3 and #4,
where we're already doing things specific to the zeroth frame.  If
we're on the zeroth frame and the GetUnwindPlanAtNonCallSite plan
has failed for some reason, and we're on the first instruction, we
should definitely use DefaultAtFunctionEntry instead of any other
unwind plan.  If we're trying to step out of some rando function
on the system that we couldn't assembly instruction inspect, this
is sufficient for us to step out of it.



Modified:
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=359847&r1=359846&r2=359847&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Thu May  
2 16:49:56 2019
@@ -883,10 +883,27 @@ UnwindPlanSP RegisterContextLLDB::GetFul
   m_fallback_unwind_plan_sp = arch_default_unwind_plan_sp;
 }
   }
-  UnwindLogMsgVerbose("frame uses %s for full UnwindPlan",
+  UnwindLogMsgVerbose("frame uses %s for full UnwindPlan because this "
+  "is the non-call site unwind plan and this is a "
+  "zeroth frame",
   unwind_plan_sp->GetSourceName().GetCString());
   return unwind_plan_sp;
 }
+
+// If we're on the first instruction of a function, and we have an
+// architectural default UnwindPlan for the initial instruction of a
+// function, use that.
+if (m_current_offset == 0) {
+  unwind_plan_sp =
+  func_unwinders_sp->GetUnwindPlanArchitectureDefaultAtFunctionEntry(
+  m_thread);
+  if (unwind_plan_sp) {
+UnwindLogMsgVerbose("frame uses %s for full UnwindPlan because we are 
at "
+"the first instruction of a function",
+unwind_plan_sp->GetSourceName().GetCString());
+return unwind_plan_sp;
+  }
+}
   }
 
   // Typically this is unwind info from an eh_frame section intended for
@@ -897,7 +914,8 @@ UnwindPlanSP RegisterContextLLDB::GetFul
   }
   int valid_offset = -1;
   if (IsUnwindPlanValidForCurrentPC(unwind_plan_sp, valid_offset)) {
-UnwindLogMsgVerbose("frame uses %s for full UnwindPlan",
+UnwindLogMsgVerbose("frame uses %s for full UnwindPlan because this "
+"is the call-site unwind plan",
 unwind_plan_sp->GetSourceName().GetCString());
 return unwind_plan_sp;
   }
@@ -934,30 +952,18 @@ UnwindPlanSP RegisterContextLLDB::GetFul
   }
 
   if (IsUnwindPlanValidForCurrentPC(unwind_plan_sp, valid_offset)) {
-UnwindLogMsgVerbose("frame uses %s for full UnwindPlan",
+UnwindLogMsgVerbose("frame uses %s for full UnwindPlan because we "
+"failed to find a call-site unwind plan that would 
work",
 unwind_plan_sp->GetSourceName().GetCString());
 return unwind_plan_sp;
   }
 
-  // If we're on the first instruction of a function, and we have an
-  // architectural default UnwindPlan for the initial instruction of a
-  // function, use that.
-  if (m_current_offset_backed_up_one == 0) {
-unwind_plan_sp =
-func_unwinders_sp->GetUnwindPlanArchitectureDefaultAtFunctionEntry(
-m_thread);
-if (unwind_plan_sp) {
-  UnwindLogMsgVerbose("frame uses %s for full UnwindPlan",
- 

[Lldb-commits] [PATCH] D61473: ExpressionParser: only force link MCJIT when needed

2019-05-02 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd created this revision.
compnerd added reviewers: labath, clayborg, emaste, davide, xiaobai.
Herald added subscribers: teemperor, abidh, krytarowski, mgorny.
Herald added a project: LLDB.

This was added to support FreeBSD.  The inclusion of this header increases the
size of `lldb-server` due to MCJIT being forcefully preserved.  Conditionalise
the inclusion to shared builds of LLVM which will allow for MCJIT to be stripped
if unnecessary when performing static linking of tools.  This shaves off ~28% of
the binary size for lldb-server when linked with gold using
`-ffunction-sections` and `-fdata-sections`.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61473

Files:
  source/Plugins/ExpressionParser/Clang/CMakeLists.txt
  source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp


Index: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===
--- source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -41,10 +41,12 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/TargetSelect.h"

+#if defined(LLDB_FORCE_LINK_MCJIT)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wglobal-constructors"
 #include "llvm/ExecutionEngine/MCJIT.h"
 #pragma clang diagnostic pop
+#endif

 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
Index: source/Plugins/ExpressionParser/Clang/CMakeLists.txt
===
--- source/Plugins/ExpressionParser/Clang/CMakeLists.txt
+++ source/Plugins/ExpressionParser/Clang/CMakeLists.txt
@@ -50,3 +50,7 @@
 MCJIT
 Support
   )
+if(LLVM_LINK_LLVM_DYLIB OR LLVM_BUILD_SHARED_LIBS)
+  target_compile_definitions(lldbPluginExpressionParserClang PRIVATE
+LLDB_FORCE_LINK_MCJIT)
+endif()


Index: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===
--- source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -41,10 +41,12 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/TargetSelect.h"

+#if defined(LLDB_FORCE_LINK_MCJIT)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wglobal-constructors"
 #include "llvm/ExecutionEngine/MCJIT.h"
 #pragma clang diagnostic pop
+#endif

 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
Index: source/Plugins/ExpressionParser/Clang/CMakeLists.txt
===
--- source/Plugins/ExpressionParser/Clang/CMakeLists.txt
+++ source/Plugins/ExpressionParser/Clang/CMakeLists.txt
@@ -50,3 +50,7 @@
 MCJIT
 Support
   )
+if(LLVM_LINK_LLVM_DYLIB OR LLVM_BUILD_SHARED_LIBS)
+  target_compile_definitions(lldbPluginExpressionParserClang PRIVATE
+LLDB_FORCE_LINK_MCJIT)
+endif()
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r359848 - [Reproducers] Improve reproducer help

2019-05-02 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu May  2 17:10:31 2019
New Revision: 359848

URL: http://llvm.org/viewvc/llvm-project?rev=359848&view=rev
Log:
[Reproducers] Improve reproducer help

Extend the documentation for the reproducer command.

Modified:
lldb/trunk/source/Commands/CommandObjectReproducer.cpp

Modified: lldb/trunk/source/Commands/CommandObjectReproducer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectReproducer.cpp?rev=359848&r1=359847&r2=359848&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectReproducer.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectReproducer.cpp Thu May  2 17:10:31 
2019
@@ -21,8 +21,12 @@ using namespace lldb_private;
 class CommandObjectReproducerGenerate : public CommandObjectParsed {
 public:
   CommandObjectReproducerGenerate(CommandInterpreter &interpreter)
-  : CommandObjectParsed(interpreter, "reproducer generate",
-"Generate reproducer on disk.", nullptr) {}
+  : CommandObjectParsed(
+interpreter, "reproducer generate",
+"Generate reproducer on disk. When the debugger is in capture "
+"mode, this command will output the reproducer to a directory on "
+"disk. In replay mode this command in a no-op.",
+nullptr) {}
 
   ~CommandObjectReproducerGenerate() override = default;
 
@@ -61,8 +65,14 @@ protected:
 class CommandObjectReproducerStatus : public CommandObjectParsed {
 public:
   CommandObjectReproducerStatus(CommandInterpreter &interpreter)
-  : CommandObjectParsed(interpreter, "reproducer status",
-"Show the current reproducer status.", nullptr) {}
+  : CommandObjectParsed(
+interpreter, "reproducer status",
+"Show the current reproducer status. In capture mode the debugger "
+"is collecting all the information it needs to create a "
+"reproducer.  In replay mode the reproducer is replaying a "
+"reproducer. When the reproducers are off, no data is collected "
+"and no reproducer can be generated.",
+nullptr) {}
 
   ~CommandObjectReproducerStatus() override = default;
 
@@ -90,9 +100,10 @@ protected:
 
 CommandObjectReproducer::CommandObjectReproducer(
 CommandInterpreter &interpreter)
-: CommandObjectMultiword(interpreter, "reproducer",
- "Commands controlling LLDB reproducers.",
- "log  []") {
+: CommandObjectMultiword(
+  interpreter, "reproducer",
+  "Commands to inspect and manipulate the reproducer functionality.",
+  "log  []") {
   LoadSubCommand(
   "generate",
   CommandObjectSP(new CommandObjectReproducerGenerate(interpreter)));


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


[Lldb-commits] [PATCH] D61473: ExpressionParser: only force link MCJIT when needed

2019-05-02 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd added a comment.

gold-2.27, clang 6.0.0, `-ffunction-sections`, `-fdata-sections`, 
`-DLLVM_ENABLE_UNWIND_TABLES=NO`, MinSizeRel:

**BEFORE**

  bin/lldb-server  :
  section   size   addr
  .interp 284194928
  .note.ABI-tag   324194956
  .dynsym  112084194992
  .gnu.hash  1044214304
  .gnu.version   9344214408
  .gnu.version_r 6084215344
  .init   264224736
  .plt  55204224768
  .text  42134554230288
  .fini98443744
  .rodata76857088443760
  .eh_frame 1660   16129472
  .eh_frame_hdr  332   16131132
  .tbss   41   16136640
  .jcr 8   16136640
  .fini_array  8   16136648
  .init_array432   16136656
  .data.rel.ro   1220808   16137088
  .dynamic   640   17357896
  .got   280   17358544
  .got.plt  2776   17358824
  .tm_clone_table  0   17361600
  .data35072   17361600
  .bss 45632   17396672
  .comment   443  0
  .note.gnu.gold-version  28  0
  *COM*0  0
  Total 13225792

**AFTER**

  bin/lldb-server  :
  section   size   addr
  .interp 284194928
  .note.ABI-tag   324194956
  .dynsym  111844194992
  .gnu.hash  1044214264
  .gnu.version   9324214368
  .gnu.version_r 6084215300
  .init   264223928
  .plt  50724223968
  .text  26474084229040
  .fini96876448
  .rodata59603206876464
  .eh_frame 1540   12836784
  .eh_frame_hdr  292   12838324
  .tbss   41   12845952
  .jcr 8   12845952
  .fini_array  8   12845960
  .init_array416   12845968
  .data.rel.ro   1132392   12846384
  .dynamic   640   13978776
  .got   200   13979424
  .got.plt  2552   13979624
  .tm_clone_table  0   13982176
  .data33136   13982176
  .bss 44914   14015312
  .comment   443  0
  .note.gnu.gold-version  28  0
  *COM*0  0
  Total  9842333


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61473



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


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

2019-05-02 Thread António Afonso via Phabricator via lldb-commits
aadsm marked 4 inline comments as done and an inline comment as not done.
aadsm added inline comments.



Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:60-87
+#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 ": did not return errc::success.\n"  
\
+<< "error number: " << ASSERT_NO_ERROR_ec.value() << "\n"  
\
+<< "error message: " << ASSERT_NO_ERROR_ec.message() << "\n";  
\

jingham wrote:
> These defines don't seem specific to this test, is there a more general place 
> you could put them?
I could put it in `TestUtilities.h`?



Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:96-122
+llvm::Expected LineEntryTest::GetModule() {
+  if (m_module_sp)
+return m_module_sp;
+
+  std::string yaml = GetInputFilePath("inlined-functions.yaml");
+  llvm::SmallString<128> obj;
+

jingham wrote:
> It looks like this bit of business has been copied around in a bunch of other 
> tests in the unittest framework.  Could we put this in a common place (like 
> make a LLDBUnitTest : testing::Test class that does this?
How about adding a new function to TestUtilities.cpp named `ReadYAMLObject`?



Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:193-194
+int result = sum2(a, b) + sum2(c, d);
+return result;
+}
+

jingham wrote:
> Can you make the return here not trivial (like return result + 5)}  The way 
> you have written the line return line doesn't contribute any code so you 
> would step all the way out to the caller, but it would be good to test that 
> we didn't just extend the range to our caller, i.e. that next on "int result 
> ="... stops at the "return result" which it should do except in your example 
> line 13 contributes no code. 
That's a good idea, thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61292



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


[Lldb-commits] [PATCH] D61478: Move decl completion out of the ASTImporterDelegate and document it [NFC]

2019-05-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added reviewers: shafik, aprantl.
Herald added a reviewer: martong.
Herald added a reviewer: a.sidorin.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
teemperor edited the summary of this revision.
Herald added a subscriber: rnkovacs.

The ASTImporterDelegate is currently responsible for both recording and also 
completing
types. This patch moves the actual completion and recording code outside the 
ASTImporterDelegate
to reduce the amount of responsibilities the ASTImporterDelegate has to fulfill.

As I anyway had to touch the code when moving I also documented and refactored 
most of it
(e.g. no more asserts that we call the deporting start/end function always as a 
pair).

Note that I had to make the ASTImporterDelegate and it's related functions 
public now so that
I can move out the functionality in another class (that doesn't need to be in 
the header).


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61478

Files:
  lldb/include/lldb/Symbol/ClangASTImporter.h
  lldb/source/Symbol/ClangASTImporter.cpp

Index: lldb/source/Symbol/ClangASTImporter.cpp
===
--- lldb/source/Symbol/ClangASTImporter.cpp
+++ lldb/source/Symbol/ClangASTImporter.cpp
@@ -241,6 +241,95 @@
   }
 };
 
+namespace {
+/// Puts the ClangASTImporter into deport mode in this scope.
+///
+/// In deport mode, every copied Decl that could require completion will
+/// be completed at the end of the scope (including all Decls that are
+/// imported while completing the original Decls).
+class DeportQueueScope : public ClangASTImporter::NewDeclListener {
+  ClangASTImporter::ImporterDelegateSP m_delegate;
+  // FIXME: Investigate how many decls we usually have in these sets and
+  // see if we can use SmallPtrSet instead here.
+  std::set m_decls_to_deport;
+  std::set m_decls_already_deported;
+  clang::ASTContext *m_dst_ctx;
+  clang::ASTContext *m_src_ctx;
+  ClangASTImporter &importer;
+
+public:
+  /// Constructs a DeportQueueScope.
+  /// \param importer The ClangASTImporter that we should observe.
+  /// \param dst_ctx The ASTContext to which Decls are imported.
+  /// \param src_ctx The ASTContext from which Decls are imported.
+  explicit DeportQueueScope(ClangASTImporter &importer,
+clang::ASTContext *dst_ctx,
+clang::ASTContext *src_ctx)
+  : m_delegate(importer.GetDelegate(dst_ctx, src_ctx)), m_dst_ctx(dst_ctx),
+m_src_ctx(src_ctx), importer(importer) {
+m_delegate->SetImportListener(this);
+  }
+
+  virtual ~DeportQueueScope() {
+ClangASTImporter::ASTContextMetadataSP to_context_md =
+importer.GetContextMetadata(m_dst_ctx);
+
+// Deport all decls we collected until now.
+while (!m_decls_to_deport.empty()) {
+  NamedDecl *decl = *m_decls_to_deport.begin();
+
+  m_decls_already_deported.insert(decl);
+  m_decls_to_deport.erase(decl);
+
+  // Otherwise we should never have added this because it doesn't need to
+  // be deported.
+  assert(to_context_md->m_origins[decl].ctx == m_src_ctx);
+
+  Decl *original_decl = to_context_md->m_origins[decl].decl;
+
+  // Complete the decl now.
+  ClangASTContext::GetCompleteDecl(m_src_ctx, original_decl);
+  if (auto *tag_decl = dyn_cast(decl)) {
+if (auto *original_tag_decl = dyn_cast(original_decl)) {
+  if (original_tag_decl->isCompleteDefinition()) {
+m_delegate->ImportDefinitionTo(tag_decl, original_tag_decl);
+tag_decl->setCompleteDefinition(true);
+  }
+}
+
+tag_decl->setHasExternalLexicalStorage(false);
+tag_decl->setHasExternalVisibleStorage(false);
+  } else if (auto *container_decl = dyn_cast(decl)) {
+container_decl->setHasExternalLexicalStorage(false);
+container_decl->setHasExternalVisibleStorage(false);
+  }
+
+  to_context_md->m_origins.erase(decl);
+}
+
+// Stop listening to imported decls. We do this after clearing the
+// Decls we needed to import to catch all Decls they might have pulled in.
+m_delegate->RemoveImportListener();
+  }
+
+  void NewDeclImported(clang::Decl *from, clang::Decl *to) override {
+// Filter out decls that we can't complete later.
+if (!isa(to) && !isa(to))
+  return;
+RecordDecl *from_record_decl = dyn_cast(from);
+// We don't need to deport injected class name decls.
+if (from_record_decl && from_record_decl->isInjectedClassName())
+  return;
+
+NamedDecl *to_named_decl = dyn_cast(to);
+// Check if we already deported this type.
+if (m_decls_already_deported.count(to_named_decl) != 0)
+  return;
+m_decls_to_deport.insert(to_named_decl);
+  }
+};
+} // namespace
+
 lldb::opaque_compiler_type_t
 ClangASTImporter::DeportType(clang::ASTContext *dst_ctx,
  clang::ASTContext *src_ctx,
@@ -254,27 +343,16 @@

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

2019-05-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I'm impressed by the test.  I've tried to think of an alternative strategy for 
testing this (perhaps by adding a suitable mode to lldb-test), but I couldn't 
come up with one that a reasonable one, so this might be the best we can do 
right now. Thank you for taking the trouble to write that.




Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:60-87
+#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 ": did not return errc::success.\n"  
\
+<< "error number: " << ASSERT_NO_ERROR_ec.value() << "\n"  
\
+<< "error message: " << ASSERT_NO_ERROR_ec.message() << "\n";  
\

aadsm wrote:
> jingham wrote:
> > These defines don't seem specific to this test, is there a more general 
> > place you could put them?
> I could put it in `TestUtilities.h`?
I don't think most of these should exist actually... Instead of 
`EXPECTED_NO_ERROR`, you can use write `if(std::error_code ec = ...) return 
llvm::errorCodeToError(ec);`

For the rest, I'd suggest just inlining the macros and using 
`llvm::createStringError` instead of `llvm::make_error`, as 
it's somewhat shorter (if you want, you can make a utility wrapper function 
around that to avoid the inconvertibleErrorCode argument).



Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:89-94
+#define DUMP_RANGE(range)  
\
+  {
\
+StreamString s;
\
+range.DumpDebug(&s);   
\
+std::cout << s.GetData() << std::endl; 
\
+  }

This is unused (and it wouldn't be right anyway).



Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:96-122
+llvm::Expected LineEntryTest::GetModule() {
+  if (m_module_sp)
+return m_module_sp;
+
+  std::string yaml = GetInputFilePath("inlined-functions.yaml");
+  llvm::SmallString<128> obj;
+

aadsm wrote:
> jingham wrote:
> > It looks like this bit of business has been copied around in a bunch of 
> > other tests in the unittest framework.  Could we put this in a common place 
> > (like make a LLDBUnitTest : testing::Test class that does this?
> How about adding a new function to TestUtilities.cpp named `ReadYAMLObject`?
A utility function sounds nice. (a test class would be fine too, but I'd name 
it a bit less generic, as not all of our unit tests are in business of running 
yaml2obj and creating modules).

The part I'm not so sure about is the location. Originally the idea was that we 
would have a special subfolder for test helpers related to each module under 
test, but then at some point that got changed into `TestingSupport` which 
sounds more generic (this evolution here is visible in the fact that the cmake 
target name in that folder is called `lldbUtilityHelpers`). If we put this 
function there then we'd have to pull in the Core module (and everything that 
goes with it). Though that isn't that bad on it's own, it is a bit unfortunate, 
as right now the `Utility` unit test executable is our best defense against 
unexpected dependencies creeping into the main module. After this, that 
executable would link in the whole world again, and we'd lose this defense.

Another possibility might be to just put the yaml2obj (which is the main source 
of mess here) part in that file, and leave the construction of the Module 
object to the users.



Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:150-152
+  auto line_entry = GetLineEntryForLine(17);
+  if (!line_entry)
+ASSERT_TRUE(false) << line_entry.takeError();

replace with `ASSERT_THAT_EXPECTED(..., llvm::Succeeded());` (and in subsequent 
tests)



Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:208
+# inlined-functions.cpp is src.cpp for space considerations.
+0x20: outl %eax, %dx  src.cpp:16
+0x21: movl $0xbeefdead, %esi  src.cpp:16

The instructions aren't real (MachO obj2yaml does not preserve them), so it may 
be best to just leave them out to avoid confusion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61292



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