[Lldb-commits] [lldb] r367201 - [lldb][NFC] Remove DiagnosticManager::CopyDiagnostics

2019-07-29 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Jul 29 00:37:17 2019
New Revision: 367201

URL: http://llvm.org/viewvc/llvm-project?rev=367201&view=rev
Log:
[lldb][NFC] Remove DiagnosticManager::CopyDiagnostics

The Diagnostic class in LLDB is suppossed to be inherited from,
so just copying the diagnostics like this is wrong. The function
is also unused, so lets just get rid of it instead of creating
some cloning facility for it.

Modified:
lldb/trunk/include/lldb/Expression/DiagnosticManager.h
lldb/trunk/source/Expression/DiagnosticManager.cpp

Modified: lldb/trunk/include/lldb/Expression/DiagnosticManager.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/DiagnosticManager.h?rev=367201&r1=367200&r2=367201&view=diff
==
--- lldb/trunk/include/lldb/Expression/DiagnosticManager.h (original)
+++ lldb/trunk/include/lldb/Expression/DiagnosticManager.h Mon Jul 29 00:37:17 
2019
@@ -125,8 +125,6 @@ public:
 m_diagnostics.push_back(diagnostic);
   }
 
-  void CopyDiagnostics(DiagnosticManager &otherDiagnostics);
-
   size_t Printf(DiagnosticSeverity severity, const char *format, ...)
   __attribute__((format(printf, 3, 4)));
   size_t PutString(DiagnosticSeverity severity, llvm::StringRef str);

Modified: lldb/trunk/source/Expression/DiagnosticManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DiagnosticManager.cpp?rev=367201&r1=367200&r2=367201&view=diff
==
--- lldb/trunk/source/Expression/DiagnosticManager.cpp (original)
+++ lldb/trunk/source/Expression/DiagnosticManager.cpp Mon Jul 29 00:37:17 2019
@@ -77,12 +77,3 @@ size_t DiagnosticManager::PutString(Diag
   AddDiagnostic(str, severity, eDiagnosticOriginLLDB);
   return str.size();
 }
-
-void DiagnosticManager::CopyDiagnostics(DiagnosticManager &otherDiagnostics) {
-  for (const DiagnosticList::value_type &other_diagnostic:
-   otherDiagnostics.Diagnostics()) {
-AddDiagnostic(
-other_diagnostic->GetMessage(), other_diagnostic->GetSeverity(),
-other_diagnostic->getKind(), other_diagnostic->GetCompilerID());
-  }
-}


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


[Lldb-commits] [lldb] r367207 - [lldb][NFC] Split emitting and parsing in LLDBOptionDefEmitter

2019-07-29 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Jul 29 01:22:41 2019
New Revision: 367207

URL: http://llvm.org/viewvc/llvm-project?rev=367207&view=rev
Log:
[lldb][NFC] Split emitting and parsing in LLDBOptionDefEmitter

Splitting the different logic is cleaner and we it will be easier
to implement the enum emitting (which otherwise would have to
reimplement the Record parsing).

Modified:
lldb/trunk/utils/TableGen/LLDBOptionDefEmitter.cpp

Modified: lldb/trunk/utils/TableGen/LLDBOptionDefEmitter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/utils/TableGen/LLDBOptionDefEmitter.cpp?rev=367207&r1=367206&r2=367207&view=diff
==
--- lldb/trunk/utils/TableGen/LLDBOptionDefEmitter.cpp (original)
+++ lldb/trunk/utils/TableGen/LLDBOptionDefEmitter.cpp Mon Jul 29 01:22:41 2019
@@ -33,49 +33,85 @@ static RecordsByCommand getCommandList(s
   return result;
 }
 
-static void emitOption(Record *Option, raw_ostream &OS) {
-  OS << "  {";
-
-  // List of option groups this option is in.
+namespace {
+struct CommandOption {
   std::vector GroupsArg;
+  bool Required = false;
+  std::string FullName;
+  std::string ShortName;
+  std::string ArgType;
+  bool OptionalArg = false;
+  std::string Validator;
+  std::string ArgEnum;
+  std::vector Completions;
+  std::string Description;
+
+  CommandOption() = default;
+  CommandOption(Record *Option) {
+if (Option->getValue("Groups")) {
+  // The user specified a list of groups.
+  auto Groups = Option->getValueAsListOfInts("Groups");
+  for (int Group : Groups)
+GroupsArg.push_back("LLDB_OPT_SET_" + std::to_string(Group));
+} else if (Option->getValue("GroupStart")) {
+  // The user specified a range of groups (with potentially only one
+  // element).
+  int GroupStart = Option->getValueAsInt("GroupStart");
+  int GroupEnd = Option->getValueAsInt("GroupEnd");
+  for (int i = GroupStart; i <= GroupEnd; ++i)
+GroupsArg.push_back("LLDB_OPT_SET_" + std::to_string(i));
+}
+
+// Check if this option is required.
+Required = Option->getValue("Required");
+
+// Add the full and short name for this option.
+FullName = Option->getValueAsString("FullName");
+ShortName = Option->getValueAsString("ShortName");
+
+if (auto A = Option->getValue("ArgType"))
+  ArgType = A->getValue()->getAsUnquotedString();
+OptionalArg = Option->getValue("OptionalArg") != nullptr;
+
+if (Option->getValue("Validator"))
+  Validator = Option->getValueAsString("Validator");
+
+if (Option->getValue("ArgEnum"))
+  ArgEnum = Option->getValueAsString("ArgEnum");
 
-  if (Option->getValue("Groups")) {
-// The user specified a list of groups.
-auto Groups = Option->getValueAsListOfInts("Groups");
-for (int Group : Groups)
-  GroupsArg.push_back("LLDB_OPT_SET_" + std::to_string(Group));
-  } else if (Option->getValue("GroupStart")) {
-// The user specified a range of groups (with potentially only one 
element).
-int GroupStart = Option->getValueAsInt("GroupStart");
-int GroupEnd = Option->getValueAsInt("GroupEnd");
-for (int i = GroupStart; i <= GroupEnd; ++i)
-  GroupsArg.push_back("LLDB_OPT_SET_" + std::to_string(i));
+if (Option->getValue("Completions"))
+  Completions = Option->getValueAsListOfStrings("Completions");
+
+if (auto D = Option->getValue("Description"))
+  Description = D->getValue()->getAsUnquotedString();
   }
+};
+} // namespace
+
+static void emitOption(const CommandOption &O, raw_ostream &OS) {
+  OS << "  {";
 
   // If we have any groups, we merge them. Otherwise we move this option into
   // the all group.
-  if (GroupsArg.empty())
+  if (O.GroupsArg.empty())
 OS << "LLDB_OPT_SET_ALL";
   else
-OS << llvm::join(GroupsArg.begin(), GroupsArg.end(), " | ");
+OS << llvm::join(O.GroupsArg.begin(), O.GroupsArg.end(), " | ");
 
   OS << ", ";
 
   // Check if this option is required.
-  OS << (Option->getValue("Required") ? "true" : "false");
+  OS << (O.Required ? "true" : "false");
 
   // Add the full and short name for this option.
-  OS << ", \"" << Option->getValueAsString("FullName") << "\", ";
-  OS << '\'' << Option->getValueAsString("ShortName") << "'";
-
-  auto ArgType = Option->getValue("ArgType");
-  bool IsOptionalArg = Option->getValue("OptionalArg") != nullptr;
+  OS << ", \"" << O.FullName << "\", ";
+  OS << '\'' << O.ShortName << "'";
 
   // Decide if we have either an option, required or no argument for this
   // option.
   OS << ", OptionParser::";
-  if (ArgType) {
-if (IsOptionalArg)
+  if (!O.ArgType.empty()) {
+if (O.OptionalArg)
   OS << "eOptionalArgument";
 else
   OS << "eRequiredArgument";
@@ -83,43 +119,41 @@ static void emitOption(Record *Option, r
 OS << "eNoArgument";
   OS << ", ";
 
-  if (Option->getValue("Validator"))
-OS << Option->getValueAsString("Validator");
+  if (!O.Validator.empty())
+ 

[Lldb-commits] [lldb] r367228 - [lldb] [test] Mark three new tests XFAIL on NetBSD

2019-07-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Jul 29 07:32:40 2019
New Revision: 367228

URL: http://llvm.org/viewvc/llvm-project?rev=367228&view=rev
Log:
[lldb] [test] Mark three new tests XFAIL on NetBSD

Modified:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-abrt/TestHandleAbort.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py?rev=367228&r1=367227&r2=367228&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
Mon Jul 29 07:32:40 2019
@@ -20,6 +20,7 @@ class ExecTestCase(TestBase):
 
 @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], 
bugnumber="rdar://problem/34559552") # this exec test has problems on ios 
systems
+@expectedFailureNetBSD
 @skipIfSanitized # rdar://problem/43756823
 @skipIfWindows
 def test_hitting_exec (self):
@@ -27,6 +28,7 @@ class ExecTestCase(TestBase):
 
 @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
 @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], 
bugnumber="rdar://problem/34559552") # this exec test has problems on ios 
systems
+@expectedFailureNetBSD
 @skipIfSanitized # rdar://problem/43756823
 @skipIfWindows
 def test_skipping_exec (self):

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-abrt/TestHandleAbort.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-abrt/TestHandleAbort.py?rev=367228&r1=367227&r2=367228&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-abrt/TestHandleAbort.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-abrt/TestHandleAbort.py
 Mon Jul 29 07:32:40 2019
@@ -19,6 +19,7 @@ class HandleAbortTestCase(TestBase):
 NO_DEBUG_INFO_TESTCASE = True
 
 @skipIfWindows  # signals do not exist on Windows
+@expectedFailureNetBSD
 def test_inferior_handle_sigabrt(self):
 """Inferior calls abort() and handles the resultant SIGABRT.
Stopped at a breakpoint in the handler, verify that the backtrace


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


[Lldb-commits] [PATCH] D65386: [lldb][NFC] Use an enum instead of chars when handling options [WIP]

2019-07-29 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added a reviewer: JDevlieghere.
Herald added subscribers: lldb-commits, abidh.
Herald added a project: LLDB.
teemperor added a comment.

For the sake of completeness, that's how Clang would warn about unimplemented 
options:

  llvm-project/lldb/source/Commands/CommandObjectSettings.cpp:102:15: warning: 
enumeration value 'Global' not handled in switch [-Wswitch]
switch (*opt) {
^
  llvm-project/lldb/source/Commands/CommandObjectSettings.cpp:102:15: note: add 
missing switch cases
switch (*opt) {
^


Currently in LLDB we handle options like this:

  switch(short_option) {
  case 'g': m_force = true; break;
  case 'f': m_global = true; supportGlobal(); break;
  default:
error.SetErrorStringWithFormat("unrecognized options '%c'",
 short_option);
break;

This format has a two problems:

1. If we don't handle an option in this switch statement (because of a typo, a 
changed short-option

name, or because someone just forgot to implement it), we only find out when we 
have a test or user
that notices we get an error when using this option. There is no compile-time 
verification of this.

2. It's not very easy to read unless you know all the short options for all 
commands.

This patch makes our tablegen emit an enum that represents the options, which 
changes the code above to this (using SettingsSet as an example):

  auto opt = toSettingsSetEnum(short_option, error);
  if (!opt)
return error;
  
  switch (opt) {
  case SettingsSet::Global: m_force = true; break;
  case SettingsSet::Force: m_global = true; supportGlobal(); break;
  // No default with error handling, already handled in toSettingsSetEnum.
  // If you don't implement an option, this will trigger a compiler warning for 
unhandled enum value.
  }



NOTE: This is just a dummy patch to get some feedback if people are for some 
reason opposed to this change
(which would save me from converting all our switch-cases to the new format). I 
only changed the code for
`settings set` to demonstrate the change.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D65386

Files:
  lldb/source/Commands/CommandObjectSettings.cpp
  lldb/utils/TableGen/LLDBOptionDefEmitter.cpp

Index: lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
===
--- lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
+++ lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
@@ -160,6 +160,44 @@
   OS << "},\n";
 }
 
+static std::string Capitalize(llvm::StringRef s) {
+  return s.substr(0, 1).upper() + s.substr(1).str();
+}
+static std::string ToCamelCase(llvm::StringRef In) {
+  llvm::SmallVector Parts;
+  llvm::SplitString(In, Parts, "-_ ");
+  std::string Result;
+  for (llvm::StringRef S : Parts)
+Result.append(Capitalize(S));
+  return Result;
+}
+
+static void emitEnumDeclaration(llvm::StringRef EnumName,
+const std::vector &Options,
+raw_ostream &OS) {
+  OS << "namespace { enum class " << EnumName << " {\n";
+  for (const CommandOption &CO : Options)
+OS << "  " << ToCamelCase(CO.FullName) << ",\n";
+  OS << "}; }\n";
+}
+
+static void emitEnumSwitch(llvm::StringRef EnumName,
+   const std::vector &Options,
+   raw_ostream &OS) {
+  OS << "static llvm::Optional<" << EnumName << "> to" << EnumName
+ << "(char c, Status error) {\n";
+  OS << "  switch(c) {";
+  for (const CommandOption &CO : Options)
+OS << "case '" << CO.ShortName << "': return " << EnumName
+   << "::" << ToCamelCase(CO.FullName) << ";\n";
+  OS << R"cpp(
+default:
+  error.SetErrorStringWithFormat("unrecognized option '%c'", c);
+  return {};
+)cpp";
+  OS << "  }\n}\n";
+}
+
 /// Emits all option initializers to the raw_ostream.
 static void emitOptions(std::string Command, std::vector Records,
 raw_ostream &OS) {
@@ -169,6 +207,9 @@
 
   std::string ID = Command;
   std::replace(ID.begin(), ID.end(), ' ', '_');
+
+  std::string CamelCaseID = ToCamelCase(Command);
+
   // Generate the macro that the user needs to define before including the
   // *.inc file.
   std::string NeededMacro = "LLDB_OPTIONS_" + ID;
@@ -180,8 +221,13 @@
   OS << "constexpr static OptionDefinition g_" + ID + "_options[] = {\n";
   for (CommandOption &CO : Options)
 emitOption(CO, OS);
-  // We undefine the macro for the user like Clang's include files are doing it.
   OS << "};\n";
+
+  std::string Enum = "OptionEnum" + CamelCaseID;
+  emitEnumDeclaration(Enum, Options, OS);
+  emitEnumSwitch(Enum, Options, OS);
+
+  // We undefine the macro for the user like Clang's include files are doing it.
   OS << "#undef " << NeededMacro << "\n";
   OS << "#endif // " << Command << " command\n\n";
 }
Index: lldb/source/Commands/CommandObjectSettings.cpp
===

[Lldb-commits] [PATCH] D65386: [lldb][NFC] Use an enum instead of chars when handling options [WIP]

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

For the sake of completeness, that's how Clang would warn about unimplemented 
options:

  llvm-project/lldb/source/Commands/CommandObjectSettings.cpp:102:15: warning: 
enumeration value 'Global' not handled in switch [-Wswitch]
switch (*opt) {
^
  llvm-project/lldb/source/Commands/CommandObjectSettings.cpp:102:15: note: add 
missing switch cases
switch (*opt) {
^


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65386



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


[Lldb-commits] [PATCH] D65330: [lldb][docs] Update documentation for monorepo and CMake caches

2019-07-29 Thread J. Ryan Stinnett via Phabricator via lldb-commits
jryans accepted this revision.
jryans added a comment.

Current version looks great to me! 😁




Comment at: lldb/docs/resources/build.rst:90
+
+  > git clone https://github.com/llvm/llvm-project.git
 

This could be done in a separate patch, but I happened to notice that [Get 
Involved section on the LLDB main 
page](https://lldb.llvm.org/index.html#get-involved) currently suggests 
Subversion at the moment. It would be nice to have this updated to Git as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65330



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


[Lldb-commits] [PATCH] D65353: [lldb] Also include the array definition in Properties.inc

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

LGTM beside a small nit pick.




Comment at: lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp:150
   OS << "#ifdef " << NeededMacro << "\n";
+  // OS << "enum {\n";
   for (Record *R : PropertyRecords)

Is this like a placeholder for supporting enums? I think a FIXME or TODO would 
be more appropriate. (Feel free to ignore this if you already have a patch 
lined up for enums and this will be instantly overwritten)


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

https://reviews.llvm.org/D65353



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


[Lldb-commits] [PATCH] D65185: Let tablegen generate property definitions

2019-07-29 Thread Sam McCall via Phabricator via lldb-commits
sammccall added subscribers: chandlerc, sammccall.
sammccall added inline comments.



Comment at: 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:77
+#define LLDB_PROPERTIES_dynamicloaderdarwinkernel
+#include "Properties.inc"
+};

These unqualified `#include` directives are causing us some problems 
downstream. What do you think about qualifying these like other includes in the 
file? i.e. `#include "Plugins/DynamicLoader/Darwin-Kernel/Properties.inc"`

The problem is that these "local" includes can only resolve to the right thing 
if the build system specifies a different `-I` line to each relevant cpp file 
(or the header lives next to the source file, which isn't the case for 
generated files).
Many build systems (including both CMake and bazel) only support doing this for 
separate libraries, however lldb's source isn't sufficiently clearly layered to 
allow splitting into fine-grained libraries in bazel (CMake is much more lax 
here).

While CMake is the gold standard here, it'd be helpful to make it possible to 
build with other systems out-of-tree. @chandlerc was looking at this issue and 
has more context and opinions here.

It also seems a bit less magic and more consistent with the rest of the 
includes in the file, as well as with the project. (Most, though sadly not all, 
.inc files in llvm are included by qualified paths).

I'll send a patch shortly after verifying it fixes the issue.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65185



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


[Lldb-commits] [PATCH] D65397: Qualify includes of Properties[Enum].inc files. NFC

2019-07-29 Thread Sam McCall via Phabricator via lldb-commits
sammccall created this revision.
sammccall added reviewers: JDevlieghere, labath, chandlerc.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
labath added a comment.

I am not sure about the consistency argument (on the other CL), as it seems to 
me that most/all llvm .inc files *which are produced by tblgen" are included by 
via just their bare names. However, these files generally have unique names, 
which is usually achieved by just embedding (a derivative of) the folder name 
into the .inc file name (e.g. AArch64GenAsmWriter.inc, AMDGPUGenAsmWriter.inc, 
...). So, I think the most consistent approach here would be to rename lldb 
files into something like `TargetProperties.inc`, `CoreProperties.inc` etc.

Consistency considerations aside, I do think that having a bunch of files 
called `Properties.inc` is a bit confusing, and it would be good to 
disambiguate between them. I'm fairly ambivalent about whether that is achieved 
by prefixing the include directives with the folder name, or by renaming the 
files so that they have unique names.


This is a bit more explicit, and makes it possible to build LLDB without
varying the -I lines per-directory.
(The latter is useful because many build systems only allow this to be
configured per-library, and LLDB is insufficiently layered to be split into
multiple libraries on stricter build systems).

(My comment on D65185  has some more context)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65397

Files:
  lldb/source/Core/Debugger.cpp
  lldb/source/Core/ModuleList.cpp
  lldb/source/Interpreter/CommandInterpreter.cpp
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
  lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Target/Platform.cpp
  lldb/source/Target/Process.cpp
  lldb/source/Target/Target.cpp
  lldb/source/Target/Thread.cpp

Index: lldb/source/Target/Thread.cpp
===
--- lldb/source/Target/Thread.cpp
+++ lldb/source/Target/Thread.cpp
@@ -65,12 +65,12 @@
 
 static constexpr PropertyDefinition g_properties[] = {
 #define LLDB_PROPERTIES_thread
-#include "Properties.inc"
+#include "Target/Properties.inc"
 };
 
 enum {
 #define LLDB_PROPERTIES_thread
-#include "PropertiesEnum.inc"
+#include "Target/PropertiesEnum.inc"
 };
 
 class ThreadOptionValueProperties : public OptionValueProperties {
Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -3275,12 +3275,12 @@
 
 static constexpr PropertyDefinition g_properties[] = {
 #define LLDB_PROPERTIES_target
-#include "Properties.inc"
+#include "Target/Properties.inc"
 };
 
 enum {
 #define LLDB_PROPERTIES_target
-#include "PropertiesEnum.inc"
+#include "Target/PropertiesEnum.inc"
   ePropertyExperimental,
 };
 
@@ -3358,12 +3358,12 @@
 // TargetProperties
 static constexpr PropertyDefinition g_experimental_properties[]{
 #define LLDB_PROPERTIES_experimental
-#include "Properties.inc"
+#include "Target/Properties.inc"
 };
 
 enum {
 #define LLDB_PROPERTIES_experimental
-#include "PropertiesEnum.inc"
+#include "Target/PropertiesEnum.inc"
 };
 
 class TargetExperimentalOptionValueProperties : public OptionValueProperties {
Index: lldb/source/Target/Process.cpp
===
--- lldb/source/Target/Process.cpp
+++ lldb/source/Target/Process.cpp
@@ -114,12 +114,12 @@
 
 static constexpr PropertyDefinition g_properties[] = {
 #define LLDB_PROPERTIES_process
-#include "Properties.inc"
+#include "Target/Properties.inc"
 };
 
 enum {
 #define LLDB_PROPERTIES_process
-#include "PropertiesEnum.inc"
+#include "Target/PropertiesEnum.inc"
 };
 
 ProcessProperties::ProcessProperties(lldb_private::Process *process)
Index: lldb/source/Target/Platform.cpp
===
--- lldb/source/Target/Platform.cpp
+++ lldb/source/Target/Platform.cpp
@@ -65,12 +65,12 @@
 
 static constexpr PropertyDefinition g_properties[] = {
 #define LLDB_PROPERTIES_platform
-#include "Properties.inc"
+#include "Target/Properties.inc"
 };
 
 enum {
 #define LLDB_PROPERTIES_platform
-#include "PropertiesEnum.inc"
+#include "Target/PropertiesEnum.inc"
 };
 
 } // namespace
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -115,12 +115,12 @@

[Lldb-commits] [PATCH] D65122: [Symbol] Use llvm::Expected when getting TypeSystems

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

I have one remark about the consumeError+LLDB_LOG pattern. As for whether this 
is better than status quo or not, I still don't have an opinion on that. :)




Comment at: source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp:80-84
+llvm::consumeError(std::move(err));
+LLDB_LOG(
+lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_EXPRESSIONS),
+"Failed to get ClangASTContext.\nReason: {}",
+llvm::toString(std::move(err)).c_str());

I don't believe this will work. Once you consume the error, it is left in an 
indeterminate state (which happens to be the "success" state, but it's best not 
to rely on it).
If you do want to log the error (which I do recommend), then you can use the 
LLDB_LOG_ERROR macro. This one will clear the error for you, and it will do so 
even if logging is disabled. I.e., if you log the error, there's no need for an 
additional `consumeError` call.


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

https://reviews.llvm.org/D65122



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


[Lldb-commits] [PATCH] D65330: [lldb][docs] Update documentation for monorepo and CMake caches

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

If we're going to be mentioning test dependencies, then it probably makes sense 
to mention lld too. AFAIK, lld is required for running the (dotest) test suite 
on windows. On other platforms it is not required, but there are tests which 
will only get run if lld is enabled.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65330



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


[Lldb-commits] [PATCH] D64995: [lldb] Fix crash when tab-completing in multi-line expr

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

- Added test.


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

https://reviews.llvm.org/D64995

Files:
  
lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
  
lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/main.c
  lldb/source/Core/IOHandler.cpp


Index: lldb/source/Core/IOHandler.cpp
===
--- lldb/source/Core/IOHandler.cpp
+++ lldb/source/Core/IOHandler.cpp
@@ -233,7 +233,7 @@
 matches, descriptions);
   case Completion::Expression: {
 CompletionResult result;
-CompletionRequest request(current_line, current_line - cursor,
+CompletionRequest request(current_line, cursor - current_line,
   skip_first_n_matches, max_matches, result);
 CommandCompletions::InvokeCommonCompletionCallbacks(
 io_handler.GetDebugger().GetCommandInterpreter(),
Index: 
lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/main.c
===
--- /dev/null
+++ 
lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/main.c
@@ -0,0 +1,5 @@
+int main(int argc, char **argv) {
+  lldb_enable_attach();
+  int to_complete = 0;
+  return to_complete;
+}
Index: 
lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
===
--- /dev/null
+++ 
lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
@@ -0,0 +1,51 @@
+"""
+Test completion for multiline expressions.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+
+class MultilineCompletionTest(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def setUp(self):
+TestBase.setUp(self)
+self.source = 'main.c'
+
+def expect_string(self, string):
+import pexpect
+"""This expects for "string", with timeout & EOF being test fails."""
+try:
+self.child.expect_exact(string)
+except pexpect.EOF:
+self.fail("Got EOF waiting for '%s'" % (string))
+except pexpect.TIMEOUT:
+self.fail("Timed out waiting for '%s'" % (string))
+
+@expectedFailureAll(
+oslist=["windows"],
+bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
+def test_basic_completion(self):
+"""Test that we can complete a simple multiline expression"""
+self.build()
+self.setTearDownCleanup()
+
+import pexpect
+exe = self.getBuildArtifact("a.out")
+prompt = "(lldb) "
+
+run_commands = ' -o "b main" -o "r"'
+self.child = pexpect.spawn(
+'%s %s %s %s' %
+(lldbtest_config.lldbExec, self.lldbOption, run_commands, exe))
+child = self.child
+
+self.expect_string(prompt)
+self.child.sendline("expr")
+self.expect_string("terminate with an empty line to evaluate")
+self.child.send("to_\t")
+self.expect_string("to_complete")
+
+self.deletePexpectChild()
Index: 
lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile
===
--- /dev/null
+++ 
lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/Makefile
@@ -0,0 +1,3 @@
+LEVEL = ../../make
+C_SOURCES := main.c
+include $(LEVEL)/Makefile.rules


Index: lldb/source/Core/IOHandler.cpp
===
--- lldb/source/Core/IOHandler.cpp
+++ lldb/source/Core/IOHandler.cpp
@@ -233,7 +233,7 @@
 matches, descriptions);
   case Completion::Expression: {
 CompletionResult result;
-CompletionRequest request(current_line, current_line - cursor,
+CompletionRequest request(current_line, cursor - current_line,
   skip_first_n_matches, max_matches, result);
 CommandCompletions::InvokeCommonCompletionCallbacks(
 io_handler.GetDebugger().GetCommandInterpreter(),
Index: lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/main.c
===
--- /dev/null
+++ lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/main.c
@@ -0,0 +1,5 @@
+int main(int argc, char **argv) {
+  lldb_enable_attach();
+  int to_complete = 0;
+  return to_complete;
+}
Index: lldb/packages/Python/lldbsuite/test/expression_command/multiline-completion/TestMultilineCompletion.py
===
--- /dev/null
+++ ll

[Lldb-commits] [PATCH] D65397: Qualify includes of Properties[Enum].inc files. NFC

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

I am not sure about the consistency argument (on the other CL), as it seems to 
me that most/all llvm .inc files *which are produced by tblgen" are included by 
via just their bare names. However, these files generally have unique names, 
which is usually achieved by just embedding (a derivative of) the folder name 
into the .inc file name (e.g. AArch64GenAsmWriter.inc, AMDGPUGenAsmWriter.inc, 
...). So, I think the most consistent approach here would be to rename lldb 
files into something like `TargetProperties.inc`, `CoreProperties.inc` etc.

Consistency considerations aside, I do think that having a bunch of files 
called `Properties.inc` is a bit confusing, and it would be good to 
disambiguate between them. I'm fairly ambivalent about whether that is achieved 
by prefixing the include directives with the folder name, or by renaming the 
files so that they have unique names.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65397



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


[Lldb-commits] [PATCH] D65397: Qualify includes of Properties[Enum].inc files. NFC

2019-07-29 Thread Sam McCall via Phabricator via lldb-commits
sammccall updated this revision to Diff 212166.
sammccall added a comment.
Herald added a subscriber: mgorny.
Herald added a reviewer: jdoerfert.

Give the files distinct names instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65397

Files:
  lldb/source/Core/CMakeLists.txt
  lldb/source/Core/CoreProperties.td
  lldb/source/Core/Debugger.cpp
  lldb/source/Core/ModuleList.cpp
  lldb/source/Core/Properties.td
  lldb/source/Interpreter/CMakeLists.txt
  lldb/source/Interpreter/CommandInterpreter.cpp
  lldb/source/Interpreter/InterpreterProperties.td
  lldb/source/Interpreter/Properties.td
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/CMakeLists.txt
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernelProperties.td
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/Properties.td
  lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt
  lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
  lldb/source/Plugins/JITLoader/GDB/JITLoaderGDBProperties.td
  lldb/source/Plugins/JITLoader/GDB/Properties.td
  lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformMacOSXProperties.td
  lldb/source/Plugins/Platform/MacOSX/Properties.td
  lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
  lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDPProperties.td
  lldb/source/Plugins/Process/MacOSX-Kernel/Properties.td
  lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteProperties.td
  lldb/source/Plugins/Process/gdb-remote/Properties.td
  lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt
  lldb/source/Plugins/StructuredData/DarwinLog/Properties.td
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  
lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLogProperties.td
  lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  lldb/source/Plugins/SymbolFile/DWARF/Properties.td
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFProperties.td
  lldb/source/Target/CMakeLists.txt
  lldb/source/Target/Platform.cpp
  lldb/source/Target/Process.cpp
  lldb/source/Target/Properties.td
  lldb/source/Target/Target.cpp
  lldb/source/Target/TargetProperties.td
  lldb/source/Target/Thread.cpp

Index: lldb/source/Target/Thread.cpp
===
--- lldb/source/Target/Thread.cpp
+++ lldb/source/Target/Thread.cpp
@@ -65,12 +65,12 @@
 
 static constexpr PropertyDefinition g_properties[] = {
 #define LLDB_PROPERTIES_thread
-#include "Properties.inc"
+#include "TargetProperties.inc"
 };
 
 enum {
 #define LLDB_PROPERTIES_thread
-#include "PropertiesEnum.inc"
+#include "TargetPropertiesEnum.inc"
 };
 
 class ThreadOptionValueProperties : public OptionValueProperties {
Index: lldb/source/Target/Properties.td
===
--- /dev/null
+++ lldb/source/Target/Properties.td
@@ -1,234 +0,0 @@
-include "../../include/lldb/Core/PropertiesBase.td"
-
-let Definition = "experimental" in {
-  def InjectLocalVars : Property<"inject-local-vars", "Boolean">,
-Global, DefaultTrue,
-Desc<"If true, inject local variables explicitly into the expression text. This will fix symbol resolution when there are name collisions between ivars and local variables. But it can make expressions run much more slowly.">;
-  def UseModernTypeLookup : Property<"use-modern-type-lookup", "Boolean">,
-Global, DefaultFalse,
-Desc<"If true, use Clang's modern type lookup infrastructure.">;
-}
-
-let Definition = "target" in {
-  def DefaultArch: Property<"default-arch", "Arch">,
-Global,
-DefaultStringValue<"">,
-Desc<"Default architecture to choose, when there's a choice.">;
-  def MoveToNearestCode: Property<"move-to-nearest-code", "Boolean">,
-DefaultTrue,
-Desc<"Move breakpoints to nearest code.">;
-  def Language: Property<"language", "Language">,
-DefaultEnumValue<"eLanguageTypeUnknown">,
-Desc<"The language to use when interpreting expressions entered in commands.">;
-  def ExprPrefix: Property<"expr-prefix", "FileSpec">,
-DefaultStringValue<"">,
-Desc<"Path to a file containing expressions to be prepended to all expressions.">;
-  def PreferDynamic: Property<"prefer-dynamic-value", "Enum">,
-DefaultEnumValue<"eDynamicDontRunTarget">,
-EnumValues<"OptionEnumValues(g_dynamic_value_types)">,
-Desc<"Should printed values be shown as their dynamic value.">;
-  def EnableSynthetic: Property<"enable-synthetic-value", "Boolean">,
-Default

[Lldb-commits] [PATCH] D65386: [lldb][NFC] Use an enum instead of chars when handling options [WIP]

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

How about codegenning the entire implementation of `SetOptionValue`? That way 
the user won't have to write any switch statements at all. Ideally, the 
option-setting code would be something like:

  void (Status?, Error?) SetOptionForce(StringRef arg, ExecutionContext *ctx) { 
m_force = true; }
  void (Status?, Error?) SetOptionGlobal(StringRef arg, ExecutionContext *ctx) 
{ m_global = true; }
  
  #include "The_thing_which_generates_SetOptionValue.inc"

The generated implementation of SetOptionValue could be the same as the current 
one, except that it calls into these user-specified functions instead of 
setting the values itself


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65386



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


[Lldb-commits] [PATCH] D65397: Qualify includes of Properties[Enum].inc files. NFC

2019-07-29 Thread Sam McCall via Phabricator via lldb-commits
sammccall updated this revision to Diff 212167.
sammccall added a comment.

Fix one straggler


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65397

Files:
  lldb/source/Core/CMakeLists.txt
  lldb/source/Core/CoreProperties.td
  lldb/source/Core/Debugger.cpp
  lldb/source/Core/ModuleList.cpp
  lldb/source/Core/Properties.td
  lldb/source/Interpreter/CMakeLists.txt
  lldb/source/Interpreter/CommandInterpreter.cpp
  lldb/source/Interpreter/InterpreterProperties.td
  lldb/source/Interpreter/Properties.td
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/CMakeLists.txt
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernelProperties.td
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/Properties.td
  lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt
  lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
  lldb/source/Plugins/JITLoader/GDB/JITLoaderGDBProperties.td
  lldb/source/Plugins/JITLoader/GDB/Properties.td
  lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformMacOSXProperties.td
  lldb/source/Plugins/Platform/MacOSX/Properties.td
  lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
  lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDPProperties.td
  lldb/source/Plugins/Process/MacOSX-Kernel/Properties.td
  lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteProperties.td
  lldb/source/Plugins/Process/gdb-remote/Properties.td
  lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt
  lldb/source/Plugins/StructuredData/DarwinLog/Properties.td
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  
lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLogProperties.td
  lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  lldb/source/Plugins/SymbolFile/DWARF/Properties.td
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFProperties.td
  lldb/source/Target/CMakeLists.txt
  lldb/source/Target/Platform.cpp
  lldb/source/Target/Process.cpp
  lldb/source/Target/Properties.td
  lldb/source/Target/Target.cpp
  lldb/source/Target/TargetProperties.td
  lldb/source/Target/Thread.cpp

Index: lldb/source/Target/Thread.cpp
===
--- lldb/source/Target/Thread.cpp
+++ lldb/source/Target/Thread.cpp
@@ -65,12 +65,12 @@
 
 static constexpr PropertyDefinition g_properties[] = {
 #define LLDB_PROPERTIES_thread
-#include "Properties.inc"
+#include "TargetProperties.inc"
 };
 
 enum {
 #define LLDB_PROPERTIES_thread
-#include "PropertiesEnum.inc"
+#include "TargetPropertiesEnum.inc"
 };
 
 class ThreadOptionValueProperties : public OptionValueProperties {
Index: lldb/source/Target/Properties.td
===
--- /dev/null
+++ lldb/source/Target/Properties.td
@@ -1,234 +0,0 @@
-include "../../include/lldb/Core/PropertiesBase.td"
-
-let Definition = "experimental" in {
-  def InjectLocalVars : Property<"inject-local-vars", "Boolean">,
-Global, DefaultTrue,
-Desc<"If true, inject local variables explicitly into the expression text. This will fix symbol resolution when there are name collisions between ivars and local variables. But it can make expressions run much more slowly.">;
-  def UseModernTypeLookup : Property<"use-modern-type-lookup", "Boolean">,
-Global, DefaultFalse,
-Desc<"If true, use Clang's modern type lookup infrastructure.">;
-}
-
-let Definition = "target" in {
-  def DefaultArch: Property<"default-arch", "Arch">,
-Global,
-DefaultStringValue<"">,
-Desc<"Default architecture to choose, when there's a choice.">;
-  def MoveToNearestCode: Property<"move-to-nearest-code", "Boolean">,
-DefaultTrue,
-Desc<"Move breakpoints to nearest code.">;
-  def Language: Property<"language", "Language">,
-DefaultEnumValue<"eLanguageTypeUnknown">,
-Desc<"The language to use when interpreting expressions entered in commands.">;
-  def ExprPrefix: Property<"expr-prefix", "FileSpec">,
-DefaultStringValue<"">,
-Desc<"Path to a file containing expressions to be prepended to all expressions.">;
-  def PreferDynamic: Property<"prefer-dynamic-value", "Enum">,
-DefaultEnumValue<"eDynamicDontRunTarget">,
-EnumValues<"OptionEnumValues(g_dynamic_value_types)">,
-Desc<"Should printed values be shown as their dynamic value.">;
-  def EnableSynthetic: Property<"enable-synthetic-value", "Boolean">,
-DefaultTrue,
-Desc<"Should synthetic values be used by default whenever available.">;
-  def Sk

[Lldb-commits] [PATCH] D65397: Qualify includes of Properties[Enum].inc files. NFC

2019-07-29 Thread Sam McCall via Phabricator via lldb-commits
sammccall added a comment.

In D65397#1604416 , @labath wrote:

> I am not sure about the consistency argument (on the other CL), as it seems 
> to me that most/all llvm .inc files *which are produced by tblgen" are 
> included by via just their bare names. However, these files generally have 
> unique names, which is usually achieved by just embedding (a derivative of) 
> the folder name into the .inc file name (e.g. AArch64GenAsmWriter.inc, 
> AMDGPUGenAsmWriter.inc, ...). So, I think the most consistent approach here 
> would be to rename lldb files into something like `TargetProperties.inc`, 
> `CoreProperties.inc` etc.
>
> Consistency considerations aside, I do think that having a bunch of files 
> called `Properties.inc` is a bit confusing, and it would be good to 
> disambiguate between them. I'm fairly ambivalent about whether that is 
> achieved by prefixing the include directives with the folder name, or by 
> renaming the files so that they have unique names.


Fair enough, I've given them names that match the main file in that directory 
(thanks for pointing out this convention!).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65397



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


[Lldb-commits] [PATCH] D65397: Qualify includes of Properties[Enum].inc files. NFC

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

Thanks. This looks fine to me, and I think that the new file names fit pretty 
organically into the existing lldb conventions (as well as being mostly 
consistent with how llvm handles tablegened files).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65397



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


[Lldb-commits] [PATCH] D64995: [lldb] Fix crash when tab-completing in multi-line expr

2019-07-29 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.

Thanks. The test looks good to me. You might want to consider marking it as 
`NO_DEBUG_INFO_TESTCASE`.


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

https://reviews.llvm.org/D64995



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


[Lldb-commits] [PATCH] D62931: [lldb-server] Add setting to force 'g' packet use

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

Unfortunately this patch has raced with the latest tablegen changes, and it no 
longer applies cleanly. Could you please rebase on the current trunk?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62931



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


[Lldb-commits] [PATCH] D65271: Increase testsuite packet-timeout 5secs -> 1min

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

LGTM, thanks.

BTW, I was pretty much a python noob too when starting with lldb, but our test 
suite has forced me to become somewhat of an expert. :)




Comment at: lldb/tools/lldb-test/lldb-test.cpp:979
   ModuleList::GetGlobalModuleListProperties().SetEnableExternalLookup(false);
+  // There is no SB API for settings in general like:
+  // GetGlobalPluginProperties()->SetPacketTimeout(std::chrono::seconds(60));

lldb-test is not confined by the SB API. The reason this (unlike the 
`symbols.enable-external-lookup` thingy) does not work is because 
ProcessGDBRemote is a plugin, and so the API to access the setting is hidden by 
the plugin encapsulation...


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65271



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


[Lldb-commits] [PATCH] D65330: [lldb][docs] Update documentation for monorepo and CMake caches

2019-07-29 Thread Stefan Gränitz via Phabricator via lldb-commits
sgraenitz added a comment.

Thanks for your feedback.

In D65330#1604355 , @labath wrote:

> lld is required for running the (dotest) test suite on windows. On other 
> platforms it is not required, but there are tests which will only get run if 
> lld is enabled.


I mentioned this in `Regular in-tree builds` as: //Parts of the LLDB test suite 
require `lld`. Add it to the list in order to run all tests.//




Comment at: lldb/docs/resources/build.rst:90
+
+  > git clone https://github.com/llvm/llvm-project.git
 

jryans wrote:
> This could be done in a separate patch, but I happened to notice that [Get 
> Involved section on the LLDB main 
> page](https://lldb.llvm.org/index.html#get-involved) currently suggests 
> Subversion at the moment. It would be nice to have this updated to Git as 
> well.
+1 (in a separate patch)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65330



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


[Lldb-commits] [PATCH] D65282: ObjectFileELF: permit thread-local sections with overlapping file addresses

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

Thanks for sharing your knowledge about linkers and dynamic loaders. I have 
found it very useful.


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

https://reviews.llvm.org/D65282



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


[Lldb-commits] [PATCH] D65330: [lldb][docs] Update documentation for monorepo and CMake caches

2019-07-29 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.

Thanks for putting this together.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65330



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


[Lldb-commits] [lldb] r367231 - SymbolVendor: Make SectionAddressesChanged a passthrough

2019-07-29 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Jul 29 08:53:36 2019
New Revision: 367231

URL: http://llvm.org/viewvc/llvm-project?rev=367231&view=rev
Log:
SymbolVendor: Make SectionAddressesChanged a passthrough

Summary:
This moves the implementation of the function into the SymbolFile class,
making it possible to excise the SymbolVendor passthrough functions in
follow-up patches.

Reviewers: clayborg, jingham, JDevlieghere

Subscribers: lldb-commits

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

Modified:
lldb/trunk/include/lldb/Symbol/SymbolFile.h
lldb/trunk/source/Symbol/SymbolFile.cpp
lldb/trunk/source/Symbol/SymbolVendor.cpp

Modified: lldb/trunk/include/lldb/Symbol/SymbolFile.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolFile.h?rev=367231&r1=367230&r2=367231&view=diff
==
--- lldb/trunk/include/lldb/Symbol/SymbolFile.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolFile.h Mon Jul 29 08:53:36 2019
@@ -212,6 +212,7 @@ public:
 
   ObjectFile *GetObjectFile() { return m_obj_file; }
   const ObjectFile *GetObjectFile() const { return m_obj_file; }
+  ObjectFile *GetMainObjectFile();
 
   virtual std::vector ParseCallEdgesInFunction(UserID func_id) {
 return {};
@@ -221,7 +222,7 @@ public:
 
   /// Notify the SymbolFile that the file addresses in the Sections
   /// for this module have been changed.
-  virtual void SectionFileAddressesChanged() {}
+  virtual void SectionFileAddressesChanged();
 
   struct RegisterInfoResolver {
 virtual ~RegisterInfoResolver(); // anchor

Modified: lldb/trunk/source/Symbol/SymbolFile.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolFile.cpp?rev=367231&r1=367230&r2=367231&view=diff
==
--- lldb/trunk/source/Symbol/SymbolFile.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolFile.cpp Mon Jul 29 08:53:36 2019
@@ -31,6 +31,9 @@ void SymbolFile::PreloadSymbols() {
 std::recursive_mutex &SymbolFile::GetModuleMutex() const {
   return GetObjectFile()->GetModule()->GetMutex();
 }
+ObjectFile *SymbolFile::GetMainObjectFile() {
+  return m_obj_file->GetModule()->GetObjectFile();
+}
 
 SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) {
   std::unique_ptr best_symfile_up;
@@ -206,7 +209,7 @@ Symtab *SymbolFile::GetSymtab() {
 return m_symtab;
 
   // Fetch the symtab from the main object file.
-  m_symtab = m_obj_file->GetModule()->GetObjectFile()->GetSymtab();
+  m_symtab = GetMainObjectFile()->GetSymtab();
 
   // Then add our symbols to it.
   if (m_symtab)
@@ -215,6 +218,15 @@ Symtab *SymbolFile::GetSymtab() {
   return m_symtab;
 }
 
+void SymbolFile::SectionFileAddressesChanged() {
+  ObjectFile *module_objfile = GetMainObjectFile();
+  ObjectFile *symfile_objfile = GetObjectFile();
+  if (symfile_objfile != module_objfile)
+symfile_objfile->SectionFileAddressesChanged();
+  if (m_symtab)
+m_symtab->SectionFileAddressesChanged();
+}
+
 void SymbolFile::Dump(Stream &s) {
   s.PutCString("Types:\n");
   m_type_list.Dump(&s, /*show_context*/ false);

Modified: lldb/trunk/source/Symbol/SymbolVendor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolVendor.cpp?rev=367231&r1=367230&r2=367231&view=diff
==
--- lldb/trunk/source/Symbol/SymbolVendor.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolVendor.cpp Mon Jul 29 08:53:36 2019
@@ -390,19 +390,8 @@ Symtab *SymbolVendor::GetSymtab() {
 }
 
 void SymbolVendor::SectionFileAddressesChanged() {
-  ModuleSP module_sp(GetModule());
-  if (module_sp) {
-ObjectFile *module_objfile = module_sp->GetObjectFile();
-if (m_sym_file_up) {
-  ObjectFile *symfile_objfile = m_sym_file_up->GetObjectFile();
-  if (symfile_objfile != module_objfile)
-symfile_objfile->SectionFileAddressesChanged();
-}
-Symtab *symtab = GetSymtab();
-if (symtab) {
-  symtab->SectionFileAddressesChanged();
-}
-  }
+  if (m_sym_file_up)
+m_sym_file_up->SectionFileAddressesChanged();
 }
 
 // PluginInterface protocol


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


[Lldb-commits] [PATCH] D65266: SymbolVendor: Make SectionAddressesChanged a passthrough

2019-07-29 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367231: SymbolVendor: Make SectionAddressesChanged a 
passthrough (authored by labath, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65266

Files:
  lldb/trunk/include/lldb/Symbol/SymbolFile.h
  lldb/trunk/source/Symbol/SymbolFile.cpp
  lldb/trunk/source/Symbol/SymbolVendor.cpp


Index: lldb/trunk/source/Symbol/SymbolVendor.cpp
===
--- lldb/trunk/source/Symbol/SymbolVendor.cpp
+++ lldb/trunk/source/Symbol/SymbolVendor.cpp
@@ -390,19 +390,8 @@
 }
 
 void SymbolVendor::SectionFileAddressesChanged() {
-  ModuleSP module_sp(GetModule());
-  if (module_sp) {
-ObjectFile *module_objfile = module_sp->GetObjectFile();
-if (m_sym_file_up) {
-  ObjectFile *symfile_objfile = m_sym_file_up->GetObjectFile();
-  if (symfile_objfile != module_objfile)
-symfile_objfile->SectionFileAddressesChanged();
-}
-Symtab *symtab = GetSymtab();
-if (symtab) {
-  symtab->SectionFileAddressesChanged();
-}
-  }
+  if (m_sym_file_up)
+m_sym_file_up->SectionFileAddressesChanged();
 }
 
 // PluginInterface protocol
Index: lldb/trunk/source/Symbol/SymbolFile.cpp
===
--- lldb/trunk/source/Symbol/SymbolFile.cpp
+++ lldb/trunk/source/Symbol/SymbolFile.cpp
@@ -31,6 +31,9 @@
 std::recursive_mutex &SymbolFile::GetModuleMutex() const {
   return GetObjectFile()->GetModule()->GetMutex();
 }
+ObjectFile *SymbolFile::GetMainObjectFile() {
+  return m_obj_file->GetModule()->GetObjectFile();
+}
 
 SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) {
   std::unique_ptr best_symfile_up;
@@ -206,7 +209,7 @@
 return m_symtab;
 
   // Fetch the symtab from the main object file.
-  m_symtab = m_obj_file->GetModule()->GetObjectFile()->GetSymtab();
+  m_symtab = GetMainObjectFile()->GetSymtab();
 
   // Then add our symbols to it.
   if (m_symtab)
@@ -215,6 +218,15 @@
   return m_symtab;
 }
 
+void SymbolFile::SectionFileAddressesChanged() {
+  ObjectFile *module_objfile = GetMainObjectFile();
+  ObjectFile *symfile_objfile = GetObjectFile();
+  if (symfile_objfile != module_objfile)
+symfile_objfile->SectionFileAddressesChanged();
+  if (m_symtab)
+m_symtab->SectionFileAddressesChanged();
+}
+
 void SymbolFile::Dump(Stream &s) {
   s.PutCString("Types:\n");
   m_type_list.Dump(&s, /*show_context*/ false);
Index: lldb/trunk/include/lldb/Symbol/SymbolFile.h
===
--- lldb/trunk/include/lldb/Symbol/SymbolFile.h
+++ lldb/trunk/include/lldb/Symbol/SymbolFile.h
@@ -212,6 +212,7 @@
 
   ObjectFile *GetObjectFile() { return m_obj_file; }
   const ObjectFile *GetObjectFile() const { return m_obj_file; }
+  ObjectFile *GetMainObjectFile();
 
   virtual std::vector ParseCallEdgesInFunction(UserID func_id) {
 return {};
@@ -221,7 +222,7 @@
 
   /// Notify the SymbolFile that the file addresses in the Sections
   /// for this module have been changed.
-  virtual void SectionFileAddressesChanged() {}
+  virtual void SectionFileAddressesChanged();
 
   struct RegisterInfoResolver {
 virtual ~RegisterInfoResolver(); // anchor


Index: lldb/trunk/source/Symbol/SymbolVendor.cpp
===
--- lldb/trunk/source/Symbol/SymbolVendor.cpp
+++ lldb/trunk/source/Symbol/SymbolVendor.cpp
@@ -390,19 +390,8 @@
 }
 
 void SymbolVendor::SectionFileAddressesChanged() {
-  ModuleSP module_sp(GetModule());
-  if (module_sp) {
-ObjectFile *module_objfile = module_sp->GetObjectFile();
-if (m_sym_file_up) {
-  ObjectFile *symfile_objfile = m_sym_file_up->GetObjectFile();
-  if (symfile_objfile != module_objfile)
-symfile_objfile->SectionFileAddressesChanged();
-}
-Symtab *symtab = GetSymtab();
-if (symtab) {
-  symtab->SectionFileAddressesChanged();
-}
-  }
+  if (m_sym_file_up)
+m_sym_file_up->SectionFileAddressesChanged();
 }
 
 // PluginInterface protocol
Index: lldb/trunk/source/Symbol/SymbolFile.cpp
===
--- lldb/trunk/source/Symbol/SymbolFile.cpp
+++ lldb/trunk/source/Symbol/SymbolFile.cpp
@@ -31,6 +31,9 @@
 std::recursive_mutex &SymbolFile::GetModuleMutex() const {
   return GetObjectFile()->GetModule()->GetMutex();
 }
+ObjectFile *SymbolFile::GetMainObjectFile() {
+  return m_obj_file->GetModule()->GetObjectFile();
+}
 
 SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) {
   std::unique_ptr best_symfile_up;
@@ -206,7 +209,7 @@
 return m_symtab;
 
   // Fetch the symtab from the main object file.
-  m_symtab = m_obj_file->GetModule()->GetObjectFile()->GetSymtab();
+  m_symtab = GetMainObjectFile()->GetSymtab

[Lldb-commits] [PATCH] D65271: Increase testsuite packet-timeout 5secs -> 1min

2019-07-29 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil marked 2 inline comments as done.
jankratochvil added inline comments.



Comment at: lldb/tools/lldb-test/lldb-test.cpp:979
   ModuleList::GetGlobalModuleListProperties().SetEnableExternalLookup(false);
+  // There is no SB API for settings in general like:
+  // GetGlobalPluginProperties()->SetPacketTimeout(std::chrono::seconds(60));

labath wrote:
> lldb-test is not confined by the SB API. The reason this (unlike the 
> `symbols.enable-external-lookup` thingy) does not work is because 
> ProcessGDBRemote is a plugin, and so the API to access the setting is hidden 
> by the plugin encapsulation...
Thanks for the explanation; still SB API could provide some function to lookup 
the plugin by its name to access its settings etc. I have rather deleted the 
comment there.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65271



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


[Lldb-commits] [lldb] r367234 - [lldb] Increase testsuite packet-timeout 5secs -> 1min

2019-07-29 Thread Jan Kratochvil via lldb-commits
Author: jankratochvil
Date: Mon Jul 29 09:10:16 2019
New Revision: 367234

URL: http://llvm.org/viewvc/llvm-project?rev=367234&view=rev
Log:
[lldb] Increase testsuite packet-timeout 5secs -> 1min

rL357954 did increase `packet-timeout` 1sec -> 5secs. Which is IMO about the
maximum timeout reasonable for regular use. But for testsuite I think the
timeout should be higher as the testsuite runs in parallel and it can be run
even on slow hosts and with other load (moreover if it runs on some slow arch).

I have chosen 60 secs, that should be enough hopefully.  Larger value could
make debugging with hanging `lldb-server` annoying.

This patch was based on this testsuite timeout:
http://lab.llvm.org:8014/builders/lldb-x86_64-fedora/builds/546/steps/test/logs/stdio
FAIL: test_connect (TestGDBRemoteClient.TestGDBRemoteClient)
   Test connecting to a remote gdb server
--
Traceback (most recent call last):
  File 
"/home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteClient.py",
 line 13, in test_connect
process = self.connect(target)
  File 
"/home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py",
 line 480, in connect
self.assertTrue(error.Success(), error.description)
AssertionError: False is not True : failed to get reply to handshake 
packet

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

Modified:
lldb/trunk/lit/lit-lldb-init.in

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/lit/lit-lldb-init.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit-lldb-init.in?rev=367234&r1=367233&r2=367234&view=diff
==
--- lldb/trunk/lit/lit-lldb-init.in (original)
+++ lldb/trunk/lit/lit-lldb-init.in Mon Jul 29 09:10:16 2019
@@ -1,3 +1,4 @@
 # LLDB init file for the LIT tests.
 settings set symbols.enable-external-lookup false
+settings set plugin.process.gdb-remote.packet-timeout 60
 settings set interpreter.echo-comment-commands false

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template?rev=367234&r1=367233&r2=367234&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template 
Mon Jul 29 09:10:16 2019
@@ -32,6 +32,8 @@ int main(int argc, char** argv) {
   SBDebugger::Initialize();
   SBDebugger dbg = SBDebugger::Create();
   dbg.HandleCommand("settings set symbols.enable-external-lookup false");
+  dbg.HandleCommand(
+  "settings set plugin.process.gdb-remote.packet-timeout 60");
 
   try {
 if (!dbg.IsValid())

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py?rev=367234&r1=367233&r2=367234&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
 Mon Jul 29 09:10:16 2019
@@ -21,6 +21,7 @@ class TestNoWatchpointSupportInfo(GDBRem
 def threadStopInfo(self, threadnum):
 if threadnum == 0x1ff0d:
 return "T02thread:1ff0d;thread-pcs:10001bc00;"
+return ""
 
 def setBreakpoint(self, packet):
 if packet.startswith("Z2,"):

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=367234&r1=367233&r2=367234&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py 

[Lldb-commits] [PATCH] D65401: SymbolVendor: Remove the object file member variable

2019-07-29 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: JDevlieghere, clayborg, jingham.
labath added a parent revision: D65329: SymbolVendor: Move locking into the 
Symbol Files.

The last responsibility of the SymbolVendor was to hold an owning
reference to the object file (in case symbols are being read from a
different file than the main module). As SymbolFile classes already hold
a non-owning reference to the object file, we can easily remove this
responsibility of the SymbolVendor by making the SymbolFile reference
owning.


https://reviews.llvm.org/D65401

Files:
  include/lldb/Symbol/SymbolFile.h
  include/lldb/Symbol/SymbolVendor.h
  include/lldb/lldb-private-interfaces.h
  source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
  source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
  source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
  source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
  source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
  source/Symbol/SymbolFile.cpp
  source/Symbol/SymbolVendor.cpp

Index: source/Symbol/SymbolVendor.cpp
===
--- source/Symbol/SymbolVendor.cpp
+++ source/Symbol/SymbolVendor.cpp
@@ -68,10 +68,8 @@
   ModuleSP module_sp(GetModule());
   if (module_sp) {
 std::lock_guard guard(module_sp->GetMutex());
-if (objfile_sp) {
-  m_objfile_sp = objfile_sp;
-  m_sym_file_up.reset(SymbolFile::FindPlugin(objfile_sp.get()));
-}
+if (objfile_sp)
+  m_sym_file_up.reset(SymbolFile::FindPlugin(objfile_sp));
   }
 }
 
Index: source/Symbol/SymbolFile.cpp
===
--- source/Symbol/SymbolFile.cpp
+++ source/Symbol/SymbolFile.cpp
@@ -32,23 +32,23 @@
   return GetObjectFile()->GetModule()->GetMutex();
 }
 ObjectFile *SymbolFile::GetMainObjectFile() {
-  return m_obj_file->GetModule()->GetObjectFile();
+  return m_objfile_sp->GetModule()->GetObjectFile();
 }
 
-SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) {
+SymbolFile *SymbolFile::FindPlugin(ObjectFileSP objfile_sp) {
   std::unique_ptr best_symfile_up;
-  if (obj_file != nullptr) {
+  if (objfile_sp != nullptr) {
 
 // We need to test the abilities of this section list. So create what it
-// would be with this new obj_file.
-lldb::ModuleSP module_sp(obj_file->GetModule());
+// would be with this new objfile_sp.
+lldb::ModuleSP module_sp(objfile_sp->GetModule());
 if (module_sp) {
   // Default to the main module section list.
   ObjectFile *module_obj_file = module_sp->GetObjectFile();
-  if (module_obj_file != obj_file) {
+  if (module_obj_file != objfile_sp.get()) {
 // Make sure the main object file's sections are created
 module_obj_file->GetSectionList();
-obj_file->CreateSections(*module_sp->GetUnifiedSectionList());
+objfile_sp->CreateSections(*module_sp->GetUnifiedSectionList());
   }
 }
 
@@ -62,7 +62,7 @@
  (create_callback = PluginManager::GetSymbolFileCreateCallbackAtIndex(
   idx)) != nullptr;
  ++idx) {
-  std::unique_ptr curr_symfile_up(create_callback(obj_file));
+  std::unique_ptr curr_symfile_up(create_callback(objfile_sp));
 
   if (curr_symfile_up) {
 const uint32_t sym_file_abilities = curr_symfile_up->GetAbilities();
@@ -87,7 +87,7 @@
 
 TypeSystem *SymbolFile::GetTypeSystemForLanguage(lldb::LanguageType language) {
   TypeSystem *type_system =
-  m_obj_file->GetModule()->GetTypeSystemForLanguage(language);
+  m_objfile_sp->GetModule()->GetTypeSystemForLanguage(language);
   if (type_system)
 type_system->SetSymbolFile(this);
   return type_system;
Index: source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
===
--- source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
+++ source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
@@ -18,7 +18,7 @@
 class SymbolFileSymtab : public lldb_private::SymbolFile {
 public:
   // Constructors and Destructors
-  SymbolFileSymtab(lldb_private::ObjectFile *obj_file);
+  SymbolFileSymtab(lldb::ObjectFileSP objfile_sp);
 
   ~SymbolFileSymtab() override;
 
@@ -32,7 +32,7 @@
   static const char *GetPluginDescriptionStatic();
 
   static lldb_private::SymbolFile *
-  CreateInstance(lldb_private::ObjectFile *obj_file);
+  CreateInstance(lldb::ObjectFileSP objfile_sp);
 
   uint32_t CalculateAbilities() override;
 
Index: sour

[Lldb-commits] [PATCH] D65271: Increase testsuite packet-timeout 5secs -> 1min

2019-07-29 Thread Jan Kratochvil via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
jankratochvil marked an inline comment as done.
Closed by commit rL367234: [lldb] Increase testsuite packet-timeout 5secs -> 
1min (authored by jankratochvil, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65271?vs=211973&id=212178#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65271

Files:
  lldb/trunk/lit/lit-lldb-init.in
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
  lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
  
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
  lldb/trunk/tools/lldb-test/lldb-test.cpp

Index: lldb/trunk/tools/lldb-test/lldb-test.cpp
===
--- lldb/trunk/tools/lldb-test/lldb-test.cpp
+++ lldb/trunk/tools/lldb-test/lldb-test.cpp
@@ -976,6 +976,10 @@
 
   auto Dbg = lldb_private::Debugger::CreateInstance();
   ModuleList::GetGlobalModuleListProperties().SetEnableExternalLookup(false);
+  CommandReturnObject Result;
+  Dbg->GetCommandInterpreter().HandleCommand(
+  "settings set plugin.process.gdb-remote.packet-timeout 60",
+  /*add_to_history*/ eLazyBoolNo, Result);
 
   if (!opts::Log.empty())
 Dbg->EnableLog("lldb", {"all"}, opts::Log, 0, errs());
Index: lldb/trunk/lit/lit-lldb-init.in
===
--- lldb/trunk/lit/lit-lldb-init.in
+++ lldb/trunk/lit/lit-lldb-init.in
@@ -1,3 +1,4 @@
 # LLDB init file for the LIT tests.
 settings set symbols.enable-external-lookup false
+settings set plugin.process.gdb-remote.packet-timeout 60
 settings set interpreter.echo-comment-commands false
Index: lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
===
--- lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
+++ lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
@@ -32,6 +32,8 @@
   SBDebugger::Initialize();
   SBDebugger dbg = SBDebugger::Create();
   dbg.HandleCommand("settings set symbols.enable-external-lookup false");
+  dbg.HandleCommand(
+  "settings set plugin.process.gdb-remote.packet-timeout 60");
 
   try {
 if (!dbg.IsValid())
Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -696,6 +696,17 @@
 """Return absolute path to a file in the test's source directory."""
 return os.path.join(self.getSourceDir(), name)
 
+@staticmethod
+def setUpCommands():
+return [
+# Disable Spotlight lookup. The testsuite creates
+# different binaries with the same UUID, because they only
+# differ in the debug info, which is not being hashed.
+"settings set symbols.enable-external-lookup false",
+
+# Testsuite runs in parallel and the host can have also other load.
+"settings set plugin.process.gdb-remote.packet-timeout 60"]
+
 def setUp(self):
 """Fixture for unittest test case setup.
 
@@ -714,7 +725,8 @@
 else:
 self.lldbVSCodeExec = None
 
-self.lldbOption = "-o 'settings set symbols.enable-external-lookup false'"
+self.lldbOption = " ".join(
+"-o '" + s + "'" for s in self.setUpCommands())
 
 # If we spawn an lldb process for test (via pexpect), do not load the
 # init file unless told otherwise.
@@ -1854,10 +1866,8 @@
 self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
 % mod_cache)
 
-# Disable Spotlight lookup. The testsuite creates
-# different binaries with the same UUID, because they only
-# differ in the debug info, which is not being hashed.
-self.runCmd('settings set symbols.enable-external-lookup false')
+for s in self.setUpCommands():
+self.runCmd(s)
 
 # Disable color.
 self.runCmd("settings set use-color false")
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
@@ -21,6 +21,7 @@
   

[Lldb-commits] [lldb] r367238 - [lldb] Also include the array definition in Properties.inc

2019-07-29 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jul 29 09:41:30 2019
New Revision: 367238

URL: http://llvm.org/viewvc/llvm-project?rev=367238&view=rev
Log:
[lldb] Also include the array definition in Properties.inc

Right now our Properties.inc only generates the initializer for the
options list but not the array declaration boilerplate around it. As the
array definition is identical for all arrays, we might as well also let
the Properties.inc generate it alongside the initializers.

Unfortunately we cannot do the same for enums, as there's this magic
ePropertyExperimental, which needs to come at the end to be interpreted
correctly. Hopefully we can get rid of this in the future and do the
same for the property enums.

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

Modified:
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Core/ModuleList.cpp
lldb/trunk/source/Interpreter/CommandInterpreter.cpp
lldb/trunk/source/Interpreter/Properties.td

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/Target.cpp
lldb/trunk/source/Target/Thread.cpp
lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=367238&r1=367237&r2=367238&view=diff
==
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Mon Jul 29 09:41:30 2019
@@ -202,10 +202,8 @@ static constexpr OptionEnumValueElement
  "display thread stop locations."},
 {eStopShowColumnNone, "none", "Do not highlight the stop column."}};
 
-static constexpr PropertyDefinition g_properties[] = {
 #define LLDB_PROPERTIES_debugger
 #include "Properties.inc"
-};
 
 enum {
 #define LLDB_PROPERTIES_debugger
@@ -230,7 +228,7 @@ Status Debugger::SetPropertyValue(const
   Status error(Properties::SetPropertyValue(exe_ctx, op, property_path, 
value));
   if (error.Success()) {
 // FIXME it would be nice to have "on-change" callbacks for properties
-if (property_path == g_properties[ePropertyPrompt].name) {
+if (property_path == g_debugger_properties[ePropertyPrompt].name) {
   llvm::StringRef new_prompt = GetPrompt();
   std::string str = lldb_utility::ansi::FormatAnsiTerminalCodes(
   new_prompt, GetUseColor());
@@ -241,7 +239,7 @@ Status Debugger::SetPropertyValue(const
   auto prompt_change_event_sp = std::make_shared(
   CommandInterpreter::eBroadcastBitResetPrompt, bytes.release());
   GetCommandInterpreter().BroadcastEvent(prompt_change_event_sp);
-} else if (property_path == g_properties[ePropertyUseColor].name) {
+} else if (property_path == g_debugger_properties[ePropertyUseColor].name) 
{
   // use-color changed. Ping the prompt so it can reset the ansi terminal
   // codes.
   SetPrompt(GetPrompt());
@@ -272,7 +270,7 @@ Status Debugger::SetPropertyValue(const
 bool Debugger::GetAutoConfirm() const {
   const uint32_t idx = ePropertyAutoConfirm;
   return m_collection_sp->GetPropertyAtIndexAsBoolean(
-  nullptr, idx, g_properties[idx].default_uint_value != 0);
+  nullptr, idx, g_debugger_properties[idx].default_uint_value != 0);
 }
 
 const FormatEntity::Entry *Debugger::GetDisassemblyFormat() const {
@@ -293,13 +291,13 @@ const FormatEntity::Entry *Debugger::Get
 bool Debugger::GetNotifyVoid() const {
   const uint32_t idx = ePropertyNotiftVoid;
   return m_collection_sp->GetPropertyAtIndexAsBoolean(
-  nullptr, idx, g_properties[idx].default_uint_value != 0);
+  nullptr, idx, g_debugger_properties[idx].default_uint_value != 0);
 }
 
 llvm::StringRef Debugger::GetPrompt() const {
   const uint32_t idx = ePropertyPrompt;
   return m_collection_sp->GetPropertyAtIndexAsString(
-  nullptr, idx, g_properties[idx].default_cstr_value);
+  nullptr, idx, g_debugger_properties[idx].default_cstr_value);
 }
 
 void Debugger::SetPrompt(llvm::StringRef p) {
@@ -331,7 +329,7 @@ const FormatEntity::Entry *Debugger::Get
 lldb::ScriptLanguage Debugger::GetScriptLanguage() const {
   const uint32_t idx = ePropertyScriptLanguage;
   return 
(lldb::ScriptLanguage)m_collection_sp->GetPropertyAtIndexAsEnumeration(
-  nullptr, idx, g_properties[idx].default_uint_value);
+  nullptr, idx, g_debugger_properties[idx].default_uint_value);
 }
 
 bool Debugger::SetScriptLanguage(lldb::S

[Lldb-commits] [PATCH] D65353: [lldb] Also include the array definition in Properties.inc

2019-07-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367238: [lldb] Also include the array definition in 
Properties.inc (authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65353?vs=212013&id=212184#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65353

Files:
  lldb/trunk/source/Core/Debugger.cpp
  lldb/trunk/source/Core/ModuleList.cpp
  lldb/trunk/source/Interpreter/CommandInterpreter.cpp
  lldb/trunk/source/Interpreter/Properties.td
  
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
  lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
  lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/trunk/source/Target/Platform.cpp
  lldb/trunk/source/Target/Process.cpp
  lldb/trunk/source/Target/Target.cpp
  lldb/trunk/source/Target/Thread.cpp
  lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp

Index: lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp
===
--- lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp
+++ lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp
@@ -124,8 +124,11 @@
   // user to define the macro for the options that are needed.
   OS << "// Property definitions for " << PropertyName << "\n";
   OS << "#ifdef " << NeededMacro << "\n";
+  OS << "static constexpr PropertyDefinition g_" << PropertyName
+ << "_properties[] = {\n";
   for (Record *R : PropertyRecords)
 emitProperty(R, OS);
+  OS << "};\n";
   // We undefine the macro for the user like Clang's include files are doing it.
   OS << "#undef " << NeededMacro << "\n";
   OS << "#endif // " << PropertyName << " Property\n\n";
Index: lldb/trunk/source/Core/Debugger.cpp
===
--- lldb/trunk/source/Core/Debugger.cpp
+++ lldb/trunk/source/Core/Debugger.cpp
@@ -202,10 +202,8 @@
  "display thread stop locations."},
 {eStopShowColumnNone, "none", "Do not highlight the stop column."}};
 
-static constexpr PropertyDefinition g_properties[] = {
 #define LLDB_PROPERTIES_debugger
 #include "Properties.inc"
-};
 
 enum {
 #define LLDB_PROPERTIES_debugger
@@ -230,7 +228,7 @@
   Status error(Properties::SetPropertyValue(exe_ctx, op, property_path, value));
   if (error.Success()) {
 // FIXME it would be nice to have "on-change" callbacks for properties
-if (property_path == g_properties[ePropertyPrompt].name) {
+if (property_path == g_debugger_properties[ePropertyPrompt].name) {
   llvm::StringRef new_prompt = GetPrompt();
   std::string str = lldb_utility::ansi::FormatAnsiTerminalCodes(
   new_prompt, GetUseColor());
@@ -241,7 +239,7 @@
   auto prompt_change_event_sp = std::make_shared(
   CommandInterpreter::eBroadcastBitResetPrompt, bytes.release());
   GetCommandInterpreter().BroadcastEvent(prompt_change_event_sp);
-} else if (property_path == g_properties[ePropertyUseColor].name) {
+} else if (property_path == g_debugger_properties[ePropertyUseColor].name) {
   // use-color changed. Ping the prompt so it can reset the ansi terminal
   // codes.
   SetPrompt(GetPrompt());
@@ -272,7 +270,7 @@
 bool Debugger::GetAutoConfirm() const {
   const uint32_t idx = ePropertyAutoConfirm;
   return m_collection_sp->GetPropertyAtIndexAsBoolean(
-  nullptr, idx, g_properties[idx].default_uint_value != 0);
+  nullptr, idx, g_debugger_properties[idx].default_uint_value != 0);
 }
 
 const FormatEntity::Entry *Debugger::GetDisassemblyFormat() const {
@@ -293,13 +291,13 @@
 bool Debugger::GetNotifyVoid() const {
   const uint32_t idx = ePropertyNotiftVoid;
   return m_collection_sp->GetPropertyAtIndexAsBoolean(
-  nullptr, idx, g_properties[idx].default_uint_value != 0);
+  nullptr, idx, g_debugger_properties[idx].default_uint_value != 0);
 }
 
 llvm::StringRef Debugger::GetPrompt() const {
   const uint32_t idx = ePropertyPrompt;
   return m_collection_sp->GetPropertyAtIndexAsString(
-  nullptr, idx, g_properties[idx].default_cstr_value);
+  nullptr, idx, g_debugger_properties[idx].default_cstr_value);
 }
 
 void Debugger::SetPrompt(llvm::StringRef p) {
@@ -331,7 +329,7 @@
 lldb::ScriptLanguage Debugger::GetScriptLanguage() const {
   const uint32_t idx = ePropertyScriptLanguage;
   return (lldb::ScriptLanguage)m_collection_sp->GetPropertyAtIndexAsEnumeration(
-  nullptr, idx, g_properties[idx].default_uint_value);
+  nullptr, idx, g_debugger_properties[idx].default_

[Lldb-commits] [lldb] r367241 - [lldb] Qualify includes of Properties[Enum].inc files. NFC

2019-07-29 Thread Jordan Rupprecht via lldb-commits
Author: rupprecht
Date: Mon Jul 29 10:22:10 2019
New Revision: 367241

URL: http://llvm.org/viewvc/llvm-project?rev=367241&view=rev
Log:
[lldb] Qualify includes of Properties[Enum].inc files. NFC

Summary:
This is a bit more explicit, and makes it possible to build LLDB without
varying the -I lines per-directory.
(The latter is useful because many build systems only allow this to be
configured per-library, and LLDB is insufficiently layered to be split into
multiple libraries on stricter build systems).

(My comment on D65185 has some more context)

Reviewers: JDevlieghere, labath, chandlerc, jdoerfert

Reviewed By: labath

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

Patch by Sam McCall!

Added:
lldb/trunk/source/Core/CoreProperties.td
lldb/trunk/source/Interpreter/InterpreterProperties.td

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernelProperties.td
lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDBProperties.td
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSXProperties.td
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDPProperties.td
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteProperties.td

lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLogProperties.td
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFProperties.td
lldb/trunk/source/Target/TargetProperties.td
Removed:
lldb/trunk/source/Core/Properties.td
lldb/trunk/source/Interpreter/Properties.td
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/Properties.td
lldb/trunk/source/Plugins/JITLoader/GDB/Properties.td
lldb/trunk/source/Plugins/Platform/MacOSX/Properties.td
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/Properties.td
lldb/trunk/source/Plugins/Process/gdb-remote/Properties.td
lldb/trunk/source/Plugins/StructuredData/DarwinLog/Properties.td
lldb/trunk/source/Plugins/SymbolFile/DWARF/Properties.td
lldb/trunk/source/Target/Properties.td
Modified:
lldb/trunk/source/Core/CMakeLists.txt
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Core/ModuleList.cpp
lldb/trunk/source/Interpreter/CMakeLists.txt
lldb/trunk/source/Interpreter/CommandInterpreter.cpp
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/CMakeLists.txt

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/trunk/source/Plugins/JITLoader/GDB/CMakeLists.txt
lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/CMakeLists.txt
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt

lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Target/CMakeLists.txt
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/Target.cpp
lldb/trunk/source/Target/Thread.cpp

Modified: lldb/trunk/source/Core/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CMakeLists.txt?rev=367241&r1=367240&r2=367241&view=diff
==
--- lldb/trunk/source/Core/CMakeLists.txt (original)
+++ lldb/trunk/source/Core/CMakeLists.txt Mon Jul 29 10:22:10 2019
@@ -1,9 +1,9 @@
-lldb_tablegen(Properties.inc -gen-lldb-property-defs
-  SOURCE Properties.td
+lldb_tablegen(CoreProperties.inc -gen-lldb-property-defs
+  SOURCE CoreProperties.td
   TARGET LLDBCorePropertiesGen)
 
-lldb_tablegen(PropertiesEnum.inc -gen-lldb-property-enum-defs
-  SOURCE Properties.td
+lldb_tablegen(CorePropertiesEnum.inc -gen-lldb-property-enum-defs
+  SOURCE CoreProperties.td
   TARGET LLDBCorePropertiesEnumGen)
 
 set(LLDB_CURSES_LIBS)

Added: lldb/trunk/source/Core/CoreProperties.td
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CoreProperties.td?rev=367241&view=auto
==
--- lldb/trunk/source/Core/CoreProperties.td (added)
+++ lldb/trunk/source/Core/CoreProperties.td Mon Jul 29 10:22:10 2019
@@ -0,0 +1,118 @@
+include "../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "modulelist" in {
+  def EnableExternalLookup: Property<"enable-external-lookup", "Boolean">,
+Global,
+DefaultTrue,
+Desc<"Control the use of external tools and repositories to locate symbol 
files. Directories listed in targe

[Lldb-commits] [PATCH] D65330: [lldb][docs] Update documentation for monorepo and CMake caches

2019-07-29 Thread Stella Stamenova via Phabricator via lldb-commits
stella.stamenova accepted this revision.
stella.stamenova added a comment.

I think you need one small change for lld still - to make it clear that it is 
required on Windows in the Windows section, but it looks good otherwise. Please 
fix that before committing.




Comment at: lldb/docs/resources/build.rst:192
 
 Windows
+^^^

The windows section should include a similar note to the macOS section for 
libcxx - but for lld.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65330



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


[Lldb-commits] [PATCH] D65397: Qualify includes of Properties[Enum].inc files. NFC

2019-07-29 Thread Jordan Rupprecht via Phabricator via lldb-commits
rupprecht added a comment.

Committed this for you as r367241, including a rebase past r367238 (which I 
really hope I didn't mess up -- `ninja check-lldb` passed, at least).


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65397



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


[Lldb-commits] [PATCH] D65397: Qualify includes of Properties[Enum].inc files. NFC

2019-07-29 Thread Jordan Rupprecht via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367241: [lldb] Qualify includes of Properties[Enum].inc 
files. NFC (authored by rupprecht, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65397?vs=212167&id=212193#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65397

Files:
  lldb/trunk/source/Core/CMakeLists.txt
  lldb/trunk/source/Core/CoreProperties.td
  lldb/trunk/source/Core/Debugger.cpp
  lldb/trunk/source/Core/ModuleList.cpp
  lldb/trunk/source/Core/Properties.td
  lldb/trunk/source/Interpreter/CMakeLists.txt
  lldb/trunk/source/Interpreter/CommandInterpreter.cpp
  lldb/trunk/source/Interpreter/InterpreterProperties.td
  lldb/trunk/source/Interpreter/Properties.td
  lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/CMakeLists.txt
  
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernelProperties.td
  lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/Properties.td
  lldb/trunk/source/Plugins/JITLoader/GDB/CMakeLists.txt
  lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
  lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDBProperties.td
  lldb/trunk/source/Plugins/JITLoader/GDB/Properties.td
  lldb/trunk/source/Plugins/Platform/MacOSX/CMakeLists.txt
  lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
  lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSXProperties.td
  lldb/trunk/source/Plugins/Platform/MacOSX/Properties.td
  lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
  lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDPProperties.td
  lldb/trunk/source/Plugins/Process/MacOSX-Kernel/Properties.td
  lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteProperties.td
  lldb/trunk/source/Plugins/Process/gdb-remote/Properties.td
  lldb/trunk/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt
  lldb/trunk/source/Plugins/StructuredData/DarwinLog/Properties.td
  lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  
lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLogProperties.td
  lldb/trunk/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  lldb/trunk/source/Plugins/SymbolFile/DWARF/Properties.td
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFProperties.td
  lldb/trunk/source/Target/CMakeLists.txt
  lldb/trunk/source/Target/Platform.cpp
  lldb/trunk/source/Target/Process.cpp
  lldb/trunk/source/Target/Properties.td
  lldb/trunk/source/Target/Target.cpp
  lldb/trunk/source/Target/TargetProperties.td
  lldb/trunk/source/Target/Thread.cpp

Index: lldb/trunk/source/Core/CMakeLists.txt
===
--- lldb/trunk/source/Core/CMakeLists.txt
+++ lldb/trunk/source/Core/CMakeLists.txt
@@ -1,9 +1,9 @@
-lldb_tablegen(Properties.inc -gen-lldb-property-defs
-  SOURCE Properties.td
+lldb_tablegen(CoreProperties.inc -gen-lldb-property-defs
+  SOURCE CoreProperties.td
   TARGET LLDBCorePropertiesGen)
 
-lldb_tablegen(PropertiesEnum.inc -gen-lldb-property-enum-defs
-  SOURCE Properties.td
+lldb_tablegen(CorePropertiesEnum.inc -gen-lldb-property-enum-defs
+  SOURCE CoreProperties.td
   TARGET LLDBCorePropertiesEnumGen)
 
 set(LLDB_CURSES_LIBS)
Index: lldb/trunk/source/Core/CoreProperties.td
===
--- lldb/trunk/source/Core/CoreProperties.td
+++ lldb/trunk/source/Core/CoreProperties.td
@@ -0,0 +1,118 @@
+include "../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "modulelist" in {
+  def EnableExternalLookup: Property<"enable-external-lookup", "Boolean">,
+Global,
+DefaultTrue,
+Desc<"Control the use of external tools and repositories to locate symbol files. Directories listed in target.debug-file-search-paths and directory of the executable are always checked first for separate debug info files. Then depending on this setting: On macOS, Spotlight would be also used to locate a matching .dSYM bundle based on the UUID of the executable. On NetBSD, directory /usr/libdata/debug would be also searched. On platforms other than NetBSD directory /usr/lib/debug would be also searched.">;
+  def ClangModulesCachePath: Property<"clang-modules-cache-path", "FileSpec">,
+Global,
+DefaultStringValue<"">,
+Desc<"The path to the clang modules cache directory (-fmodules-cache-path).">;
+}
+
+let Definition = "debugger" in {
+  def AutoConfirm: Property<"auto-confirm", "Boolean">,
+  

[Lldb-commits] [PATCH] D65397: Qualify includes of Properties[Enum].inc files. NFC

2019-07-29 Thread Sam McCall via Phabricator via lldb-commits
sammccall added a comment.

Thanks @rupprecht!


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65397



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


[Lldb-commits] [PATCH] D65409: [ProcessWindows] Choose a register context file by prepocessor

2019-07-29 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha created this revision.
tatyana-krasnukha added reviewers: compnerd, labath.
tatyana-krasnukha added a project: LLDB.
Herald added subscribers: lldb-commits, mgorny.

Replaced Cmake option based check with the preprocessor macro as 
CMAKE_SYSTEM_PROCESSOR doesn't work as expected on Windows.

https://bugs.llvm.org/show_bug.cgi?id=42724


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D65409

Files:
  Common/CMakeLists.txt
  Common/x64/RegisterContextWindows_x64.cpp
  Common/x64/RegisterContextWindows_x64.h
  Common/x86/RegisterContextWindows_x86.cpp
  Common/x86/RegisterContextWindows_x86.h


Index: Common/x86/RegisterContextWindows_x86.h
===
--- Common/x86/RegisterContextWindows_x86.h
+++ Common/x86/RegisterContextWindows_x86.h
@@ -6,6 +6,8 @@
 //
 
//===--===//
 
+#if defined(__i386__) || defined(_M_IX86)
+
 #ifndef liblldb_RegisterContextWindows_x86_H_
 #define liblldb_RegisterContextWindows_x86_H_
 
@@ -45,3 +47,5 @@
 }
 
 #endif // #ifndef liblldb_RegisterContextWindows_x86_H_
+
+#endif // defined(__i386__) || defined(_M_IX86)
Index: Common/x86/RegisterContextWindows_x86.cpp
===
--- Common/x86/RegisterContextWindows_x86.cpp
+++ Common/x86/RegisterContextWindows_x86.cpp
@@ -6,6 +6,8 @@
 //
 
//===--===//
 
+#if defined(__i386__) || defined(_M_IX86)
+
 #include "lldb/Host/windows/HostThreadWindows.h"
 #include "lldb/Host/windows/windows.h"
 #include "lldb/Utility/RegisterValue.h"
@@ -282,3 +284,5 @@
   reg_value.SetUInt32(value);
   return true;
 }
+
+#endif // defined(__i386__) || defined(_M_IX86)
Index: Common/x64/RegisterContextWindows_x64.h
===
--- Common/x64/RegisterContextWindows_x64.h
+++ Common/x64/RegisterContextWindows_x64.h
@@ -6,6 +6,8 @@
 //
 
//===--===//
 
+#if defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || 
defined(_M_AMD64)
+
 #ifndef liblldb_RegisterContextWindows_x64_H_
 #define liblldb_RegisterContextWindows_x64_H_
 
@@ -41,3 +43,5 @@
 }
 
 #endif // #ifndef liblldb_RegisterContextWindows_x64_H_
+
+#endif // defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || 
defined(_M_AMD64)
Index: Common/x64/RegisterContextWindows_x64.cpp
===
--- Common/x64/RegisterContextWindows_x64.cpp
+++ Common/x64/RegisterContextWindows_x64.cpp
@@ -6,6 +6,8 @@
 //
 
//===--===//
 
+#if defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || 
defined(_M_AMD64)
+
 #include "lldb/Host/windows/HostThreadWindows.h"
 #include "lldb/Host/windows/windows.h"
 #include "lldb/Utility/RegisterValue.h"
@@ -534,3 +536,5 @@
   return ::SetThreadContext(
   wthread.GetHostThread().GetNativeThread().GetSystemHandle(), &m_context);
 }
+
+#endif // defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || 
defined(_M_AMD64)
Index: Common/CMakeLists.txt
===
--- Common/CMakeLists.txt
+++ Common/CMakeLists.txt
@@ -22,11 +22,7 @@
   )
 
 # TODO add support for ARM (NT) and ARM64
-# TODO build these unconditionally as we cannot do cross-debugging or WoW
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
-  target_sources(lldbPluginProcessWindowsCommon PRIVATE
-x64/RegisterContextWindows_x64.cpp)
-elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i?86|X86")
-  target_sources(lldbPluginProcessWindowsCommon PRIVATE
-x86/RegisterContextWindows_x86.cpp)
-endif()
+target_sources(lldbPluginProcessWindowsCommon PRIVATE
+  x64/RegisterContextWindows_x64.cpp)
+target_sources(lldbPluginProcessWindowsCommon PRIVATE
+  x86/RegisterContextWindows_x86.cpp)


Index: Common/x86/RegisterContextWindows_x86.h
===
--- Common/x86/RegisterContextWindows_x86.h
+++ Common/x86/RegisterContextWindows_x86.h
@@ -6,6 +6,8 @@
 //
 //===--===//
 
+#if defined(__i386__) || defined(_M_IX86)
+
 #ifndef liblldb_RegisterContextWindows_x86_H_
 #define liblldb_RegisterContextWindows_x86_H_
 
@@ -45,3 +47,5 @@
 }
 
 #endif // #ifndef liblldb_RegisterContextWindows_x86_H_
+
+#endif // defined(__i386__) || defined(_M_IX86)
Index: Common/x86/RegisterContextWindows_x86.cpp
===
--- Common/x86/RegisterContextWindows_x86.cpp
+++ Common/x86/RegisterContextWindows_x86.cpp
@@ -6,6 +6,8 @@
 //
 //===--===//
 
+#if defined(__i386__) || defined(_M_IX86)
+
 #include "lldb/Host/wind

[Lldb-commits] [PATCH] D65409: [ProcessWindows] Choose a register context file by prepocessor

2019-07-29 Thread Dávid Bolvanský via Phabricator via lldb-commits
xbolva00 added inline comments.



Comment at: Common/CMakeLists.txt:25
 # TODO add support for ARM (NT) and ARM64
-# TODO build these unconditionally as we cannot do cross-debugging or WoW
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
-  target_sources(lldbPluginProcessWindowsCommon PRIVATE
-x64/RegisterContextWindows_x64.cpp)
-elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i?86|X86")
-  target_sources(lldbPluginProcessWindowsCommon PRIVATE
-x86/RegisterContextWindows_x86.cpp)
-endif()
+target_sources(lldbPluginProcessWindowsCommon PRIVATE
+  x64/RegisterContextWindows_x64.cpp)

Maybe add FIXME or TODO to revisit state of 
https://gitlab.kitware.com/cmake/cmake/issues/15170 ?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65409



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


[Lldb-commits] [PATCH] D65329: SymbolVendor: Move locking into the Symbol Files

2019-07-29 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

We will need to watch future submissions closely as this increases the chance 
that someone will extend a SymbolFile by overriding a virtual function and 
forget to lock.


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

https://reviews.llvm.org/D65329



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


[Lldb-commits] [PATCH] D65409: [ProcessWindows] Choose a register context file by prepocessor

2019-07-29 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha added inline comments.



Comment at: Common/CMakeLists.txt:25
 # TODO add support for ARM (NT) and ARM64
-# TODO build these unconditionally as we cannot do cross-debugging or WoW
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
-  target_sources(lldbPluginProcessWindowsCommon PRIVATE
-x64/RegisterContextWindows_x64.cpp)
-elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i?86|X86")
-  target_sources(lldbPluginProcessWindowsCommon PRIVATE
-x86/RegisterContextWindows_x86.cpp)
-endif()
+target_sources(lldbPluginProcessWindowsCommon PRIVATE
+  x64/RegisterContextWindows_x64.cpp)

xbolva00 wrote:
> Maybe add FIXME or TODO to revisit state of 
> https://gitlab.kitware.com/cmake/cmake/issues/15170 ?
I'm not sure we should rollback to that approach also due to the comment

> `# TODO build these unconditionally as we cannot do cross-debugging or WoW`




Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65409



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


[Lldb-commits] [PATCH] D62931: [lldb-server] Add setting to force 'g' packet use

2019-07-29 Thread Guilherme Andrade via Phabricator via lldb-commits
guiandrade updated this revision to Diff 212200.
guiandrade added a comment.

Adding support for tablegen generated properties introduced in 
https://reviews.llvm.org/D65185


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62931

Files:
  
lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteClient.py
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteProperties.td
  lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
  lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

Index: lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
===
--- lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -128,6 +128,12 @@
   ASSERT_EQ(0,
 memcmp(buffer_sp->GetBytes(), one_register, sizeof one_register));
 
+  async_result = std::async(std::launch::async,
+[&] { return client.GetgPacketSupported(tid); });
+  Handle_QThreadSuffixSupported(server, true);
+  HandlePacket(server, "g;thread:0047;", all_registers_hex);
+  ASSERT_TRUE(async_result.get());
+
   read_result = std::async(std::launch::async,
[&] { return client.ReadAllRegisters(tid); });
   HandlePacket(server, "g;thread:0047;", all_registers_hex);
Index: lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
@@ -301,10 +301,13 @@
 if (process_sp) {
   ProcessGDBRemote *gdb_process =
   static_cast(process_sp.get());
-  // read_all_registers_at_once will be true if 'p' packet is not
-  // supported.
+  // read_all_registers_at_once will be true if the server supports 'g'
+  // packet and either the flag gdb_process->m_use_g_packet is true or 'p'
+  // packet is not supported.
   bool read_all_registers_at_once =
-  !gdb_process->GetGDBRemote().GetpPacketSupported(GetID());
+  gdb_process->GetGDBRemote().GetgPacketSupported(GetID()) &&
+  (gdb_process->m_use_g_packet ||
+   !gdb_process->GetGDBRemote().GetpPacketSupported(GetID()));
   reg_ctx_sp = std::make_shared(
   *this, concrete_frame_idx, gdb_process->m_register_info,
   read_all_registers_at_once);
Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteProperties.td
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteProperties.td
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteProperties.td
@@ -13,4 +13,8 @@
 Global,
 DefaultFalse,
 Desc<"If true, the libraries-svr4 feature will be used to get a hold of the process's loaded modules.">;
+  def UseGPacket: Property<"use-g-packet", "Boolean">,
+Global,
+DefaultTrue,
+Desc<"Specify if the server should use 'g' packets.">;
 }
Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -283,6 +283,7 @@
   lldb::CommandObjectSP m_command_sp;
   int64_t m_breakpoint_pc_offset;
   lldb::tid_t m_initial_tid; // The initial thread ID, given by stub on attach
+  bool m_use_g_packet;
 
   bool m_replay_mode;
   bool m_allow_flash_writes;
Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -153,6 +153,11 @@
 nullptr, idx,
 g_processgdbremote_properties[idx].default_uint_value != 0);
   }
+
+  bool GetUseGPacket() const {
+const uint32_t idx = ePropertyUseGPacket;
+return m_collection_sp->GetPropertyAtIndexAsBoolean(nullptr, idx, true);
+  }
 };
 
 typedef std::shared_ptr ProcessKDPPropertiesSP;
@@ -347,6 +352,8 @@
   GetGlobalPluginProperties()->GetPacketTimeout();
   if (timeout_seconds > 0)
 m_gdb_comm.SetPacketTimeout(std::chrono::seconds(timeout_seconds));
+
+  m_use_g_packet = GetGlobalPluginProperties()->GetUseGPacket();
 }
 
 // Destructor
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
==

[Lldb-commits] [PATCH] D65401: SymbolVendor: Remove the object file member variable

2019-07-29 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

So previously the SymbolVendor would only make a strong reference to the object 
file if it didn't match the object file of the module. Now it always makes one. 
Might be ok since the Module owns the SymbolVendor and thus owns the 
SymbolFile. We should make sure we don't end up keeping an object file alive 
when a module goes away due to multiple strong references. I am guessing it 
will be ok, but good to verify.


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

https://reviews.llvm.org/D65401



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


[Lldb-commits] [PATCH] D65129: Test load unloading of modules with libraries-svr4

2019-07-29 Thread António Afonso via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367247: Test load unloading of modules with libraries-svr4 
(authored by aadsm, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65129?vs=211242&id=212202#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65129

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py


Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
@@ -93,6 +93,13 @@
 "Unable copy 'libloadunload_d.so' to '%s'.\n>>> %s" %
 (wd, err.GetCString()))
 
+def setSvr4Support(self, enabled):
+self.runCmd(
+"settings set plugin.process.gdb-remote.use-libraries-svr4 
{enabled}".format(
+enabled="true" if enabled else "false"
+)
+)
+
 # libloadunload_d.so does not appear in the image list because executable
 # dependencies are resolved relative to the debuggers PWD. Bug?
 @expectedFailureAll(oslist=["linux"])
@@ -224,6 +231,20 @@
 @skipIfFreeBSD  # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase 
support
 @skipIfWindows  # Windows doesn't have dlopen and friends, dynamic 
libraries work differently
 def test_lldb_process_load_and_unload_commands(self):
+self.setSvr4Support(False)
+self.run_lldb_process_load_and_unload_commands()
+
+@expectedFailureAll(
+bugnumber="llvm.org/pr25805",
+hostoslist=["windows"],
+triple='.*-android')
+@skipIfFreeBSD  # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase 
support
+@skipIfWindows  # Windows doesn't have dlopen and friends, dynamic 
libraries work differently
+def test_lldb_process_load_and_unload_commands_with_svr4(self):
+self.setSvr4Support(True)
+self.run_lldb_process_load_and_unload_commands()
+
+def run_lldb_process_load_and_unload_commands(self):
 """Test that lldb process load/unload command work correctly."""
 self.copy_shlibs_to_remote()
 
@@ -295,6 +316,15 @@
 
 @skipIfFreeBSD  # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase 
support
 def test_load_unload(self):
+self.setSvr4Support(False)
+self.run_load_unload()
+
+@skipIfFreeBSD  # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase 
support
+def test_load_unload_with_svr4(self):
+self.setSvr4Support(True)
+self.run_load_unload()
+
+def run_load_unload(self):
 """Test breakpoint by name works correctly with dlopen'ing."""
 self.copy_shlibs_to_remote()
 
@@ -335,6 +365,16 @@
 @skipIfFreeBSD  # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase 
support
 @skipIfWindows  # Windows doesn't have dlopen and friends, dynamic 
libraries work differently
 def test_step_over_load(self):
+self.setSvr4Support(False)
+self.run_step_over_load()
+
+@skipIfFreeBSD  # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase 
support
+@skipIfWindows  # Windows doesn't have dlopen and friends, dynamic 
libraries work differently
+def test_step_over_load_with_svr4(self):
+self.setSvr4Support(True)
+self.run_step_over_load()
+
+def run_step_over_load(self):
 """Test stepping over code that loads a shared library works 
correctly."""
 self.copy_shlibs_to_remote()
 


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
@@ -93,6 +93,13 @@
 "Unable copy 'libloadunload_d.so' to '%s'.\n>>> %s" %
 (wd, err.GetCString()))
 
+def setSvr4Support(self, enabled):
+self.runCmd(
+"settings set plugin.process.gdb-remote.use-libraries-svr4 {enabled}".format(
+enabled="true" if enabled else "false"
+)
+)
+
 # libloadunload_d.so does not appear in the image list because executable
 # dependencies are resolved relative to the debuggers PWD. Bug?
 @expectedFailureAll(oslist=["linux"])
@@ -224,6 +231,20 @@
 @skipIfFreeBSD  # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
 @skipIfWindows  # Windows doesn't have dlopen and friends, dynamic libraries work differently
 def test_lldb_process_

[Lldb-commits] [PATCH] D65397: Qualify includes of Properties[Enum].inc files. NFC

2019-07-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

Thanks!


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65397



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


[Lldb-commits] [PATCH] D65386: [lldb][NFC] Use an enum instead of chars when handling options [WIP]

2019-07-29 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

It worries me a little bit that we are making it harder and harder to figure 
out "where does the option for "-t" get stored once this CommandObject's 
options have been parsed.  Can you show the steps I would have to go through to 
get from "-f" to OptionEnumSettingsSet::Force or whatever.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65386



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


[Lldb-commits] [PATCH] D65122: [Symbol] Use llvm::Expected when getting TypeSystems

2019-07-29 Thread Alex Langford via Phabricator via lldb-commits
xiaobai updated this revision to Diff 212210.
xiaobai added a comment.

Fix incorrect error logging pattern


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

https://reviews.llvm.org/D65122

Files:
  include/lldb/Core/Module.h
  include/lldb/Symbol/SymbolFile.h
  include/lldb/Symbol/TypeSystem.h
  include/lldb/Target/Target.h
  source/API/SBModule.cpp
  source/Breakpoint/Watchpoint.cpp
  source/Core/Module.cpp
  source/Core/ValueObjectRegister.cpp
  source/DataFormatters/VectorType.cpp
  source/Expression/Materializer.cpp
  source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  source/Plugins/Language/CPlusPlus/BlockPointer.cpp
  source/Plugins/Language/ObjC/CoreMedia.cpp
  source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
  source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
  source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h
  source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
  source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
  source/Symbol/SymbolFile.cpp
  source/Symbol/Type.cpp
  source/Symbol/TypeSystem.cpp
  source/Target/StackFrame.cpp
  source/Target/Target.cpp
  source/Target/ThreadPlanTracer.cpp
  tools/lldb-test/lldb-test.cpp

Index: tools/lldb-test/lldb-test.cpp
===
--- tools/lldb-test/lldb-test.cpp
+++ tools/lldb-test/lldb-test.cpp
@@ -528,10 +528,15 @@
   if (!symfile)
 return make_string_error("Module has no symbol file.");
 
-  auto clang_ast_ctx = llvm::dyn_cast_or_null(
-  symfile->GetTypeSystemForLanguage(eLanguageTypeC_plus_plus));
+  auto type_system_or_err =
+  symfile->GetTypeSystemForLanguage(eLanguageTypeC_plus_plus);
+  if (!type_system_or_err)
+return make_string_error("Can't retrieve ClangASTContext");
+
+  auto *clang_ast_ctx =
+  llvm::dyn_cast_or_null(&type_system_or_err.get());
   if (!clang_ast_ctx)
-return make_string_error("Can't retrieve Clang AST context.");
+return make_string_error("Retrieved TypeSystem was not a ClangASTContext");
 
   auto ast_ctx = clang_ast_ctx->getASTContext();
   if (!ast_ctx)
Index: source/Target/ThreadPlanTracer.cpp
===
--- source/Target/ThreadPlanTracer.cpp
+++ source/Target/ThreadPlanTracer.cpp
@@ -93,15 +93,20 @@
 
 TypeFromUser ThreadPlanAssemblyTracer::GetIntPointerType() {
   if (!m_intptr_type.IsValid()) {
-TargetSP target_sp(m_thread.CalculateTarget());
-if (target_sp) {
-  TypeSystem *type_system =
-  target_sp->GetScratchTypeSystemForLanguage(nullptr, eLanguageTypeC);
-  if (type_system)
-m_intptr_type =
-TypeFromUser(type_system->GetBuiltinTypeForEncodingAndBitSize(
+if (auto target_sp = m_thread.CalculateTarget()) {
+  auto type_system_or_err =
+  target_sp->GetScratchTypeSystemForLanguage(eLanguageTypeC);
+  if (auto err = type_system_or_err.takeError()) {
+LLDB_LOG_ERROR(
+lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_TYPES),
+std::move(err),
+"Unable to get integer pointer type from TypeSystem");
+  } else {
+m_intptr_type = TypeFromUser(
+type_system_or_err->GetBuiltinTypeForEncodingAndBitSize(
 eEncodingUint,
 target_sp->GetArchitecture().GetAddressByteSize() * 8));
+  }
 }
   }
   return m_intptr_type;
Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -2119,15 +2119,12 @@
 target->SetExecutableModule(exe_module_sp, eLoadDependentsYes);
 }
 
-TypeSystem *Target::GetScratchTypeSystemForLanguage(Status *error,
-lldb::LanguageType language,
-bool create_on_demand) {
+llvm::Expected
+Target::GetScratchTypeSystemForLanguage(lldb::LanguageType language,
+bool create_on_demand) {
   if (!m_valid)
-return nullptr;
-
-  if (error) {
-error->Clear();
-  }
+return llvm::make_error("Invalid Target",
+   llvm::inconvertibleErrorCode());
 
   if (language == eLanguageTypeMipsAssembler // GNU AS and LLVM use it for all
  // assembly code
@@ -2143,

[Lldb-commits] [PATCH] D65122: [Symbol] Use llvm::Expected when getting TypeSystems

2019-07-29 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added a comment.

In D65122#1604352 , @labath wrote:

> I have one remark about the consumeError+LLDB_LOG pattern. As for whether 
> this is better than status quo or not, I still don't have an opinion on that. 
> :)


Thanks for pointing out LLDB_LOG_ERROR. I updated this change so people could 
have a chance to see what the change would look like so they have something 
concrete to look at instead of just speculating what it could look like.


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

https://reviews.llvm.org/D65122



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


[Lldb-commits] [PATCH] D65122: [Symbol] Use llvm::Expected when getting TypeSystems

2019-07-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments.



Comment at: source/API/SBModule.cpp:525
   module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
-  if (type_system) {
-CompilerType compiler_type = type_system->GetBuiltinTypeByName(name);
+  if (auto err = type_system_or_err.takeError()) {
+llvm::consumeError(std::move(err));

Any reason you do this instead of

```if (!type_system_or_err) {
  llvm::consumeError(type_system_or_err.takeError());
...
```



Comment at: source/API/SBModule.cpp:493
+  llvm::consumeError(std::move(err));
+} else {
+  return LLDB_RECORD_RESULT(

No else before return?


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

https://reviews.llvm.org/D65122



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


[Lldb-commits] [PATCH] D65386: [lldb][NFC] Use an enum instead of chars when handling options [WIP]

2019-07-29 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D65386#1604927 , @jingham wrote:

> It worries me a little bit that we are making it harder and harder to figure 
> out "where does the option for "-t" get stored once this CommandObject's 
> options have been parsed.  Can you show the steps I would have to go through 
> to get from "-f" to OptionEnumSettingsSet::Force or whatever.


Yeah, that has been my experience with table gen stuff. Does the table gen 
stuff generate code that exists in the build folder, like headers and/or C++ 
code? Navigating using an IDE often fails on these because the build system 
doesn't know about it directly. Any way to generate code in the source tree 
from the .inc files that we check in? Then if anyone modifies the .inc file it 
would regenerate (during the normal build process which could depend on the 
.inc _and_ on the .h or .cpp file that gets generated) the .h and .cpp file in 
the source tree and they would show up as modifications.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65386



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


[Lldb-commits] [PATCH] D64267: lldb_assert: abort when assertions are enabled.

2019-07-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

Did you see this recent commit?

  commit 515d1306ffb1e159c65b19d4cbe6c2f0997dfbf6
  Author: Adrian Prantl 
  Date:   Fri Mar 29 16:12:27 2019 +
  
  Don't abort() in lldb_assert and document why.
  
  rdar://problem/49356014
  
  Differential Revision: https://reviews.llvm.org/D59911
  
  llvm-svn: 357268


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64267



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


[Lldb-commits] [PATCH] D64267: lldb_assert: abort when assertions are enabled.

2019-07-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

Actually, it looks like this patch fixed an oversight in that commit. So all is 
good :-)


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64267



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


[Lldb-commits] [PATCH] D65414: Fix ClangASTContext::CreateParameterDeclaration to not call addDecl

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

The change D55575  modified 
`ClangASTContext::CreateParameterDeclaration` to call 
`decl_ctx->addDecl(decl);` this caused a regression since the existing code in 
`DWARFASTParserClang::ParseChildParameters` is called with the containing 
`DeclContext`:

  m_ast.CreateParameterDeclaration(containing_decl_ctx, name,
   type->GetForwardCompilerType(),
   storage);

So when end up with cases where we are parsing a parameter for a member 
function and the parameter is added to the `CXXRecordDecl` as opposed to the 
`CXXMethodDecl`. This example is given in the regression test  
`TestBreakpointInMemberFuncWNonPrimitiveParams.py` which without this fix in a 
modules build leads to assert on setting a breakpoint in a member function with 
non primitive parameters. This scenario would be common when debugging LLDB or 
clang.

This leaves a the existing issue which D55571  
tried to fix but apparently did not fix the issue or at least not totally, 
since there are no tests added with the PR it is hard to tell.


https://reviews.llvm.org/D65414

Files:
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/Makefile
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/TestBreakpointInMemberFuncWNonPrimitiveParams.py
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.cpp
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.h
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/main.cpp
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/module.modulemap
  source/Symbol/ClangASTContext.cpp

Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -2234,7 +2234,6 @@
   name && name[0] ? &ast->Idents.get(name) : nullptr,
   ClangUtil::GetQualType(param_type), nullptr,
   (clang::StorageClass)storage, nullptr);
-  decl_ctx->addDecl(decl);
   return decl;
 }
 
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/module.modulemap
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/module.modulemap
@@ -0,0 +1,3 @@
+module A {
+  header "a.h"
+}
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/main.cpp
@@ -0,0 +1,15 @@
+#include "a.h"
+#include 
+
+bool foo() {
+  A a1;
+  B b1;
+
+  return b1.member_func_a(a1); // break here
+}
+
+int main() {
+  int x = 0;
+
+  return foo();
+}
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.h
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.h
@@ -0,0 +1,7 @@
+struct A {
+  bool b(int x);
+};
+
+struct B {
+  bool member_func_a(A a);
+};
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.cpp
@@ -0,0 +1,10 @@
+#include "a.h"
+
+bool A::b(int x) {
+  if (x)
+return true;
+
+  return false;
+}
+
+bool B::member_func_a(A a) { return a.b(10); };
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/TestBreakpointInMemberFuncWNonPrimitiveParams.py
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/TestBreakpointInMemberFuncWNonPrimitiveParams.py
@@ -0,0 +1,18 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestBreakpointInMemberFuncWNonPrimitiveParams(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipUnlessDarwin
+@add_test_categories(["gmodules"])
+def test_breakpint_in_member_func_w_non_primitie_params(self):
+self.build()
+
+(self.target, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.S

[Lldb-commits] [PATCH] D65414: Fix ClangASTContext::CreateParameterDeclaration to not call addDecl

2019-07-29 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

Looks fine to me. Be nice to clarify the test with comments a bit. I can't 
really tell what the test is doing or how it is verifying the fix in 
ClangASTContext.cpp


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

https://reviews.llvm.org/D65414



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


[Lldb-commits] [PATCH] D65414: Fix ClangASTContext::CreateParameterDeclaration to not call addDecl

2019-07-29 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

So basically this is reverting an untested and incomplete/incorrect fix for 
another bug, while fixing a regression. I'm fine with the change assuming that 
it won't break the Windows test suite. The Makefile can be simplified though.




Comment at: 
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/Makefile:5
+
+CFLAGS_LIMIT = -c $(CXXFLAGS)
+CFLAGS_NO_LIMIT = -c $(CXXFLAGS)

This looks like it is copied and pasted form another testcase and not actually 
necessary.

What you want is 

```
CFLAGS_EXTRAS = $(MANDATORY_CXXMODULE_BUILD_CFLAGS)
```

and then you should be able to delete all lines starting with $(CXX) because 
the default build rules should just work.



Comment at: 
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/TestBreakpointInMemberFuncWNonPrimitiveParams.py:10
+
+@skipUnlessDarwin
+@add_test_categories(["gmodules"])

This shouldn't be necessary. We want this everywhere where gmodules is 
supported, right?


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

https://reviews.llvm.org/D65414



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


[Lldb-commits] [PATCH] D65386: [lldb][NFC] Use an enum instead of chars when handling options [WIP]

2019-07-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D65386#1604927 , @jingham wrote:

> It worries me a little bit that we are making it harder and harder to figure 
> out "where does the option for "-t" get stored once this CommandObject's 
> options have been parsed.  Can you show the steps I would have to go through 
> to get from "-f" to OptionEnumSettingsSet::Force or whatever.


TableGen's goal is "... to help a human develop and maintain records of 
domain-specific information." I think having a bit of code generation is nice, 
as longs as things don't become magical. The current patch is fine I think and 
I think Pavel's suggestion sounds good, as long as it's well documented. It's 
also the reason I suggest using the record names, instead of converting the 
name to CamelCase, so that you can at least grep for them.

In D65386#1605054 , @clayborg wrote:

> Yeah, that has been my experience with table gen stuff. Does the table gen 
> stuff generate code that exists in the build folder, like headers and/or C++ 
> code? Navigating using an IDE often fails on these because the build system 
> doesn't know about it directly. Any way to generate code in the source tree 
> from the .inc files that we check in? Then if anyone modifies the .inc file 
> it would regenerate (during the normal build process which could depend on 
> the .inc _and_ on the .h or .cpp file that gets generated) the .h and .cpp 
> file in the source tree and they would show up as modifications.


I really wouldn't want the generated code to be checked-in. The whole idea is 
that you don't really care what the (generated) table looks like, you only care 
about its content, which is defined in a human-readable way in the `.td` file. 
For me, TabelGen is about **records** rather than generating arbitrary code. 
Including some boiler plate is good (like the array definitions), but the 
surrounding code needs to be understandable, without having to look at the 
TableGen backend or generated code.




Comment at: lldb/utils/TableGen/LLDBOptionDefEmitter.cpp:211
+
+  std::string CamelCaseID = ToCamelCase(Command);
+

Can we use the option name instead, like I did for the properties? Or would 
that cause conflicts? 


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65386



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


[Lldb-commits] [PATCH] D65311: [dotest] Remove multiprocessing

2019-07-29 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

I'm not sure it's really relevant when lit is the driver, but I would often use 
--no-multiprocess with dotest to see the full trace output of a single test 
while it was running.  In multiprocess mode that wasn't displayed iirc.  That's 
my only use of it.  I do use --threads 1 when doing a testsuite run against a 
device because there's some buggy behavior in the lldb testsuite when running 
multiple tests simultaneously on a remote device (at least a remote darwin 
device).  But I'm sure you're not talking about removing that control.


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

https://reviews.llvm.org/D65311



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


[Lldb-commits] [lldb] r367258 - [Reproducers] Pass FileCollector around as a shared_ptr (NFC)

2019-07-29 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jul 29 13:54:02 2019
New Revision: 367258

URL: http://llvm.org/viewvc/llvm-project?rev=367258&view=rev
Log:
[Reproducers] Pass FileCollector around as a shared_ptr (NFC)

Instead of passing the FileCollector around as a reference or raw
pointer, use a shared_ptr. This change's motivation is twofold. First it
adds compatibility for the newly added `FileCollectorFileSystem`.
Secondly, it addresses a lifetime issue we only see when LLDB is used
from Xcode, where a reference to the FileCollector outlives the
reproducer instance.

Modified:
lldb/trunk/include/lldb/Host/FileSystem.h
lldb/trunk/include/lldb/Utility/Reproducer.h
lldb/trunk/source/Host/common/FileSystem.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ModuleDependencyCollector.h

Modified: lldb/trunk/include/lldb/Host/FileSystem.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSystem.h?rev=367258&r1=367257&r2=367258&view=diff
==
--- lldb/trunk/include/lldb/Host/FileSystem.h (original)
+++ lldb/trunk/include/lldb/Host/FileSystem.h Mon Jul 29 13:54:02 2019
@@ -34,8 +34,8 @@ public:
   FileSystem()
   : m_fs(llvm::vfs::getRealFileSystem()), m_collector(nullptr),
 m_mapped(false) {}
-  FileSystem(llvm::FileCollector &collector)
-  : m_fs(llvm::vfs::getRealFileSystem()), m_collector(&collector),
+  FileSystem(std::shared_ptr collector)
+  : m_fs(llvm::vfs::getRealFileSystem()), m_collector(collector),
 m_mapped(false) {}
   FileSystem(llvm::IntrusiveRefCntPtr fs,
  bool mapped = false)
@@ -47,7 +47,7 @@ public:
   static FileSystem &Instance();
 
   static void Initialize();
-  static void Initialize(llvm::FileCollector &collector);
+  static void Initialize(std::shared_ptr collector);
   static llvm::Error Initialize(const FileSpec &mapping);
   static void Initialize(llvm::IntrusiveRefCntPtr fs);
   static void Terminate();
@@ -188,7 +188,7 @@ public:
 private:
   static llvm::Optional &InstanceImpl();
   llvm::IntrusiveRefCntPtr m_fs;
-  llvm::FileCollector *m_collector;
+  std::shared_ptr m_collector;
   bool m_mapped;
 };
 } // namespace lldb_private

Modified: lldb/trunk/include/lldb/Utility/Reproducer.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Reproducer.h?rev=367258&r1=367257&r2=367258&view=diff
==
--- lldb/trunk/include/lldb/Utility/Reproducer.h (original)
+++ lldb/trunk/include/lldb/Utility/Reproducer.h Mon Jul 29 13:54:02 2019
@@ -91,23 +91,26 @@ public:
 
   FileProvider(const FileSpec &directory)
   : Provider(directory),
-m_collector(directory.CopyByAppendingPathComponent("root").GetPath(),
-directory.GetPath()) {}
+m_collector(std::make_shared(
+directory.CopyByAppendingPathComponent("root").GetPath(),
+directory.GetPath())) {}
 
-  llvm::FileCollector &GetFileCollector() { return m_collector; }
+  std::shared_ptr GetFileCollector() {
+return m_collector;
+  }
 
   void Keep() override {
 auto mapping = GetRoot().CopyByAppendingPathComponent(Info::file);
 // Temporary files that are removed during execution can cause copy errors.
-if (auto ec = m_collector.copyFiles(/*stop_on_error=*/false))
+if (auto ec = m_collector->copyFiles(/*stop_on_error=*/false))
   return;
-m_collector.writeMapping(mapping.GetPath());
+m_collector->writeMapping(mapping.GetPath());
   }
 
   static char ID;
 
 private:
-  llvm::FileCollector m_collector;
+  std::shared_ptr m_collector;
 };
 
 /// Provider for the LLDB version number.

Modified: lldb/trunk/source/Host/common/FileSystem.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSystem.cpp?rev=367258&r1=367257&r2=367258&view=diff
==
--- lldb/trunk/source/Host/common/FileSystem.cpp (original)
+++ lldb/trunk/source/Host/common/FileSystem.cpp Mon Jul 29 13:54:02 2019
@@ -49,7 +49,7 @@ void FileSystem::Initialize() {
   InstanceImpl().emplace();
 }
 
-void FileSystem::Initialize(FileCollector &collector) {
+void FileSystem::Initialize(std::shared_ptr collector) {
   lldbassert(!InstanceImpl() && "Already initialized.");
   InstanceImpl().emplace(collector);
 }

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ModuleDependencyCollector.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ModuleDependencyCollector.h?rev=367258&r1=367257&r2=367258&view=diff
==
--- 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ModuleDependencyCollector.h 
(original)
+++ 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ModuleDependencyCollector.h 
Mon Jul 29 13:54:02 2019
@@ -17,13 +17,15 @@ namespace lldb_p

[Lldb-commits] [PATCH] D65409: [ProcessWindows] Choose a register context file by prepocessor

2019-07-29 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd added inline comments.



Comment at: Common/CMakeLists.txt:28
+target_sources(lldbPluginProcessWindowsCommon PRIVATE
+  x86/RegisterContextWindows_x86.cpp)

At this point, I would say its better to just merge it into the main source 
list.



Comment at: Common/x64/RegisterContextWindows_x64.h:47
+
+#endif // defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || 
defined(_M_AMD64)

Can you push this inside the include guards please?



Comment at: Common/x86/RegisterContextWindows_x86.h:51
+
+#endif // defined(__i386__) || defined(_M_IX86)

Can you sink the check here inside the include guards please?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D65409



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


[Lldb-commits] [lldb] r367261 - [Symbolication] Remove a duplicate assignment.

2019-07-29 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Jul 29 14:25:45 2019
New Revision: 367261

URL: http://llvm.org/viewvc/llvm-project?rev=367261&view=rev
Log:
[Symbolication] Remove a duplicate assignment.

Modified:
lldb/trunk/examples/python/symbolication.py

Modified: lldb/trunk/examples/python/symbolication.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/symbolication.py?rev=367261&r1=367260&r2=367261&view=diff
==
--- lldb/trunk/examples/python/symbolication.py (original)
+++ lldb/trunk/examples/python/symbolication.py Mon Jul 29 14:25:45 2019
@@ -248,7 +248,6 @@ class Image:
 obj = cls(module.file.fullpath, module.uuid)
 obj.resolved_path = module.platform_file.fullpath
 obj.resolved = True
-obj.arch = module.triple
 for section in module.sections:
 symb_section = Section.InitWithSBTargetAndSBSection(
 target, section)


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


[Lldb-commits] [lldb] r367260 - [Symbolication] Fix unicode compatibility between 2 and 3.

2019-07-29 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Jul 29 14:25:37 2019
New Revision: 367260

URL: http://llvm.org/viewvc/llvm-project?rev=367260&view=rev
Log:
[Symbolication] Fix unicode compatibility between 2 and 3.

Triples are always ASCII for now, but we were handed out a
unicode object.



Modified:
lldb/trunk/examples/python/symbolication.py

Modified: lldb/trunk/examples/python/symbolication.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/symbolication.py?rev=367260&r1=367259&r2=367260&view=diff
==
--- lldb/trunk/examples/python/symbolication.py (original)
+++ lldb/trunk/examples/python/symbolication.py Mon Jul 29 14:25:37 2019
@@ -380,7 +380,7 @@ class Image:
 return None
 resolved_path = self.get_resolved_path()
 self.module = target.AddModule(
-resolved_path, self.arch, uuid_str, self.symfile)
+resolved_path, str(self.arch), uuid_str, self.symfile)
 if not self.module:
 return 'error: unable to get module for (%s) "%s"' % (
 self.arch, self.get_resolved_path())


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


[Lldb-commits] [lldb] r367262 - [Symbolication] Remove some dead code. Nothing exciting.

2019-07-29 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Jul 29 14:25:51 2019
New Revision: 367262

URL: http://llvm.org/viewvc/llvm-project?rev=367262&view=rev
Log:
[Symbolication] Remove some dead code. Nothing exciting.

Modified:
lldb/trunk/examples/python/symbolication.py

Modified: lldb/trunk/examples/python/symbolication.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/symbolication.py?rev=367262&r1=367261&r2=367262&view=diff
==
--- lldb/trunk/examples/python/symbolication.py (original)
+++ lldb/trunk/examples/python/symbolication.py Mon Jul 29 14:25:51 2019
@@ -418,7 +418,6 @@ class Image:
 if self.locate_module_and_debug_symbols():
 resolved_path = self.get_resolved_path()
 path_spec = lldb.SBFileSpec(resolved_path)
-#result.PutCString ('plist[%s] = %s' % (uuid, self.plist))
 error = lldb.SBError()
 target = lldb.debugger.CreateTarget(
 resolved_path, self.arch, None, False, error)
@@ -574,7 +573,6 @@ def disassemble_instructions(
 mnemonic = inst.GetMnemonic(target)
 operands = inst.GetOperands(target)
 comment = inst.GetComment(target)
-#data = inst.GetData (target)
 lines.append("%#16.16x: %8s %s" % (inst_pc, mnemonic, operands))
 if comment:
 line_len = len(lines[-1])


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


[Lldb-commits] [PATCH] D65311: [dotest] Remove multiprocessing

2019-07-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D65311#1605147 , @jasonmolenda 
wrote:

> I'm not sure it's really relevant when lit is the driver, but I would often 
> use --no-multiprocess with dotest to see the full trace output of a single 
> test while it was running.  In multiprocess mode that wasn't displayed iirc.  
> That's my only use of it.  I do use --threads 1 when doing a testsuite run 
> against a device because there's some buggy behavior in the lldb testsuite 
> when running multiple tests simultaneously on a remote device (at least a 
> remote darwin device).  But I'm sure you're not talking about removing that 
> control.


Yup, at this point I'm just removing multiprocessing support. However, the 
ultimate goal is to have no driving capabilities in dotest at all, which would 
mean it can only run a single test at a time. You'd still be able to achieve a 
single thread by passing to `lit` (the driver) with `-j1`.


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

https://reviews.llvm.org/D65311



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


[Lldb-commits] [PATCH] D65414: Fix ClangASTContext::CreateParameterDeclaration to not call addDecl

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

Addressing comments:

- Simplifying Makefile
- Adding comments to the test


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

https://reviews.llvm.org/D65414

Files:
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/Makefile
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/TestBreakpointInMemberFuncWNonPrimitiveParams.py
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.cpp
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.h
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/main.cpp
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/module.modulemap
  source/Symbol/ClangASTContext.cpp

Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -2234,7 +2234,6 @@
   name && name[0] ? &ast->Idents.get(name) : nullptr,
   ClangUtil::GetQualType(param_type), nullptr,
   (clang::StorageClass)storage, nullptr);
-  decl_ctx->addDecl(decl);
   return decl;
 }
 
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/module.modulemap
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/module.modulemap
@@ -0,0 +1,3 @@
+module A {
+  header "a.h"
+}
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/main.cpp
@@ -0,0 +1,15 @@
+#include "a.h"
+#include 
+
+bool foo() {
+  A a1;
+  B b1;
+
+  return b1.member_func_a(a1); // break here
+}
+
+int main() {
+  int x = 0;
+
+  return foo();
+}
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.h
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.h
@@ -0,0 +1,7 @@
+struct A {
+  bool b(int x);
+};
+
+struct B {
+  bool member_func_a(A a);
+};
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.cpp
@@ -0,0 +1,14 @@
+#include "a.h"
+
+bool A::b(int x) {
+  if (x)
+return true;
+
+  return false;
+}
+
+bool B::member_func_a(A a) {
+  return a.b(10); // We will try and add a breakpoint here which
+  // trigger an assert since we will attempt to
+  // to add ParamVarDecl a to CXXRecordDecl A
+};
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/TestBreakpointInMemberFuncWNonPrimitiveParams.py
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/TestBreakpointInMemberFuncWNonPrimitiveParams.py
@@ -0,0 +1,26 @@
+"""
+This is a regression test for an assert that happens while setting a breakpoint.
+The root cause of the assert was attempting to add a ParmVarDecl to a CXXRecordDecl
+when it should have been added to a CXXMethodDecl.
+
+We can reproduce with a module build and setting a breakpoint in a member function
+of a class with a non-primitive type as a parameter.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestBreakpointInMemberFuncWNonPrimitiveParams(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@add_test_categories(["gmodules"])
+def test_breakpint_in_member_func_w_non_primitie_params(self):
+self.build()
+
+(self.target, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp", False))
+
+self.runCmd("b a.cpp:11");
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/Makefile
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/Makefile
@@ -0,0 +1,19 @@
+LEVEL = ../../../make
+
+CXX_SOURCES = main.cpp a.cpp
+
+CFLAGS_EXTRAS = $(MANDATORY_CXXMODULE_BUILD_CFLAGS)
+CFLAGS_NO_LIMIT = -c $(CXX

[Lldb-commits] [PATCH] D65414: Fix ClangASTContext::CreateParameterDeclaration to not call addDecl

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

@aprantl @clayborg Thank you for the comments, I think I have addressed your 
concerns.


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

https://reviews.llvm.org/D65414



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


[Lldb-commits] [PATCH] D65122: [Symbol] Use llvm::Expected when getting TypeSystems

2019-07-29 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added inline comments.



Comment at: source/API/SBModule.cpp:525
   module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
-  if (type_system) {
-CompilerType compiler_type = type_system->GetBuiltinTypeByName(name);
+  if (auto err = type_system_or_err.takeError()) {
+llvm::consumeError(std::move(err));

JDevlieghere wrote:
> Any reason you do this instead of
> 
> ```if (!type_system_or_err) {
>   llvm::consumeError(type_system_or_err.takeError());
> ...
> ```
No reason in particular. Is there a benefit in doing so or something I'm 
misunderstanding?


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

https://reviews.llvm.org/D65122



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


[Lldb-commits] [PATCH] D65122: [Symbol] Use llvm::Expected when getting TypeSystems

2019-07-29 Thread Alex Langford via Phabricator via lldb-commits
xiaobai updated this revision to Diff 212232.
xiaobai added a comment.

Small logic change in SBModule


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

https://reviews.llvm.org/D65122

Files:
  include/lldb/Core/Module.h
  include/lldb/Symbol/SymbolFile.h
  include/lldb/Symbol/TypeSystem.h
  include/lldb/Target/Target.h
  source/API/SBModule.cpp
  source/Breakpoint/Watchpoint.cpp
  source/Core/Module.cpp
  source/Core/ValueObjectRegister.cpp
  source/DataFormatters/VectorType.cpp
  source/Expression/Materializer.cpp
  source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  source/Plugins/Language/CPlusPlus/BlockPointer.cpp
  source/Plugins/Language/ObjC/CoreMedia.cpp
  source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
  source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
  source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h
  source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
  source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
  source/Symbol/SymbolFile.cpp
  source/Symbol/Type.cpp
  source/Symbol/TypeSystem.cpp
  source/Target/StackFrame.cpp
  source/Target/Target.cpp
  source/Target/ThreadPlanTracer.cpp
  tools/lldb-test/lldb-test.cpp

Index: tools/lldb-test/lldb-test.cpp
===
--- tools/lldb-test/lldb-test.cpp
+++ tools/lldb-test/lldb-test.cpp
@@ -528,10 +528,15 @@
   if (!symfile)
 return make_string_error("Module has no symbol file.");
 
-  auto clang_ast_ctx = llvm::dyn_cast_or_null(
-  symfile->GetTypeSystemForLanguage(eLanguageTypeC_plus_plus));
+  auto type_system_or_err =
+  symfile->GetTypeSystemForLanguage(eLanguageTypeC_plus_plus);
+  if (!type_system_or_err)
+return make_string_error("Can't retrieve ClangASTContext");
+
+  auto *clang_ast_ctx =
+  llvm::dyn_cast_or_null(&type_system_or_err.get());
   if (!clang_ast_ctx)
-return make_string_error("Can't retrieve Clang AST context.");
+return make_string_error("Retrieved TypeSystem was not a ClangASTContext");
 
   auto ast_ctx = clang_ast_ctx->getASTContext();
   if (!ast_ctx)
Index: source/Target/ThreadPlanTracer.cpp
===
--- source/Target/ThreadPlanTracer.cpp
+++ source/Target/ThreadPlanTracer.cpp
@@ -93,15 +93,20 @@
 
 TypeFromUser ThreadPlanAssemblyTracer::GetIntPointerType() {
   if (!m_intptr_type.IsValid()) {
-TargetSP target_sp(m_thread.CalculateTarget());
-if (target_sp) {
-  TypeSystem *type_system =
-  target_sp->GetScratchTypeSystemForLanguage(nullptr, eLanguageTypeC);
-  if (type_system)
-m_intptr_type =
-TypeFromUser(type_system->GetBuiltinTypeForEncodingAndBitSize(
+if (auto target_sp = m_thread.CalculateTarget()) {
+  auto type_system_or_err =
+  target_sp->GetScratchTypeSystemForLanguage(eLanguageTypeC);
+  if (auto err = type_system_or_err.takeError()) {
+LLDB_LOG_ERROR(
+lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_TYPES),
+std::move(err),
+"Unable to get integer pointer type from TypeSystem");
+  } else {
+m_intptr_type = TypeFromUser(
+type_system_or_err->GetBuiltinTypeForEncodingAndBitSize(
 eEncodingUint,
 target_sp->GetArchitecture().GetAddressByteSize() * 8));
+  }
 }
   }
   return m_intptr_type;
Index: source/Target/Target.cpp
===
--- source/Target/Target.cpp
+++ source/Target/Target.cpp
@@ -2119,15 +2119,12 @@
 target->SetExecutableModule(exe_module_sp, eLoadDependentsYes);
 }
 
-TypeSystem *Target::GetScratchTypeSystemForLanguage(Status *error,
-lldb::LanguageType language,
-bool create_on_demand) {
+llvm::Expected
+Target::GetScratchTypeSystemForLanguage(lldb::LanguageType language,
+bool create_on_demand) {
   if (!m_valid)
-return nullptr;
-
-  if (error) {
-error->Clear();
-  }
+return llvm::make_error("Invalid Target",
+   llvm::inconvertibleErrorCode());
 
   if (language == eLanguageTypeMipsAssembler // GNU AS and LLVM use it for all
  // assembly code
@@ -2143,7 +21

[Lldb-commits] [PATCH] D65122: [Symbol] Use llvm::Expected when getting TypeSystems

2019-07-29 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments.



Comment at: source/API/SBModule.cpp:525
   module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
-  if (type_system) {
-CompilerType compiler_type = type_system->GetBuiltinTypeByName(name);
+  if (auto err = type_system_or_err.takeError()) {
+llvm::consumeError(std::move(err));

xiaobai wrote:
> JDevlieghere wrote:
> > Any reason you do this instead of
> > 
> > ```if (!type_system_or_err) {
> >   llvm::consumeError(type_system_or_err.takeError());
> > ...
> > ```
> No reason in particular. Is there a benefit in doing so or something I'm 
> misunderstanding?
I like it because it's shorter and a bit easier to read. Probably it doesn't 
matter. If this works I don't want to hold up your change because of it. 


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

https://reviews.llvm.org/D65122



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


[Lldb-commits] [PATCH] D65414: Fix ClangASTContext::CreateParameterDeclaration to not call addDecl

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

Simplifying Makefile even more


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

https://reviews.llvm.org/D65414

Files:
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/Makefile
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/TestBreakpointInMemberFuncWNonPrimitiveParams.py
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.cpp
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.h
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/main.cpp
  
packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/module.modulemap
  source/Symbol/ClangASTContext.cpp

Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -2234,7 +2234,6 @@
   name && name[0] ? &ast->Idents.get(name) : nullptr,
   ClangUtil::GetQualType(param_type), nullptr,
   (clang::StorageClass)storage, nullptr);
-  decl_ctx->addDecl(decl);
   return decl;
 }
 
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/module.modulemap
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/module.modulemap
@@ -0,0 +1,3 @@
+module A {
+  header "a.h"
+}
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/main.cpp
@@ -0,0 +1,15 @@
+#include "a.h"
+#include 
+
+bool foo() {
+  A a1;
+  B b1;
+
+  return b1.member_func_a(a1); // break here
+}
+
+int main() {
+  int x = 0;
+
+  return foo();
+}
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.h
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.h
@@ -0,0 +1,7 @@
+struct A {
+  bool b(int x);
+};
+
+struct B {
+  bool member_func_a(A a);
+};
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/a.cpp
@@ -0,0 +1,14 @@
+#include "a.h"
+
+bool A::b(int x) {
+  if (x)
+return true;
+
+  return false;
+}
+
+bool B::member_func_a(A a) {
+  return a.b(10); // We will try and add a breakpoint here which
+  // trigger an assert since we will attempt to
+  // to add ParamVarDecl a to CXXRecordDecl A
+};
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/TestBreakpointInMemberFuncWNonPrimitiveParams.py
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/TestBreakpointInMemberFuncWNonPrimitiveParams.py
@@ -0,0 +1,26 @@
+"""
+This is a regression test for an assert that happens while setting a breakpoint.
+The root cause of the assert was attempting to add a ParmVarDecl to a CXXRecordDecl
+when it should have been added to a CXXMethodDecl.
+
+We can reproduce with a module build and setting a breakpoint in a member function
+of a class with a non-primitive type as a parameter.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestBreakpointInMemberFuncWNonPrimitiveParams(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@add_test_categories(["gmodules"])
+def test_breakpint_in_member_func_w_non_primitie_params(self):
+self.build()
+
+(self.target, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp", False))
+
+self.runCmd("b a.cpp:11");
Index: packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/Makefile
===
--- /dev/null
+++ packages/Python/lldbsuite/test/lang/cpp/breakpoint_in_member_func_w_non_primitive_params/Makefile
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+CXX_SOURCES = main.cpp a.cpp
+CFLAGS_EXTRAS = $(MANDATORY_CXXMODULE_BUILD_CFLAGS)
+
+include $(LEVEL)/Makefile.rules
___

[Lldb-commits] [PATCH] D65414: Fix ClangASTContext::CreateParameterDeclaration to not call addDecl

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

@stella.stamenova this could potentially break the windows build, could you 
please verify before I land this change. Thank you in advance!


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

https://reviews.llvm.org/D65414



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


[Lldb-commits] [PATCH] D65414: Fix ClangASTContext::CreateParameterDeclaration to not call addDecl

2019-07-29 Thread Stella Stamenova via Phabricator via lldb-commits
stella.stamenova added a comment.

I'll run some tests and let you know the result.


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

https://reviews.llvm.org/D65414



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


[Lldb-commits] [PATCH] D65414: Fix ClangASTContext::CreateParameterDeclaration to not call addDecl

2019-07-29 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

It might be good to see if you can trigger the bug more directly (for instance 
by getting the SBType for the method and pulling out its arguments?)  The 
reason that a breakpoint triggers this at present is that lldb reads the debug 
info for the function to find the prologue extents so it can more accurately 
push the breakpoint past the prologue.  But that's not really desirable, it is 
a lot of work just for setting a breakpoint, and if I ever figure out how not 
to do that, I will.  In which case, this test will no longer test what you 
think it tests.


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

https://reviews.llvm.org/D65414



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


[Lldb-commits] [PATCH] D65362: [CMake] Move project() call to main CMake file

2019-07-29 Thread Haibo Huang via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367273: [CMake] Move project() call to main CMake file 
(authored by hhb, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65362?vs=212037&id=212245#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65362

Files:
  lldb/trunk/CMakeLists.txt
  lldb/trunk/cmake/modules/LLDBStandalone.cmake


Index: lldb/trunk/cmake/modules/LLDBStandalone.cmake
===
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake
@@ -1,5 +1,3 @@
-project(lldb)
-
 option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 
'install' target." OFF)
 
 find_package(LLVM REQUIRED CONFIG HINTS "${LLVM_DIR}" NO_CMAKE_FIND_ROOT_PATH)
Index: lldb/trunk/CMakeLists.txt
===
--- lldb/trunk/CMakeLists.txt
+++ lldb/trunk/CMakeLists.txt
@@ -14,6 +14,7 @@
 # If we are not building as part of LLVM, build LLDB as a standalone project,
 # using LLVM as an external library.
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+  project(lldb)
   include(LLDBStandalone)
 endif()
 


Index: lldb/trunk/cmake/modules/LLDBStandalone.cmake
===
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake
@@ -1,5 +1,3 @@
-project(lldb)
-
 option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
 
 find_package(LLVM REQUIRED CONFIG HINTS "${LLVM_DIR}" NO_CMAKE_FIND_ROOT_PATH)
Index: lldb/trunk/CMakeLists.txt
===
--- lldb/trunk/CMakeLists.txt
+++ lldb/trunk/CMakeLists.txt
@@ -14,6 +14,7 @@
 # If we are not building as part of LLVM, build LLDB as a standalone project,
 # using LLVM as an external library.
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+  project(lldb)
   include(LLDBStandalone)
 endif()
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D65249: [NFC] use C++11 in AlignOf.h, remove AlignedCharArray

2019-07-29 Thread JF Bastien via Phabricator via lldb-commits
jfb updated this revision to Diff 212252.
jfb added a comment.

Significantly simplify the patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65249

Files:
  llvm/include/llvm/Support/AlignOf.h
  llvm/unittests/Support/AlignOfTest.cpp

Index: llvm/unittests/Support/AlignOfTest.cpp
===
--- llvm/unittests/Support/AlignOfTest.cpp
+++ llvm/unittests/Support/AlignOfTest.cpp
@@ -233,16 +233,5 @@
 #ifndef _MSC_VER
   EXPECT_EQ(sizeof(V8), sizeof(AlignedCharArrayUnion));
 #endif
-
-  EXPECT_EQ(1u, (alignof(AlignedCharArray<1, 1>)));
-  EXPECT_EQ(2u, (alignof(AlignedCharArray<2, 1>)));
-  EXPECT_EQ(4u, (alignof(AlignedCharArray<4, 1>)));
-  EXPECT_EQ(8u, (alignof(AlignedCharArray<8, 1>)));
-  EXPECT_EQ(16u, (alignof(AlignedCharArray<16, 1>)));
-
-  EXPECT_EQ(1u, sizeof(AlignedCharArray<1, 1>));
-  EXPECT_EQ(7u, sizeof(AlignedCharArray<1, 7>));
-  EXPECT_EQ(2u, sizeof(AlignedCharArray<2, 2>));
-  EXPECT_EQ(16u, sizeof(AlignedCharArray<2, 16>));
 }
 } // end anonymous namespace
Index: llvm/include/llvm/Support/AlignOf.h
===
--- llvm/include/llvm/Support/AlignOf.h
+++ llvm/include/llvm/Support/AlignOf.h
@@ -6,7 +6,7 @@
 //
 //===--===//
 //
-// This file defines the AlignedCharArray and AlignedCharArrayUnion classes.
+// This file defines the AlignedCharArrayUnion class.
 //
 //===--===//
 
@@ -18,128 +18,38 @@
 
 namespace llvm {
 
-/// \struct AlignedCharArray
-/// Helper for building an aligned character array type.
-///
-/// This template is used to explicitly build up a collection of aligned
-/// character array types. We have to build these up using a macro and explicit
-/// specialization to cope with MSVC (at least till 2015) where only an
-/// integer literal can be used to specify an alignment constraint. Once built
-/// up here, we can then begin to indirect between these using normal C++
-/// template parameters.
-
-// MSVC requires special handling here.
-#ifndef _MSC_VER
-
-template
-struct AlignedCharArray {
-  alignas(Alignment) char buffer[Size];
-};
-
-#else // _MSC_VER
-
-/// Create a type with an aligned char buffer.
-template
-struct AlignedCharArray;
-
-// We provide special variations of this template for the most common
-// alignments because __declspec(align(...)) doesn't actually work when it is
-// a member of a by-value function argument in MSVC, even if the alignment
-// request is something reasonably like 8-byte or 16-byte. Note that we can't
-// even include the declspec with the union that forces the alignment because
-// MSVC warns on the existence of the declspec despite the union member forcing
-// proper alignment.
-
-template
-struct AlignedCharArray<1, Size> {
-  union {
-char aligned;
-char buffer[Size];
-  };
-};
-
-template
-struct AlignedCharArray<2, Size> {
-  union {
-short aligned;
-char buffer[Size];
-  };
-};
-
-template
-struct AlignedCharArray<4, Size> {
-  union {
-int aligned;
-char buffer[Size];
-  };
-};
+namespace detail {
 
-template
-struct AlignedCharArray<8, Size> {
-  union {
-double aligned;
-char buffer[Size];
-  };
+template  class AlignerImpl {
+  T t;
+  AlignerImpl rest;
+  AlignerImpl() = delete;
 };
 
-
-// The rest of these are provided with a __declspec(align(...)) and we simply
-// can't pass them by-value as function arguments on MSVC.
-
-#define LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
-  template \
-  struct AlignedCharArray { \
-__declspec(align(x)) char buffer[Size]; \
-  };
-
-LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(16)
-LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(32)
-LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(64)
-LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(128)
-
-#undef LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT
-
-#endif // _MSC_VER
-
-namespace detail {
-template 
-class AlignerImpl {
-  T1 t1; T2 t2; T3 t3; T4 t4; T5 t5; T6 t6; T7 t7; T8 t8; T9 t9; T10 t10;
-
+template  class AlignerImpl {
+  T t;
   AlignerImpl() = delete;
 };
 
-template 
-union SizerImpl {
-  char arr1[sizeof(T1)], arr2[sizeof(T2)], arr3[sizeof(T3)], arr4[sizeof(T4)],
-   arr5[sizeof(T5)], arr6[sizeof(T6)], arr7[sizeof(T7)], arr8[sizeof(T8)],
-   arr9[sizeof(T9)], arr10[sizeof(T10)];
+template  union SizerImpl {
+  char arr[sizeof(T)];
+  SizerImpl rest;
 };
+
+template  union SizerImpl { char arr[sizeof(T)]; };
 } // end namespace detail
 
-/// This union template exposes a suitably aligned and sized character
-/// array member which can hold elements of any of up to ten types.
+/// A suitably aligned and sized character array member which can hold elements
+/// of any type.
 ///
-/// These types may be arrays, structs, or any other types. The goal is to
-/// expose a char array 

[Lldb-commits] [PATCH] D65249: [NFC] use C++11 in AlignOf.h, remove AlignedCharArray

2019-07-29 Thread JF Bastien via Phabricator via lldb-commits
jfb added a comment.

In D65249#1603431 , @BillyONeal wrote:

> (In fact I observe many patterns in this review like:
>
> enum { Foo = alignof(void*); }
>  aligned_storage_t<1234, Foo> x;
>
> and then a bunch of casting to treat it as a char buffer; if it was just born 
> as a char buffer you can remove both the casts and the enum hack:
>
> alignas(void*) char x[1234];


Good point. I went ahead and did that. The patch is now quite trivial :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65249



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


[Lldb-commits] [PATCH] D62213: [ABI] Implement Windows ABI for x86_64

2019-07-29 Thread Aaron Smith via Phabricator via lldb-commits
asmith added a comment.

I think this change has introduced a dependence on x64.

I tried building with the 32b Visual Studio compiler and there are a number of 
undefined registers in registercontextwindows_x64.cpp.
This is because the version of _CONTEXT included by winnt.h is for x32 and not 
x64.

i.e., 
llvm-project\lldb\source\plugins\process\windows\common\x64\registercontextwindows_x64.cpp(297):
 error C2039: 'Rax': is not a member of '_CONTEXT'

Thoughts? Maybe this doesn't need to be included when building x32 LLDB?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62213



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


[Lldb-commits] [PATCH] D65249: [NFC] use C++11 in AlignOf.h, remove AlignedCharArray

2019-07-29 Thread Reid Kleckner via Phabricator via lldb-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

I have concerns that some of the patches that you landed prior to this will 
cause issues with old versions of MSVC, but in isolation, this is fine, and if 
anyone complains, we can address it on a case-by-case basis. lgtm


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65249



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


[Lldb-commits] [PATCH] D62213: [ABI] Implement Windows ABI for x86_64

2019-07-29 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added a comment.

In D62213#1605521 , @asmith wrote:

> I think this change has introduced a dependence on x64.
>
> I tried building with the 32b Visual Studio compiler and there are a number 
> of undefined registers in registercontextwindows_x64.cpp.
>  This is because the version of _CONTEXT included by winnt.h is for x32 and 
> not x64.
>
> i.e., 
> llvm-project\lldb\source\plugins\process\windows\common\x64\registercontextwindows_x64.cpp(297):
>  error C2039: 'Rax': is not a member of '_CONTEXT'


This seems kind of strange to me. I didn't think you could actually build 
RegisterContextWindows_x64.cpp on an x86 machine. From the CMake logic, it 
looks like it's guarded by `CMAKE_SYSTEM_PROCESSOR` matching either "x86_64" or 
"AMD64". Do you have any local changes or a specific CMake setup that caused 
you to run into this?

> Thoughts? Maybe this doesn't need to be included when building x32 LLDB?

I would rather be able to build this all on x86 if possible, but I don't think 
it's the end of the world if there's no nice way to do this. There is plenty of 
code in LLDB guarded by what platform you're building on/for, this would just 
be another instance of it.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62213



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


[Lldb-commits] [PATCH] D63165: Initial support for native debugging of x86/x64 Windows processes

2019-07-29 Thread Aaron Smith via Phabricator via lldb-commits
asmith marked 11 inline comments as done.
asmith added inline comments.



Comment at: 
lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp:95
+
+// Resume the debug loop.
+ExceptionRecordSP active_exception =

amccarth wrote:
> This code appears to be based on `ProcessWindows::DoResume`, which has a 
> pending patch to fix a race condition by moving the checking of the exception 
> record to later in the function.  I assume this will need the same fix.  See 
> https://reviews.llvm.org/D62183 for details.
Thanks for the heads up


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

https://reviews.llvm.org/D63165



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


[Lldb-commits] [PATCH] D65414: Fix ClangASTContext::CreateParameterDeclaration to not call addDecl

2019-07-29 Thread Stella Stamenova via Phabricator via lldb-commits
stella.stamenova added a comment.

One failure:

  Error : no member named 'argc' in namespace '$__lldb_local_vars'

from LLDB :: SymbolFile/NativePDB/local-variables.cpp.


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

https://reviews.llvm.org/D65414



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


[Lldb-commits] [PATCH] D65249: [NFC] use C++11 in AlignOf.h, remove AlignedCharArray

2019-07-29 Thread JF Bastien via Phabricator via lldb-commits
jfb added a comment.

In D65249#1605523 , @rnk wrote:

> I have concerns that some of the patches that you landed prior to this will 
> cause issues with old versions of MSVC, but in isolation, this is fine, and 
> if anyone complains, we can address it on a case-by-case basis. lgtm


IIUC Billy correctly, the issue was just with `aligned_storage`, but if you 
roll your own (as I have) we're fine. If I'm wrong, these tests will fail on 
MSVC bots :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65249



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


[Lldb-commits] [PATCH] D62213: [ABI] Implement Windows ABI for x86_64

2019-07-29 Thread Aaron Smith via Phabricator via lldb-commits
asmith added a comment.

I can confirm this is reproducible with the master branch of llvm-project 
cloned from GitHub.

You can reproduce the build failure from an x64 command prompt with this cmake 
command line:

  cmake path-to-llvm-project/llvm -Thost=x64 
-DLLVM_ENABLE_PROJECTS="clang;lld;lldb" -DCLANG_DEFAULT_LINKER=lld 
-DLLVM_ENABLE_ASSERTIONS=ON

And building with:

  msbuild ALL_BUILD.vcxproj /m

In this configuration CMAKE_SYSTEM_PROCESSOR is going to report AMD64 and this 
is going to use the x64 hosted Visual Studio compiler targeting 32 bit Windows. 
Probably some of these files need to be wrapped in #if defined(_M_X64).




Comment at: lldb/trunk/source/Plugins/ABI/Windows-x86_64/ABIWindows_x86_64.h:1
+//===-- ABIWindows_x86_64.h *- C++ 
-*-===//
+//

Nit; number of dashes '' is wrong in the headers of the files added


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62213



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


[Lldb-commits] [lldb] r367285 - [lldb] [test] Mark newly running test XFAIL on NetBSD

2019-07-29 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Jul 29 23:12:03 2019
New Revision: 367285

URL: http://llvm.org/viewvc/llvm-project?rev=367285&view=rev
Log:
[lldb] [test] Mark newly running test XFAIL on NetBSD

The test was not previously run due to decorator bug (fixed in r366903).
It is not a regression and is probably related to the other failing
test, so just disable it.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py?rev=367285&r1=367284&r2=367285&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
 Mon Jul 29 23:12:03 2019
@@ -109,6 +109,7 @@ class HelloWorldTestCase(TestBase):
 @add_test_categories(['pyapi'])
 @skipIfiOSSimulator
 @skipIfSanitized # FIXME: Hangs indefinitely.
+@expectedFailureNetBSD
 def test_with_attach_to_process_with_name_api(self):
 """Create target, spawn a process, and attach to it with process 
name."""
 exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())


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