[Lldb-commits] [PATCH] D57689: Adds property to force enabling of GDB JIT loader for MacOS

2019-03-04 Thread Yury Delendik via Phabricator via lldb-commits
yurydelendik added a comment.
Herald added a subscriber: jdoerfert.

@jingham is this patch good to land?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57689



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


[Lldb-commits] [PATCH] D58167: Refactor user/group name resolving code

2019-03-04 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB355323: Refactor user/group name resolving code (authored 
by labath, committed by ).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D58167?vs=188448=189169#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D58167

Files:
  include/lldb/Host/HostInfoBase.h
  include/lldb/Host/posix/HostInfoPosix.h
  include/lldb/Target/Platform.h
  include/lldb/Target/Process.h
  include/lldb/Target/RemoteAwarePlatform.h
  include/lldb/Utility/UserIDResolver.h
  source/Commands/CommandObjectPlatform.cpp
  source/Host/posix/HostInfoPosix.cpp
  source/Plugins/Platform/Kalimba/PlatformKalimba.h
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
  source/Target/Platform.cpp
  source/Target/Process.cpp
  source/Target/RemoteAwarePlatform.cpp
  source/Utility/CMakeLists.txt
  source/Utility/UserIDResolver.cpp
  unittests/Target/CMakeLists.txt
  unittests/Target/ProcessInstanceInfoTest.cpp
  unittests/Utility/CMakeLists.txt
  unittests/Utility/UserIDResolverTest.cpp

Index: unittests/Utility/CMakeLists.txt
===
--- unittests/Utility/CMakeLists.txt
+++ unittests/Utility/CMakeLists.txt
@@ -34,6 +34,7 @@
   TimeoutTest.cpp
   TimerTest.cpp
   UriParserTest.cpp
+  UserIDResolverTest.cpp
   UUIDTest.cpp
   VASprintfTest.cpp
   VMRangeTest.cpp
Index: unittests/Utility/UserIDResolverTest.cpp
===
--- unittests/Utility/UserIDResolverTest.cpp
+++ unittests/Utility/UserIDResolverTest.cpp
@@ -0,0 +1,47 @@
+//===-- UserIDResolverTest.cpp --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "lldb/Utility/UserIDResolver.h"
+#include "gmock/gmock.h"
+
+using namespace lldb_private;
+using namespace testing;
+
+namespace {
+class TestUserIDResolver : public UserIDResolver {
+public:
+  MOCK_METHOD1(DoGetUserName, llvm::Optional(id_t uid));
+  MOCK_METHOD1(DoGetGroupName, llvm::Optional(id_t gid));
+};
+} // namespace
+
+TEST(UserIDResolver, GetUserName) {
+  StrictMock r;
+  llvm::StringRef user47("foo");
+  EXPECT_CALL(r, DoGetUserName(47)).Times(1).WillOnce(Return(user47.str()));
+  EXPECT_CALL(r, DoGetUserName(42)).Times(1).WillOnce(Return(llvm::None));
+
+  // Call functions twice to make sure the caching works.
+  EXPECT_EQ(user47, r.GetUserName(47));
+  EXPECT_EQ(user47, r.GetUserName(47));
+  EXPECT_EQ(llvm::None, r.GetUserName(42));
+  EXPECT_EQ(llvm::None, r.GetUserName(42));
+}
+
+TEST(UserIDResolver, GetGroupName) {
+  StrictMock r;
+  llvm::StringRef group47("foo");
+  EXPECT_CALL(r, DoGetGroupName(47)).Times(1).WillOnce(Return(group47.str()));
+  EXPECT_CALL(r, DoGetGroupName(42)).Times(1).WillOnce(Return(llvm::None));
+
+  // Call functions twice to make sure the caching works.
+  EXPECT_EQ(group47, r.GetGroupName(47));
+  EXPECT_EQ(group47, r.GetGroupName(47));
+  EXPECT_EQ(llvm::None, r.GetGroupName(42));
+  EXPECT_EQ(llvm::None, r.GetGroupName(42));
+}
Index: unittests/Target/ProcessInstanceInfoTest.cpp
===
--- unittests/Target/ProcessInstanceInfoTest.cpp
+++ unittests/Target/ProcessInstanceInfoTest.cpp
@@ -0,0 +1,75 @@
+//===-- ProcessInstanceInfoTest.cpp -*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "lldb/Target/Process.h"
+#include "gtest/gtest.h"
+
+using namespace lldb_private;
+
+namespace {
+/// A very simple resolver which fails for even ids and returns a simple string
+/// for odd ones.
+class DummyUserIDResolver : public UserIDResolver {
+protected:
+  llvm::Optional DoGetUserName(id_t uid) {
+if (uid % 2)
+  return ("user" + llvm::Twine(uid)).str();
+return llvm::None;
+  }
+
+  llvm::Optional DoGetGroupName(id_t gid) {
+if (gid % 2)
+  return ("group" + llvm::Twine(gid)).str();
+return llvm::None;
+  }
+};
+} // namespace
+
+TEST(ProcessInstanceInfo, Dump) {
+  ProcessInstanceInfo info("a.out", ArchSpec("x86_64-pc-linux"), 47);
+  info.SetUserID(1);
+  info.SetEffectiveUserID(2);
+  info.SetGroupID(3);
+  info.SetEffectiveGroupID(4);
+
+  DummyUserIDResolver 

[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

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



Comment at: 
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/TestStdModuleWithConflicts.py:35
+
+self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+

what's that for?


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

https://reviews.llvm.org/D58125



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


[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

2019-03-04 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor marked an inline comment as done.
teemperor added inline comments.



Comment at: 
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/TestStdModuleWithConflicts.py:35
+
+self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+

aprantl wrote:
> what's that for?
I think that's how we set our executable as the target? It's frankly 
cargo-culted setup code that we use in a few hundred other tests.


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

https://reviews.llvm.org/D58125



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


[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

2019-03-04 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 189160.
teemperor added a comment.
Herald added a subscriber: ormris.

- Refactored build flags.
- Fixed doxygen comment.

Yeah, the implicit module map flag wasn't actually necessary for the tests, 
thanks! For the Makefile, I had to create a utility variable as `-gmodules` 
shouldn't be necessary for our tests, so the new flags are not really a 
superset of the normal module flags.


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

https://reviews.llvm.org/D58125

Files:
  lldb/include/lldb/Expression/ExpressionSourceCode.h
  lldb/include/lldb/Target/Platform.h
  lldb/include/lldb/Target/Target.h
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/TestImportStdModule.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/basic/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/TestStdModuleWithConflicts.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/TestMissingStdModule.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/no-std-module/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/TestStdModuleSysroot.py
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/main.cpp
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/c++/include/algorithm
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/c++/include/module.modulemap
  
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/sysroot/root/usr/include/libc_header.h
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/source/Expression/ExpressionSourceCode.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h
  lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
  lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
  lldb/source/Plugins/Platform/Linux/PlatformLinux.h
  lldb/source/Target/Target.cpp

Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -3328,6 +3328,9 @@
 {"auto-import-clang-modules", OptionValue::eTypeBoolean, false, true,
  nullptr, {},
  "Automatically load Clang modules referred to by the program."},
+{"import-std-module", OptionValue::eTypeBoolean, false, false,
+ nullptr, {},
+ "Import the C++ std module to improve debugging STL containers."},
 {"auto-apply-fixits", OptionValue::eTypeBoolean, false, true, nullptr,
  {}, "Automatically apply fix-it hints to expressions."},
 {"notify-about-fixits", OptionValue::eTypeBoolean, false, true, nullptr,
@@ -3466,6 +3469,7 @@
   ePropertyDebugFileSearchPaths,
   ePropertyClangModuleSearchPaths,
   ePropertyAutoImportClangModules,
+  ePropertyImportStdModule,
   ePropertyAutoApplyFixIts,
   ePropertyNotifyAboutFixIts,
   ePropertySaveObjects,
@@ -3888,6 +3892,12 @@
   nullptr, idx, g_properties[idx].default_uint_value != 0);
 }
 
+bool TargetProperties::GetEnableImportStdModule() const {
+  const uint32_t idx = ePropertyImportStdModule;
+  return m_collection_sp->GetPropertyAtIndexAsBoolean(
+  nullptr, idx, g_properties[idx].default_uint_value != 0);
+}
+
 bool TargetProperties::GetEnableAutoApplyFixIts() const {
   const uint32_t idx = ePropertyAutoApplyFixIts;
   return m_collection_sp->GetPropertyAtIndexAsBoolean(
Index: lldb/source/Plugins/Platform/Linux/PlatformLinux.h
===
--- lldb/source/Plugins/Platform/Linux/PlatformLinux.h
+++ lldb/source/Plugins/Platform/Linux/PlatformLinux.h
@@ -52,6 +52,9 @@
 
   bool CanDebugProcess() override;
 
+  std::vector
+  GetSystemIncludeDirectories(lldb::LanguageType lang) override;
+
   lldb::ProcessSP DebugProcess(ProcessLaunchInfo _info,
Debugger , Target *target,
Status ) override;
Index: 

[Lldb-commits] [PATCH] D58912: [debugserver] Fix IsUserReady thread filtering

2019-03-04 Thread Frederic Riss via Phabricator via lldb-commits
friss created this revision.
friss added reviewers: jasonmolenda, clayborg, jingham.
Herald added a subscriber: jdoerfert.

In 2010 (r118866), filtering code was added to debugserver to avoid reporting 
threads
that were "not ready to be displayed to the user". This code inspects the 
thread's
state and discards threads marked 'uninterruptible'. Turns out, this state is 
pretty
common and not only a characterisitic of 'user-readiness'. This filtering was 
tracked
down as the source of the flakiness of TestQueues and TestConcurrent* with the 
symptom
of missing threads.

We discussed with the kernel team and there should be no need for us to filter 
the
restult of task_threads(). Everything that is returned from there can be 
examined.
So I went on and tried to remove the filtering completely. This produces other 
test
failures, where we were reporting more theads than expected. Always threads 
that had
been terminated, but weren't removed from the task bookkeeping structures yet. 
Those
threads always had a PC of 0.

This patch changes the heuristic to make the filtering a little less strict and 
only
rejects threads that are 'uninteruptible' *and* have a PC of 0. This has proven 
to be
solid in my testing.


https://reviews.llvm.org/D58912

Files:
  tools/debugserver/source/MacOSX/MachThread.cpp


Index: tools/debugserver/source/MacOSX/MachThread.cpp
===
--- tools/debugserver/source/MacOSX/MachThread.cpp
+++ tools/debugserver/source/MacOSX/MachThread.cpp
@@ -243,7 +243,7 @@
   case TH_STATE_HALTED:
 return true;
   }
-  return false;
+  return GetPC(0) != 0;
 }
 
 struct thread_basic_info *MachThread::GetBasicInfo() {


Index: tools/debugserver/source/MacOSX/MachThread.cpp
===
--- tools/debugserver/source/MacOSX/MachThread.cpp
+++ tools/debugserver/source/MacOSX/MachThread.cpp
@@ -243,7 +243,7 @@
   case TH_STATE_HALTED:
 return true;
   }
-  return false;
+  return GetPC(0) != 0;
 }
 
 struct thread_basic_info *MachThread::GetBasicInfo() {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D57689: Adds property to force enabling of GDB JIT loader for MacOS

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

Yes, looks fine.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57689



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


[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

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

Thank you for writing the test. I think it's really great that we're able to 
test something like this without depending on the actual c++ library existing 
and supporting modules. (I think we should have more tests like that).




Comment at: lldb/include/lldb/Expression/ExpressionSourceCode.h:55
+   bool static_method, ExecutionContext _ctx, bool add_locals,
+   std::vector modules) const;
 

`ArrayRef` ?



Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:257
 
-CFLAGS += -I$(SRCDIR) -include $(THIS_FILE_DIR)test_common.h -I$(THIS_FILE_DIR)
+ifndef NO_INC_DIRS
+  CFLAGS += -I$(SRCDIR) -include $(THIS_FILE_DIR)test_common.h 
-I$(THIS_FILE_DIR)

I'm wondering why have you needed to do this (and whether we can figure out 
another solution to that).



Comment at: 
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:254
+  std::vector system_include_directories =
+  Platform::GetHostPlatform()->GetSystemIncludeDirectories(
+  lldb::eLanguageTypeC_plus_plus);

Shouldn't this use the platform of the currently executed target (instead of 
the host platform)?



Comment at: 
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:273
 : ExpressionParser(exe_scope, expr, generate_debug_info), m_compiler(),
-  m_pp_callbacks(nullptr) {
+  m_pp_callbacks(nullptr), m_include_directories(include_directories) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));

`m_include_directories(std::move(include_directories))`



Comment at: 
lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp:479-489
+  llvm::SmallString<64> path_string;
+  llvm::raw_svector_ostream stream(path_string);
+  for (const ConstString  : m.path)
+stream << s.AsCString() << '.';
+
+  // Drop trailing '.'.
+  if (!path_string.empty())

all of this can boil down to something like:
`LLDB_LOG(log, "Found module in compile unit: {0} - include dir: {1}", 
llvm::make_range(m.path.begin(), m.path.end()), m.search_path);`

(i'd recommend using LLDB_LOG elsewhere too, but here the benefit is really 
obvious).



Comment at: 
lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp:534-539
+llvm::SmallString<64> modules_list;
+llvm::raw_svector_ostream stream(modules_list);
+for (const std::string  : modules_to_include)
+  stream << " " << module << "\n";
+log->Printf("List of imported modules in expression:\n%sEnd of list",
+modules_list.c_str());

LLDB_LOG


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

https://reviews.llvm.org/D58125



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


[Lldb-commits] [lldb] r355323 - Refactor user/group name resolving code

2019-03-04 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Mar  4 10:48:00 2019
New Revision: 355323

URL: http://llvm.org/viewvc/llvm-project?rev=355323=rev
Log:
Refactor user/group name resolving code

Summary:
This creates an abstract base class called "UserIDResolver", which can
be implemented to provide user/group ID resolution capabilities for
various objects. Posix host implement a PosixUserIDResolver, which does
that using posix apis (getpwuid and friends).  PlatformGDBRemote
forwards queries over the gdb-remote link, etc. ProcessInstanceInfo
class is refactored to make use of this interface instead of taking a
platform pointer as an argument. The base resolver class already
implements caching and thread-safety, so implementations don't have to
worry about that.

The main motivating factor for this was to remove external dependencies
from the ProcessInstanceInfo class (so it can be put next to
ProcessLaunchInfo and friends), but it has other benefits too:
- ability to test the user name caching code
- ability to test ProcessInstanceInfo dumping code
- consistent interface for user/group resolution between Platform and
  Host classes.

Reviewers: zturner, clayborg, jingham

Subscribers: mgorny, lldb-commits

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

Added:
lldb/trunk/include/lldb/Utility/UserIDResolver.h
lldb/trunk/source/Utility/UserIDResolver.cpp
lldb/trunk/unittests/Target/ProcessInstanceInfoTest.cpp
lldb/trunk/unittests/Utility/UserIDResolverTest.cpp
Modified:
lldb/trunk/include/lldb/Host/HostInfoBase.h
lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h
lldb/trunk/include/lldb/Target/Platform.h
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/include/lldb/Target/RemoteAwarePlatform.h
lldb/trunk/source/Commands/CommandObjectPlatform.cpp
lldb/trunk/source/Host/posix/HostInfoPosix.cpp
lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.h
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/RemoteAwarePlatform.cpp
lldb/trunk/source/Utility/CMakeLists.txt
lldb/trunk/unittests/Target/CMakeLists.txt
lldb/trunk/unittests/Utility/CMakeLists.txt

Modified: lldb/trunk/include/lldb/Host/HostInfoBase.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostInfoBase.h?rev=355323=355322=355323=diff
==
--- lldb/trunk/include/lldb/Host/HostInfoBase.h (original)
+++ lldb/trunk/include/lldb/Host/HostInfoBase.h Mon Mar  4 10:48:00 2019
@@ -11,8 +11,8 @@
 
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/UserIDResolver.h"
 #include "lldb/lldb-enumerations.h"
-
 #include "llvm/ADT/StringRef.h"
 
 #include 
@@ -99,6 +99,8 @@ public:
   //---
   static ArchSpec GetAugmentedArchSpec(llvm::StringRef triple);
 
+  static UserIDResolver ();
+
 protected:
   static bool ComputeSharedLibraryDirectory(FileSpec _spec);
   static bool ComputeSupportExeDirectory(FileSpec _spec);

Modified: lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h?rev=355323=355322=355323=diff
==
--- lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h (original)
+++ lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h Mon Mar  4 10:48:00 2019
@@ -20,8 +20,7 @@ class HostInfoPosix : public HostInfoBas
 public:
   static size_t GetPageSize();
   static bool GetHostname(std::string );
-  static const char *LookupUserName(uint32_t uid, std::string _name);
-  static const char *LookupGroupName(uint32_t gid, std::string _name);
+  static UserIDResolver ();
 
   static uint32_t GetUserID();
   static uint32_t GetGroupID();

Modified: lldb/trunk/include/lldb/Target/Platform.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=355323=355322=355323=diff
==
--- lldb/trunk/include/lldb/Target/Platform.h (original)
+++ lldb/trunk/include/lldb/Target/Platform.h Mon Mar  4 10:48:00 2019
@@ -23,6 +23,7 @@
 #include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/Timeout.h"
+#include "lldb/Utility/UserIDResolver.h"
 #include "lldb/lldb-private-forward.h"
 #include "lldb/lldb-public.h"
 #include "llvm/Support/VersionTuple.h"
@@ -276,9 +277,7 @@ public:
 
   virtual bool SetRemoteWorkingDirectory(const FileSpec _dir);
 
-  virtual const char *GetUserName(uint32_t uid);
-
-  virtual const char 

[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

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



Comment at: lldb/include/lldb/Target/Platform.h:283
+  ///
+  /// @param[in] lang
+  /// The language for which the include directories should be queried.

`\param`



Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:291
+# -glldb is necessary for emitting information about what modules were 
imported.
+MANDATORY_CXXMODULE_BUILD_CFLAGS := -fmodules -fcxx-modules 
-fmodules-cache-path=$(CLANG_MODULE_CACHE_DIR) -glldb -fimplicit-module-maps
 

`$(MANDATORY_MODULE_BUILD_CFLAG) -cfxx-modules -glldb` ?
Why is -fimplicit-module-maps only on the C++ case?


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

https://reviews.llvm.org/D58125



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


[Lldb-commits] [lldb] r355353 - [Host] Fix the build (and the modules build).

2019-03-04 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Mar  4 16:37:40 2019
New Revision: 355353

URL: http://llvm.org/viewvc/llvm-project?rev=355353=rev
Log:
[Host] Fix the build (and the modules build).

-> Add a missing include to find the base class.
-> Add a missing out-of-line declaration for a member function.

Modified:
lldb/trunk/include/lldb/Host/HostInfoBase.h
lldb/trunk/source/Host/posix/HostInfoPosix.cpp

Modified: lldb/trunk/include/lldb/Host/HostInfoBase.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostInfoBase.h?rev=355353=355352=355353=diff
==
--- lldb/trunk/include/lldb/Host/HostInfoBase.h (original)
+++ lldb/trunk/include/lldb/Host/HostInfoBase.h Mon Mar  4 16:37:40 2019
@@ -11,6 +11,7 @@
 
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/UserIDResolver.h"
 #include "lldb/lldb-enumerations.h"
 #include "llvm/ADT/StringRef.h"
 
@@ -98,6 +99,8 @@ public:
   //---
   static ArchSpec GetAugmentedArchSpec(llvm::StringRef triple);
 
+  static UserIDResolver ();
+
 protected:
   static bool ComputeSharedLibraryDirectory(FileSpec _spec);
   static bool ComputeSupportExeDirectory(FileSpec _spec);

Modified: lldb/trunk/source/Host/posix/HostInfoPosix.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/HostInfoPosix.cpp?rev=355353=355352=355353=diff
==
--- lldb/trunk/source/Host/posix/HostInfoPosix.cpp (original)
+++ lldb/trunk/source/Host/posix/HostInfoPosix.cpp Mon Mar  4 16:37:40 2019
@@ -7,6 +7,7 @@
 
//===--===//
 
 #include "lldb/Host/posix/HostInfoPosix.h"
+#include "lldb/Utility/UserIDResolver.h"
 #include "lldb/Utility/Log.h"
 
 #include "llvm/ADT/SmallString.h"


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


[Lldb-commits] [PATCH] D58912: [debugserver] Fix IsUserReady thread filtering

2019-03-04 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

Will this hide a thread that jumps through a null function pointer?  That's the 
only user process case where a pc of 0 needs to be reported to the developer.


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

https://reviews.llvm.org/D58912



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


[Lldb-commits] [lldb] r355351 - [DataFormatters] Fix regression in libc++ std::atomic formatter caused by https://reviews.llvm.org/D56913

2019-03-04 Thread Shafik Yaghmour via lldb-commits
Author: shafik
Date: Mon Mar  4 16:17:18 2019
New Revision: 355351

URL: http://llvm.org/viewvc/llvm-project?rev=355351=rev
Log:
[DataFormatters] Fix regression in libc++ std::atomic formatter caused by 
https://reviews.llvm.org/D56913

rdar://problem/48568543

Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp?rev=355351=355350=355351=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp Mon Mar  4 
16:17:18 2019
@@ -15,11 +15,25 @@ using namespace lldb_private::formatters
 
 bool lldb_private::formatters::LibCxxAtomicSummaryProvider(
 ValueObject , Stream , const TypeSummaryOptions ) {
-  static ConstString g___a_("__a_");
 
-  if (ValueObjectSP child = valobj.GetChildMemberWithName(g___a_, true)) {
+  ValueObjectSP non_sythetic = valobj.GetNonSyntheticValue();
+  if (!non_sythetic)
+return false;
+
+  ValueObjectSP index_zero = non_sythetic->GetChildAtIndex(0, true);
+  if (!index_zero)
+return false;
+
+  ValueObjectSP member__a_ =
+  index_zero->GetChildMemberWithName(ConstString("__a_"), true);
+  if (!member__a_)
+return false;
+
+  if (ValueObjectSP member__a_value =
+  member__a_->GetChildMemberWithName(ConstString("__a_value"), true)) {
 std::string summary;
-if (child->GetSummaryAsCString(summary, options) && summary.size() > 0) {
+if (member__a_value->GetSummaryAsCString(summary, options) &&
+summary.size() > 0) {
   stream.Printf("%s", summary.c_str());
   return true;
 }
@@ -59,9 +73,17 @@ lldb_private::formatters::LibcxxStdAtomi
 : SyntheticChildrenFrontEnd(*valobj_sp), m_real_child(nullptr) {}
 
 bool lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::Update() {
-  static ConstString g___a_("__a_");
+  ValueObjectSP index_zero = m_backend.GetChildAtIndex(0, true);
+  if (!index_zero)
+return false;
+
+  ValueObjectSP member__a_ =
+  index_zero->GetChildMemberWithName(ConstString("__a_"), true);
+  if (!member__a_)
+return false;
 
-  m_real_child = m_backend.GetChildMemberWithName(g___a_, true).get();
+  m_real_child =
+  member__a_->GetChildMemberWithName(ConstString("__a_value"), true).get();
 
   return false;
 }


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


[Lldb-commits] [lldb] r355364 - Revert "[testsuite] Port crashlog and dependencies to Python 3."

2019-03-04 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Mar  4 17:34:47 2019
New Revision: 355364

URL: http://llvm.org/viewvc/llvm-project?rev=355364=rev
Log:
Revert "[testsuite] Port crashlog and dependencies to Python 3."

This revert the commit because it broke the bots. I need to find
a way that works with both versions.

Modified:
lldb/trunk/examples/darwin/heap_find/heap.py
lldb/trunk/examples/python/crashlog.py
lldb/trunk/examples/python/symbolication.py

Modified: lldb/trunk/examples/darwin/heap_find/heap.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/darwin/heap_find/heap.py?rev=355364=355363=355364=diff
==
--- lldb/trunk/examples/darwin/heap_find/heap.py (original)
+++ lldb/trunk/examples/darwin/heap_find/heap.py Mon Mar  4 17:34:47 2019
@@ -8,12 +8,8 @@
 #   (lldb) script import lldb.macosx.heap
 #--
 
-from __future__ import print_function
-from builtins import str
-from builtins import hex
-from builtins import range
 import lldb
-import subprocess
+import commands
 import optparse
 import os
 import os.path
@@ -232,7 +228,7 @@ def append_regex_callback(option, opt, v
 ivar_regex = re.compile(value)
 parser.values.ivar_regex_blacklist.append(ivar_regex)
 except:
-print('error: an exception was thrown when compiling the ivar regular 
expression for "%s"' % value)
+print 'error: an exception was thrown when compiling the ivar regular 
expression for "%s"' % value
 
 
 def add_common_options(parser):
@@ -393,16 +389,16 @@ def find_variable_containing_address(ver
 if var_addr != lldb.LLDB_INVALID_ADDRESS:
 byte_size = var.GetType().GetByteSize()
 if verbose:
-print('frame #%u: [%#x - %#x) %s' % (frame.GetFrameID(), 
var.load_addr, var.load_addr + byte_size, var.name))
+print 'frame #%u: [%#x - %#x) %s' % (frame.GetFrameID(), 
var.load_addr, var.load_addr + byte_size, var.name)
 if var_addr == match_addr:
 if verbose:
-print('match')
+print 'match'
 return var
 else:
 if byte_size > 0 and var_addr <= match_addr and match_addr < (
 var_addr + byte_size):
 if verbose:
-print('match')
+print 'match'
 return var
 return None
 
@@ -620,10 +616,10 @@ lldb_info''' % (options.max_frames, opti
 expr_options.SetPrefix(expr_prefix)
 expr_sbvalue = frame.EvaluateExpression(expr, expr_options)
 if options.verbose:
-print("expression:")
-print(expr)
-print("expression result:")
-print(expr_sbvalue)
+print "expression:"
+print expr
+print "expression result:"
+print expr_sbvalue
 if expr_sbvalue.error.Success():
 if history:
 malloc_stack_history = lldb.value(expr_sbvalue)
@@ -674,10 +670,10 @@ def display_match_results(
 expr_options.SetPrefix(expr_prefix)
 expr_sbvalue = frame.EvaluateExpression(expr, expr_options)
 if options.verbose:
-print("expression:")
-print(expr)
-print("expression result:")
-print(expr_sbvalue)
+print "expression:"
+print expr
+print "expression result:"
+print expr_sbvalue
 if expr_sbvalue.error.Success():
 match_value = lldb.value(expr_sbvalue)
 i = 0
@@ -867,14 +863,14 @@ def find_variable(debugger, command, res
 
 for arg in args:
 var_addr = int(arg, 16)
-print("Finding a variable with address %#x..." % (var_addr), 
file=result)
+print >>result, "Finding a variable with address %#x..." % (var_addr)
 done = False
 for thread in process:
 for frame in thread:
 var = find_variable_containing_address(
 options.verbose, frame, var_addr)
 if var:
-print(var)
+print var
 done = True
 break
 if done:
@@ -1523,4 +1519,4 @@ lldb.debugger.HandleCommand(
 lldb.debugger.HandleCommand(
 'command script add -f %s.objc_refs objc_refs' %
 __name__)
-print('"malloc_info", "ptr_refs", "cstr_refs", "find_variable", and 
"objc_refs" commands have been installed, use the "--help" options on these 
commands for detailed help.')
+print '"malloc_info", "ptr_refs", "cstr_refs", "find_variable", and 
"objc_refs" commands have been installed, use the "--help" options on these 
commands for detailed help.'

Modified: lldb/trunk/examples/python/crashlog.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/crashlog.py?rev=355364=355363=355364=diff
==
--- 

[Lldb-commits] [PATCH] D58912: [debugserver] Fix IsUserReady thread filtering

2019-03-04 Thread Frederic Riss via Phabricator via lldb-commits
friss added a comment.

In D58912#1417570 , @jasonmolenda 
wrote:

> Will this hide a thread that jumps through a null function pointer?  That's 
> the only user process case where a pc of 0 needs to be reported to the 
> developer.


Nope, I tested this explicitly and when we crash through a NULL pointer the 
backtrace is correct. Note that the added test is exercised only in the case 
where the thread state is TH_STATE_UNINTERRUPTIBLE, which seems to be very 
special (and not what you get when crashed).


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

https://reviews.llvm.org/D58912



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


[Lldb-commits] [PATCH] D58930: Add XCOFF triple object format type for AIX

2019-03-04 Thread Hubert Tong via Phabricator via lldb-commits
hubert.reinterpretcast added inline comments.



Comment at: llvm/lib/Support/Triple.cpp:537
   return StringSwitch(EnvironmentName)
+// FIXME: We have to put XCOFF before COFF;
+// perhaps an order-independent pattern matching is desired?

If the conclusion is that checking XCOFF before COFF is fine, then we should 
remove the FIXME and just leave a normal comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D58930



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


[Lldb-commits] [PATCH] D58930: Add XCOFF triple object format type for AIX

2019-03-04 Thread Jason Liu via Phabricator via lldb-commits
jasonliu created this revision.
jasonliu added reviewers: hubert.reinterpretcast, sfertile, chandlerc, 
apaprocki.
Herald added subscribers: llvm-commits, lldb-commits, cfe-commits, dexonsmith, 
aheejin, hiraditya, javed.absar.
Herald added projects: clang, LLDB, LLVM.

This patch adds an XCOFF triple object format type into LLVM. This XCOFF triple 
object file type will be used later by object file and assembly generation for 
the AIX platform.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D58930

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/CodeGen/CodeGenModule.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  llvm/include/llvm/ADT/Triple.h
  llvm/include/llvm/MC/MCObjectFileInfo.h
  llvm/lib/MC/MCContext.cpp
  llvm/lib/MC/MCObjectFileInfo.cpp
  llvm/lib/MC/MCParser/AsmParser.cpp
  llvm/lib/Support/Triple.cpp
  llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  llvm/unittests/ADT/TripleTest.cpp

Index: llvm/unittests/ADT/TripleTest.cpp
===
--- llvm/unittests/ADT/TripleTest.cpp
+++ llvm/unittests/ADT/TripleTest.cpp
@@ -1258,6 +1258,11 @@
   EXPECT_EQ(Triple::Wasm,
 Triple("wasm64-unknown-wasi-musl-wasm").getObjectFormat());
 
+  EXPECT_EQ(Triple::XCOFF, Triple("powerpc-ibm-aix").getObjectFormat());
+  EXPECT_EQ(Triple::XCOFF, Triple("powerpc64-ibm-aix").getObjectFormat());
+  EXPECT_EQ(Triple::XCOFF, Triple("powerpc---xcoff").getObjectFormat());
+  EXPECT_EQ(Triple::XCOFF, Triple("powerpc64---xcoff").getObjectFormat());
+
   Triple MSVCNormalized(Triple::normalize("i686-pc-windows-msvc-elf"));
   EXPECT_EQ(Triple::ELF, MSVCNormalized.getObjectFormat());
 
@@ -1276,6 +1281,9 @@
 
   T.setObjectFormat(Triple::MachO);
   EXPECT_EQ(Triple::MachO, T.getObjectFormat());
+  
+  T.setObjectFormat(Triple::XCOFF);
+  EXPECT_EQ(Triple::XCOFF, T.getObjectFormat());
 }
 
 TEST(TripleTest, NormalizeWindows) {
Index: llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
===
--- llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -5594,6 +5594,9 @@
   case MCObjectFileInfo::IsWasm:
 CurrentFormat = WASM;
 break;
+  case MCObjectFileInfo::IsXCOFF:
+llvm_unreachable("unexpected object format");
+break;
   }
 
   if (~Prefix->SupportedFormats & CurrentFormat) {
Index: llvm/lib/Support/Triple.cpp
===
--- llvm/lib/Support/Triple.cpp
+++ llvm/lib/Support/Triple.cpp
@@ -534,6 +534,9 @@
 
 static Triple::ObjectFormatType parseFormat(StringRef EnvironmentName) {
   return StringSwitch(EnvironmentName)
+// FIXME: We have to put XCOFF before COFF;
+// perhaps an order-independent pattern matching is desired?
+.EndsWith("xcoff", Triple::XCOFF)
 .EndsWith("coff", Triple::COFF)
 .EndsWith("elf", Triple::ELF)
 .EndsWith("macho", Triple::MachO)
@@ -622,6 +625,7 @@
   case Triple::ELF: return "elf";
   case Triple::MachO: return "macho";
   case Triple::Wasm: return "wasm";
+  case Triple::XCOFF: return "xcoff";
   }
   llvm_unreachable("unknown object format type");
 }
@@ -686,6 +690,8 @@
   case Triple::ppc64:
 if (T.isOSDarwin())
   return Triple::MachO;
+else if (T.isOSAIX())
+  return Triple::XCOFF;
 return Triple::ELF;
 
   case Triple::wasm32:
Index: llvm/lib/MC/MCParser/AsmParser.cpp
===
--- llvm/lib/MC/MCParser/AsmParser.cpp
+++ llvm/lib/MC/MCParser/AsmParser.cpp
@@ -710,6 +710,9 @@
   case MCObjectFileInfo::IsWasm:
 PlatformParser.reset(createWasmAsmParser());
 break;
+  case MCObjectFileInfo::IsXCOFF:
+// TODO: Need to implement createXCOFFAsmParser for XCOFF format.
+break;
   }
 
   PlatformParser->Initialize(*this);
Index: llvm/lib/MC/MCObjectFileInfo.cpp
===
--- llvm/lib/MC/MCObjectFileInfo.cpp
+++ llvm/lib/MC/MCObjectFileInfo.cpp
@@ -801,6 +801,10 @@
 Env = IsWasm;
 initWasmMCObjectFileInfo(TT);
 break;
+  case Triple::XCOFF:
+Env = IsXCOFF;
+// TODO: Initialize MCObjectFileInfo for XCOFF format when MCSectionXCOFF is ready.
+break;
   case Triple::UnknownObjectFormat:
 report_fatal_error("Cannot initialize MC for unknown object file format.");
 break;
@@ -816,6 +820,7 @@
   case Triple::MachO:
   case Triple::COFF:
   case Triple::Wasm:
+  case Triple::XCOFF:
   case Triple::UnknownObjectFormat:
 report_fatal_error("Cannot get DWARF comdat section for this object file "
"format: not implemented.");
Index: llvm/lib/MC/MCContext.cpp
===
--- llvm/lib/MC/MCContext.cpp
+++ llvm/lib/MC/MCContext.cpp
@@ -161,6 +161,9 @@
   return new (Name, *this) MCSymbolMachO(Name, IsTemporary);
 case 

[Lldb-commits] [PATCH] D58838: Remove tautological #ifdefs

2019-03-04 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

Ping. As far as I can tell, now this patch should be entirely NFC.


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

https://reviews.llvm.org/D58838



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


[Lldb-commits] [lldb] r355358 - Fix the Xcode project for UserIDResolver.

2019-03-04 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Mon Mar  4 16:52:12 2019
New Revision: 355358

URL: http://llvm.org/viewvc/llvm-project?rev=355358=rev
Log:
Fix the Xcode project for UserIDResolver.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=355358=355357=355358=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Mar  4 16:52:12 2019
@@ -649,7 +649,7 @@
26BC17AB18C7F4CB00D2196D /* ProcessElfCore.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26BC17A218C7F4CB00D2196D /* ProcessElfCore.cpp 
*/; };
2689009F13353E4200698AC0 /* ProcessGDBRemote.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 2618EE5F1315B29C001D6D71 /* 
ProcessGDBRemote.cpp */; };
268900A013353E4200698AC0 /* ProcessGDBRemoteLog.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 2618EE611315B29C001D6D71 /* 
ProcessGDBRemoteLog.cpp */; };
-   233B007D1960C9F90090E598 /* ProcessInfo.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 233B007B1960C9E60090E598 /* ProcessInfo.cpp */; 
};
+   4CC57FA1222DFEA40067B7EA /* ProcessInfo.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4CC57F9F222DFEA40067B7EA /* ProcessInfo.cpp */; 
};
2642FBB013D003B400ED6808 /* ProcessKDP.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 2642FBAA13D003B400ED6808 /* ProcessKDP.cpp */; };
2642FBB213D003B400ED6808 /* ProcessKDPLog.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 2642FBAC13D003B400ED6808 /* ProcessKDPLog.cpp 
*/; };
233B007F1960CB280090E598 /* ProcessLaunchInfo.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 233B007E1960CB280090E598 /* 
ProcessLaunchInfo.cpp */; };
@@ -1044,6 +1044,7 @@
23CB15351D66DA9300EDDDE1 /* UriParserTest.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 2321F9461BDD346100BA9A93 /* UriParserTest.cpp 
*/; };
4C88BC2D1BA391B000AA0964 /* UserExpression.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C0083331B9A5DE200D5CF24 /* UserExpression.cpp 
*/; };
AFC2DCEB1E6E2F7D00283714 /* UserID.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AFC2DCEA1E6E2F7D00283714 /* UserID.cpp */; };
+   4CC57FADFEA40067B7EA /* UserIDResolver.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4CC57FA0222DFEA40067B7EA /* UserIDResolver.cpp 
*/; };
2689005413353E0400698AC0 /* UserSettingsController.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 9A4633DC11F65D9A00955CE1 /* 
UserSettingsController.cpp */; };
4C0083401B9F9BA900D5CF24 /* UtilityFunction.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp 
*/; };
2654A6901E552ED500DA1013 /* VASprintf.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 2654A68F1E552ED500DA1013 /* VASprintf.cpp */; };
@@ -2532,7 +2533,7 @@
2618EE601315B29C001D6D71 /* ProcessGDBRemote.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
ProcessGDBRemote.h; sourceTree = ""; };
2618EE611315B29C001D6D71 /* ProcessGDBRemoteLog.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = ProcessGDBRemoteLog.cpp; sourceTree = ""; };
2618EE621315B29C001D6D71 /* ProcessGDBRemoteLog.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
ProcessGDBRemoteLog.h; sourceTree = ""; };
-   233B007B1960C9E60090E598 /* ProcessInfo.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = ProcessInfo.cpp; sourceTree = ""; };
+   4CC57F9F222DFEA40067B7EA /* ProcessInfo.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = ProcessInfo.cpp; path = source/Utility/ProcessInfo.cpp; sourceTree = 
""; };
2642FBAA13D003B400ED6808 /* ProcessKDP.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = ProcessKDP.cpp; sourceTree = ""; };
2642FBAB13D003B400ED6808 /* ProcessKDP.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
ProcessKDP.h; sourceTree = ""; };
2642FBAC13D003B400ED6808 /* ProcessKDPLog.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = ProcessKDPLog.cpp; sourceTree = ""; };
@@ -3231,6 +3232,8 @@
4C00832E1B9A58A700D5CF24 /* UserExpression.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
UserExpression.h; path = include/lldb/Expression/UserExpression.h; 

[Lldb-commits] [lldb] r355375 - [Expression] Remove unused parameter from Evaluate

2019-03-04 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Mon Mar  4 19:33:34 2019
New Revision: 355375

URL: http://llvm.org/viewvc/llvm-project?rev=355375=rev
Log:
[Expression] Remove unused parameter from Evaluate

Modified:
lldb/trunk/include/lldb/Expression/UserExpression.h
lldb/trunk/source/Expression/REPL.cpp
lldb/trunk/source/Expression/UserExpression.cpp
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Expression/UserExpression.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/UserExpression.h?rev=355375=355374=355375=diff
==
--- lldb/trunk/include/lldb/Expression/UserExpression.h (original)
+++ lldb/trunk/include/lldb/Expression/UserExpression.h Mon Mar  4 19:33:34 2019
@@ -261,10 +261,6 @@ public:
   /// Filled in with an error in case the expression evaluation
   /// fails to parse, run, or evaluated.
   ///
-  /// @param[in] line_offset
-  /// The offset of the first line of the expression from the "beginning" 
of
-  /// a virtual source file used for error reporting and debug info.
-  ///
   /// @param[out] fixed_expression
   /// If non-nullptr, the fixed expression is copied into the provided
   /// string.
@@ -290,7 +286,7 @@ public:
   Evaluate(ExecutionContext _ctx, const EvaluateExpressionOptions ,
llvm::StringRef expr_cstr, llvm::StringRef expr_prefix,
lldb::ValueObjectSP _valobj_sp, Status ,
-   uint32_t line_offset = 0, std::string *fixed_expression = nullptr,
+   std::string *fixed_expression = nullptr,
lldb::ModuleSP *jit_module_sp_ptr = nullptr,
ValueObject *ctx_obj = nullptr);
 

Modified: lldb/trunk/source/Expression/REPL.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/REPL.cpp?rev=355375=355374=355375=diff
==
--- lldb/trunk/source/Expression/REPL.cpp (original)
+++ lldb/trunk/source/Expression/REPL.cpp Mon Mar  4 19:33:34 2019
@@ -307,7 +307,6 @@ void REPL::IOHandlerInputComplete(IOHand
   lldb::ExpressionResults execution_results =
   UserExpression::Evaluate(exe_ctx, expr_options, code.c_str(),
expr_prefix, result_valobj_sp, error,
-   0,   // Line offset
nullptr, // Fixed Expression
_module_sp);
 

Modified: lldb/trunk/source/Expression/UserExpression.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/UserExpression.cpp?rev=355375=355374=355375=diff
==
--- lldb/trunk/source/Expression/UserExpression.cpp (original)
+++ lldb/trunk/source/Expression/UserExpression.cpp Mon Mar  4 19:33:34 2019
@@ -139,7 +139,7 @@ lldb::addr_t UserExpression::GetObjectPo
 lldb::ExpressionResults UserExpression::Evaluate(
 ExecutionContext _ctx, const EvaluateExpressionOptions ,
 llvm::StringRef expr, llvm::StringRef prefix,
-lldb::ValueObjectSP _valobj_sp, Status , uint32_t line_offset,
+lldb::ValueObjectSP _valobj_sp, Status ,
 std::string *fixed_expression, lldb::ModuleSP *jit_module_sp_ptr,
 ValueObject *ctx_obj) {
   Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_EXPRESSIONS |

Modified: lldb/trunk/source/Target/Target.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=355375=355374=355375=diff
==
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Mon Mar  4 19:33:34 2019
@@ -2401,12 +2401,11 @@ ExpressionResults Target::EvaluateExpres
   } else {
 llvm::StringRef prefix = GetExpressionPrefixContents();
 Status error;
-execution_results = UserExpression::Evaluate(exe_ctx, options, expr, 
prefix,
- result_valobj_sp, error,
- 0, // Line Number
- fixed_expression,
- nullptr, // Module
- ctx_obj);
+execution_results =
+UserExpression::Evaluate(exe_ctx, options, expr, prefix,
+ result_valobj_sp, error, fixed_expression,
+ nullptr, // Module
+ ctx_obj);
   }
 
   m_suppress_stop_hooks = old_suppress_value;


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


[Lldb-commits] [PATCH] D58838: Remove tautological #ifdefs

2019-03-04 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.

LGTM.


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

https://reviews.llvm.org/D58838



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


[Lldb-commits] [lldb] r355359 - [testsuite] Port crashlog and dependencies to Python 3.

2019-03-04 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Mar  4 16:53:38 2019
New Revision: 355359

URL: http://llvm.org/viewvc/llvm-project?rev=355359=rev
Log:
[testsuite] Port crashlog and dependencies to Python 3.

Fixes three tests in the testsuite.

Modified:
lldb/trunk/examples/darwin/heap_find/heap.py
lldb/trunk/examples/python/crashlog.py
lldb/trunk/examples/python/symbolication.py

Modified: lldb/trunk/examples/darwin/heap_find/heap.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/darwin/heap_find/heap.py?rev=355359=355358=355359=diff
==
--- lldb/trunk/examples/darwin/heap_find/heap.py (original)
+++ lldb/trunk/examples/darwin/heap_find/heap.py Mon Mar  4 16:53:38 2019
@@ -8,8 +8,12 @@
 #   (lldb) script import lldb.macosx.heap
 #--
 
+from __future__ import print_function
+from builtins import str
+from builtins import hex
+from builtins import range
 import lldb
-import commands
+import subprocess
 import optparse
 import os
 import os.path
@@ -228,7 +232,7 @@ def append_regex_callback(option, opt, v
 ivar_regex = re.compile(value)
 parser.values.ivar_regex_blacklist.append(ivar_regex)
 except:
-print 'error: an exception was thrown when compiling the ivar regular 
expression for "%s"' % value
+print('error: an exception was thrown when compiling the ivar regular 
expression for "%s"' % value)
 
 
 def add_common_options(parser):
@@ -389,16 +393,16 @@ def find_variable_containing_address(ver
 if var_addr != lldb.LLDB_INVALID_ADDRESS:
 byte_size = var.GetType().GetByteSize()
 if verbose:
-print 'frame #%u: [%#x - %#x) %s' % (frame.GetFrameID(), 
var.load_addr, var.load_addr + byte_size, var.name)
+print('frame #%u: [%#x - %#x) %s' % (frame.GetFrameID(), 
var.load_addr, var.load_addr + byte_size, var.name))
 if var_addr == match_addr:
 if verbose:
-print 'match'
+print('match')
 return var
 else:
 if byte_size > 0 and var_addr <= match_addr and match_addr < (
 var_addr + byte_size):
 if verbose:
-print 'match'
+print('match')
 return var
 return None
 
@@ -616,10 +620,10 @@ lldb_info''' % (options.max_frames, opti
 expr_options.SetPrefix(expr_prefix)
 expr_sbvalue = frame.EvaluateExpression(expr, expr_options)
 if options.verbose:
-print "expression:"
-print expr
-print "expression result:"
-print expr_sbvalue
+print("expression:")
+print(expr)
+print("expression result:")
+print(expr_sbvalue)
 if expr_sbvalue.error.Success():
 if history:
 malloc_stack_history = lldb.value(expr_sbvalue)
@@ -670,10 +674,10 @@ def display_match_results(
 expr_options.SetPrefix(expr_prefix)
 expr_sbvalue = frame.EvaluateExpression(expr, expr_options)
 if options.verbose:
-print "expression:"
-print expr
-print "expression result:"
-print expr_sbvalue
+print("expression:")
+print(expr)
+print("expression result:")
+print(expr_sbvalue)
 if expr_sbvalue.error.Success():
 match_value = lldb.value(expr_sbvalue)
 i = 0
@@ -863,14 +867,14 @@ def find_variable(debugger, command, res
 
 for arg in args:
 var_addr = int(arg, 16)
-print >>result, "Finding a variable with address %#x..." % (var_addr)
+print("Finding a variable with address %#x..." % (var_addr), 
file=result)
 done = False
 for thread in process:
 for frame in thread:
 var = find_variable_containing_address(
 options.verbose, frame, var_addr)
 if var:
-print var
+print(var)
 done = True
 break
 if done:
@@ -1519,4 +1523,4 @@ lldb.debugger.HandleCommand(
 lldb.debugger.HandleCommand(
 'command script add -f %s.objc_refs objc_refs' %
 __name__)
-print '"malloc_info", "ptr_refs", "cstr_refs", "find_variable", and 
"objc_refs" commands have been installed, use the "--help" options on these 
commands for detailed help.'
+print('"malloc_info", "ptr_refs", "cstr_refs", "find_variable", and 
"objc_refs" commands have been installed, use the "--help" options on these 
commands for detailed help.')

Modified: lldb/trunk/examples/python/crashlog.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/crashlog.py?rev=355359=355358=355359=diff
==
--- lldb/trunk/examples/python/crashlog.py (original)
+++ 

Re: [Lldb-commits] [PATCH] D58727: https://reviews.llvm.org/D58394 done right

2019-03-04 Thread Jim Ingham via lldb-commits
The event we are stopping for is the stop to single step over a breakpoint.  We 
should have decided not to broadcast that to the public event queue, since it's 
an implementation stop of the "continue".  It almost looks like the stop hook 
is getting triggered by a not-broadcast event, though that doesn't make sense.

I'll have to look at this more closely, I'm in the middle of something else 
right now.  Thanks for adding the Unsupported...

Jim


> On Mar 2, 2019, at 11:54 AM, Pavel Labath  wrote:
> 
> On 01/03/2019 14:55, Pavel Labath via Phabricator wrote:
>> labath accepted this revision.
>> labath added a comment.
>> This revision is now accepted and ready to land.
>> Yes, that did the trick. The new test is passing on linux now as well.
>> Regarding BTW, I see the option to "reopen a revision" in the drop down menu 
>> at the bottom of the page (the same one you use to accept the revision and 
>> stuff). AFAICT, even I am able to reopen that other revision.
> 
> Hmm.. it seems this did not fully fix the problem (at least on linux), 
> because I am still seeing random failures (usually when the system is under 
> load).
> 
> I've captured the logs of both failing and successful runs, but I'm not 
> exactly sure what to make of it. Things start to get interesting around line 
> 22610 in bad.log, where we do a "vCont;s" to step over the breakpoint. 
> However, it seems that the public thread does not wait for the single step to 
> complete, and immediately starts to compute backtraces of threads (as if we 
> just performed the final stop). Around lines 22700--22800 you can see that 
> the public thread's backtrace computing runs concurrently with the ShouldStop 
> processing on the private thread, which doesn't seem right to me. Things get 
> very confusing after that, but the end result seems to be that the process 
> gets killed (maybe because we've reached the end of the batch file) without 
> it having completed all prescribed stops.
> 
> Do you have any idea what's going on here?
> 
> PS: For the time being, I've reinstated the "UNSUPPORTED: linux" stanza on 
> this test as the test fails pretty frequently for me.
> 
> regards,
> pavel
> 

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


[Lldb-commits] [lldb] r355356 - [lldbtest] Check against the correct name for libcxxabi (macOS).

2019-03-04 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Mar  4 16:47:15 2019
New Revision: 355356

URL: http://llvm.org/viewvc/llvm-project?rev=355356=rev
Log:
[lldbtest] Check against the correct name for libcxxabi (macOS).

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

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=355356=355355=355356=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Mar  4 16:47:15 
2019
@@ -1703,7 +1703,7 @@ class Base(unittest2.TestCase):
 if self.getPlatform() in ('freebsd', 'linux', 'netbsd', 'openbsd'):
 return ['libc++.so.1']
 else:
-return ['libc++.1.dylib', 'libc++abi.dylib']
+return ['libc++.1.dylib', 'libc++abi.1.dylib']
 
 # Metaclass for TestBase to change the list of test metods when a new TestCase 
is loaded.
 # We change the test methods to create a new test method for each test for 
each debug info we are


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


[Lldb-commits] [PATCH] D57689: Adds property to force enabling of GDB JIT loader for MacOS

2019-03-04 Thread Yury Delendik via Phabricator via lldb-commits
yurydelendik updated this revision to Diff 189244.
yurydelendik added a comment.

rebase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57689

Files:
  lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/Makefile
  
lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
  lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.c
  lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.mk
  lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp

Index: lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
===
--- lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
+++ lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
@@ -59,11 +59,27 @@
 
 namespace {
 
+enum EnableJITLoaderGDB {
+  eEnableJITLoaderGDBDefault,
+  eEnableJITLoaderGDBOn,
+  eEnableJITLoaderGDBOff,
+};
+
+static constexpr OptionEnumValueElement g_enable_jit_loader_gdb_enumerators[] = {
+{eEnableJITLoaderGDBDefault, "default", "Enable JIT compilation interface "
+ "for all platforms except macOS"},
+{eEnableJITLoaderGDBOn, "on", "Enable JIT compilation interface"},
+{eEnableJITLoaderGDBOff, "off", "Disable JIT compilation interface"}
+ };
+
 static constexpr PropertyDefinition g_properties[] = {
-{"enable-jit-breakpoint", OptionValue::eTypeBoolean, true, true, nullptr,
- {}, "Enable breakpoint on __jit_debug_register_code."}};
+{"enable", OptionValue::eTypeEnum, true,
+ eEnableJITLoaderGDBDefault, nullptr,
+ OptionEnumValues(g_enable_jit_loader_gdb_enumerators),
+ "Enable GDB's JIT compilation interface (default: enabled on "
+ "all platforms except macOS)"}};
 
-enum { ePropertyEnableJITBreakpoint };
+enum { ePropertyEnable, ePropertyEnableJITBreakpoint };
 
 class PluginProperties : public Properties {
 public:
@@ -76,10 +92,10 @@
 m_collection_sp->Initialize(g_properties);
   }
 
-  bool GetEnableJITBreakpoint() const {
-return m_collection_sp->GetPropertyAtIndexAsBoolean(
-nullptr, ePropertyEnableJITBreakpoint,
-g_properties[ePropertyEnableJITBreakpoint].default_uint_value != 0);
+  EnableJITLoaderGDB GetEnable() const {
+return (EnableJITLoaderGDB)m_collection_sp->GetPropertyAtIndexAsEnumeration(
+nullptr, ePropertyEnable,
+g_properties[ePropertyEnable].default_uint_value);
   }
 };
 
@@ -165,9 +181,6 @@
 // Setup the JIT Breakpoint
 //--
 void JITLoaderGDB::SetJITBreakpoint(lldb_private::ModuleList _list) {
-  if (!GetGlobalPluginProperties()->GetEnableJITBreakpoint())
-return;
-
   if (DidSetJITBreakpoint())
 return;
 
@@ -402,8 +415,20 @@
 
 JITLoaderSP JITLoaderGDB::CreateInstance(Process *process, bool force) {
   JITLoaderSP jit_loader_sp;
-  ArchSpec arch(process->GetTarget().GetArchitecture());
-  if (arch.GetTriple().getVendor() != llvm::Triple::Apple)
+  bool enable;
+  switch (GetGlobalPluginProperties()->GetEnable()) {
+case EnableJITLoaderGDB::eEnableJITLoaderGDBOn:
+  enable = true;
+  break;
+case EnableJITLoaderGDB::eEnableJITLoaderGDBOff:
+  enable = false;
+  break;
+case EnableJITLoaderGDB::eEnableJITLoaderGDBDefault:
+  ArchSpec arch(process->GetTarget().GetArchitecture());
+  enable = arch.GetTriple().getVendor() != llvm::Triple::Apple;
+  break;
+  }
+  if (enable)
 jit_loader_sp = std::make_shared(process);
   return jit_loader_sp;
 }
Index: lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.mk
===
--- lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.mk
+++ lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.mk
@@ -1,5 +1,6 @@
 LEVEL = ../../make
 
-C_SOURCES := main.c
+C_SOURCES := simple.c
+EXE = simple
 
 include $(LEVEL)/Makefile.rules
Index: lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.c
===
--- /dev/null
+++ lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.c
@@ -0,0 +1,20 @@
+#include 
+
+// GDB JIT interface stub
+struct
+{
+uint32_t version;
+uint32_t action_flag;
+void* relevant_entry;
+void* first_entry;
+} __jit_debug_descriptor = { 1, 0, 0, 0 };
+
+void __jit_debug_register_code()
+{
+}
+// end GDB JIT interface stub
+
+int main()
+{
+return 0;
+}
Index: lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
@@ -10,6 +10,7 @@
 from 

[Lldb-commits] [PATCH] D58912: [debugserver] Fix IsUserReady thread filtering

2019-03-04 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda accepted this revision.
jasonmolenda added a comment.
This revision is now accepted and ready to land.

Looks good, that was my only concern.


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

https://reviews.llvm.org/D58912



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


[Lldb-commits] [lldb] r355352 - Revert "[DataFormatters] Fix regression in libc++ std::atomic formatter caused by https://reviews.llvm.org/D56913"

2019-03-04 Thread Shafik Yaghmour via lldb-commits
Author: shafik
Date: Mon Mar  4 16:29:58 2019
New Revision: 355352

URL: http://llvm.org/viewvc/llvm-project?rev=355352=rev
Log:
Revert "[DataFormatters] Fix regression in libc++ std::atomic formatter caused 
by https://reviews.llvm.org/D56913;

This reverts commit r355351.

Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp?rev=355352=355351=355352=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp Mon Mar  4 
16:29:58 2019
@@ -15,25 +15,11 @@ using namespace lldb_private::formatters
 
 bool lldb_private::formatters::LibCxxAtomicSummaryProvider(
 ValueObject , Stream , const TypeSummaryOptions ) {
+  static ConstString g___a_("__a_");
 
-  ValueObjectSP non_sythetic = valobj.GetNonSyntheticValue();
-  if (!non_sythetic)
-return false;
-
-  ValueObjectSP index_zero = non_sythetic->GetChildAtIndex(0, true);
-  if (!index_zero)
-return false;
-
-  ValueObjectSP member__a_ =
-  index_zero->GetChildMemberWithName(ConstString("__a_"), true);
-  if (!member__a_)
-return false;
-
-  if (ValueObjectSP member__a_value =
-  member__a_->GetChildMemberWithName(ConstString("__a_value"), true)) {
+  if (ValueObjectSP child = valobj.GetChildMemberWithName(g___a_, true)) {
 std::string summary;
-if (member__a_value->GetSummaryAsCString(summary, options) &&
-summary.size() > 0) {
+if (child->GetSummaryAsCString(summary, options) && summary.size() > 0) {
   stream.Printf("%s", summary.c_str());
   return true;
 }
@@ -73,17 +59,9 @@ lldb_private::formatters::LibcxxStdAtomi
 : SyntheticChildrenFrontEnd(*valobj_sp), m_real_child(nullptr) {}
 
 bool lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::Update() {
-  ValueObjectSP index_zero = m_backend.GetChildAtIndex(0, true);
-  if (!index_zero)
-return false;
-
-  ValueObjectSP member__a_ =
-  index_zero->GetChildMemberWithName(ConstString("__a_"), true);
-  if (!member__a_)
-return false;
+  static ConstString g___a_("__a_");
 
-  m_real_child =
-  member__a_->GetChildMemberWithName(ConstString("__a_value"), true).get();
+  m_real_child = m_backend.GetChildMemberWithName(g___a_, true).get();
 
   return false;
 }


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


[Lldb-commits] [PATCH] D58946: [SBAPI] Don't check IsValid in constructor

2019-03-04 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: labath, davide, jingham.
JDevlieghere added a project: LLDB.
Herald added a subscriber: abidh.

When running the test suite with the instrumentation macros, I noticed two 
lldb-mi tests regressed. The issue was the copy constructor of SBLineEntry. 
Without the macros the returned value would be elided, but with the macros the 
copy constructor was called. The latter used `IsValid` to determine whether the 
underlying opaque pointer should be set. This is likely a remnant of when 
IsValid would only check the validity of the smart pointer. In SBLineEntry 
however, it actually forwards to LineEntry::IsValid().

So what happened here was that because of the macros the copy constructor was 
called. The opaque pointer was valid but the LineEntry didn't consider itself 
valid. So the copied-to object was default initialized.

This patch replaces all checks for IsValid in copy (assignment) constructors 
with checks for the opaque pointer itself.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D58946

Files:
  lldb/source/API/SBAddress.cpp
  lldb/source/API/SBDeclaration.cpp
  lldb/source/API/SBError.cpp
  lldb/source/API/SBExpressionOptions.cpp
  lldb/source/API/SBLineEntry.cpp
  lldb/source/API/SBProcessInfo.cpp
  lldb/source/API/SBStringList.cpp
  lldb/source/API/SBSymbolContext.cpp
  lldb/source/API/SBTypeEnumMember.cpp

Index: lldb/source/API/SBTypeEnumMember.cpp
===
--- lldb/source/API/SBTypeEnumMember.cpp
+++ lldb/source/API/SBTypeEnumMember.cpp
@@ -22,23 +22,25 @@
 SBTypeEnumMember::SBTypeEnumMember() : m_opaque_sp() {}
 
 SBTypeEnumMember::~SBTypeEnumMember() {}
+
 SBTypeEnumMember::SBTypeEnumMember(
 const lldb::TypeEnumMemberImplSP _member_sp)
 : m_opaque_sp(enum_member_sp) {}
 
 SBTypeEnumMember::SBTypeEnumMember(const SBTypeEnumMember )
 : m_opaque_sp() {
-  if (this != ) {
-if (rhs.IsValid())
-  m_opaque_sp = std::make_shared(rhs.ref());
-  }
+  m_opaque_sp = std::make_shared(rhs.ref());
 }
 
 SBTypeEnumMember ::operator=(const SBTypeEnumMember ) {
-  if (this != ) {
-if (rhs.IsValid())
-  m_opaque_sp = std::make_shared(rhs.ref());
-  }
+  if (this == )
+return *this;
+
+  if (rhs.m_opaque_sp)
+m_opaque_sp = std::make_shared(*rhs.m_opaque_sp);
+  else
+m_opaque_sp.reset(); // Mirror the default constructor.
+
   return *this;
 }
 
Index: lldb/source/API/SBSymbolContext.cpp
===
--- lldb/source/API/SBSymbolContext.cpp
+++ lldb/source/API/SBSymbolContext.cpp
@@ -21,38 +21,33 @@
 
 SBSymbolContext::SBSymbolContext(const SymbolContext *sc_ptr) : m_opaque_up() {
   if (sc_ptr)
-m_opaque_up.reset(new SymbolContext(*sc_ptr));
+m_opaque_up = llvm::make_unique(*sc_ptr);
 }
 
 SBSymbolContext::SBSymbolContext(const SBSymbolContext ) : m_opaque_up() {
-  if (rhs.IsValid()) {
-if (m_opaque_up)
-  *m_opaque_up = *rhs.m_opaque_up;
-else
-  ref() = *rhs.m_opaque_up;
-  }
+  if (rhs.m_opaque_up)
+m_opaque_up = llvm::make_unique(*rhs.m_opaque_up);
 }
 
 SBSymbolContext::~SBSymbolContext() {}
 
 const SBSymbolContext ::operator=(const SBSymbolContext ) {
-  if (this != ) {
-if (rhs.IsValid())
-  m_opaque_up.reset(new lldb_private::SymbolContext(*rhs.m_opaque_up));
-  }
+  if (this == )
+return *this;
+
+  if (rhs.m_opaque_up)
+m_opaque_up = llvm::make_unique(*rhs.m_opaque_up);
+  else
+m_opaque_up.reset(); // Mirror the default constructor.
+
   return *this;
 }
 
 void SBSymbolContext::SetSymbolContext(const SymbolContext *sc_ptr) {
-  if (sc_ptr) {
-if (m_opaque_up)
-  *m_opaque_up = *sc_ptr;
-else
-  m_opaque_up.reset(new SymbolContext(*sc_ptr));
-  } else {
-if (m_opaque_up)
-  m_opaque_up->Clear(true);
-  }
+  if (sc_ptr)
+m_opaque_up = llvm::make_unique(*sc_ptr);
+  else
+m_opaque_up->Clear(true);
 }
 
 bool SBSymbolContext::IsValid() const { return m_opaque_up != NULL; }
Index: lldb/source/API/SBStringList.cpp
===
--- lldb/source/API/SBStringList.cpp
+++ lldb/source/API/SBStringList.cpp
@@ -18,21 +18,23 @@
 SBStringList::SBStringList(const lldb_private::StringList *lldb_strings_ptr)
 : m_opaque_up() {
   if (lldb_strings_ptr)
-m_opaque_up.reset(new lldb_private::StringList(*lldb_strings_ptr));
+m_opaque_up = llvm::make_unique(*lldb_strings_ptr);
 }
 
 SBStringList::SBStringList(const SBStringList ) : m_opaque_up() {
-  if (rhs.IsValid())
-m_opaque_up.reset(new lldb_private::StringList(*rhs));
+  if (rhs.m_opaque_up)
+m_opaque_up = llvm::make_unique(*rhs.m_opaque_up);
 }
 
 const SBStringList ::operator=(const SBStringList ) {
-  if (this != ) {
-if (rhs.IsValid())
-  m_opaque_up.reset(new lldb_private::StringList(*rhs));
-else
-  m_opaque_up.reset();
-  }
+  if (this == )
+return *this;
+
+  if 

[Lldb-commits] [lldb] r355329 - Fix Windows build after UserIDResolver patch.

2019-03-04 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Mar  4 11:57:04 2019
New Revision: 355329

URL: http://llvm.org/viewvc/llvm-project?rev=355329=rev
Log:
Fix Windows build after UserIDResolver patch.

That patch added a function to HostInfo that returns an instance
of UserIDResolver, but this function was unimplemented on Windows,
leading to linker errors.  For now, just return a dummy implementation
that doesn't resolve user ids to get the build green.

Modified:
lldb/trunk/include/lldb/Host/HostInfoBase.h
lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h
lldb/trunk/include/lldb/Host/windows/HostInfoWindows.h
lldb/trunk/source/Host/windows/HostInfoWindows.cpp

Modified: lldb/trunk/include/lldb/Host/HostInfoBase.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostInfoBase.h?rev=355329=355328=355329=diff
==
--- lldb/trunk/include/lldb/Host/HostInfoBase.h (original)
+++ lldb/trunk/include/lldb/Host/HostInfoBase.h Mon Mar  4 11:57:04 2019
@@ -11,7 +11,6 @@
 
 #include "lldb/Utility/ArchSpec.h"
 #include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/UserIDResolver.h"
 #include "lldb/lldb-enumerations.h"
 #include "llvm/ADT/StringRef.h"
 
@@ -99,8 +98,6 @@ public:
   //---
   static ArchSpec GetAugmentedArchSpec(llvm::StringRef triple);
 
-  static UserIDResolver ();
-
 protected:
   static bool ComputeSharedLibraryDirectory(FileSpec _spec);
   static bool ComputeSupportExeDirectory(FileSpec _spec);

Modified: lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h?rev=355329=355328=355329=diff
==
--- lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h (original)
+++ lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h Mon Mar  4 11:57:04 2019
@@ -14,6 +14,8 @@
 
 namespace lldb_private {
 
+class UserIDResolver;
+
 class HostInfoPosix : public HostInfoBase {
   friend class HostInfoBase;
 

Modified: lldb/trunk/include/lldb/Host/windows/HostInfoWindows.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/HostInfoWindows.h?rev=355329=355328=355329=diff
==
--- lldb/trunk/include/lldb/Host/windows/HostInfoWindows.h (original)
+++ lldb/trunk/include/lldb/Host/windows/HostInfoWindows.h Mon Mar  4 11:57:04 
2019
@@ -14,6 +14,7 @@
 #include "llvm/Support/VersionTuple.h"
 
 namespace lldb_private {
+class UserIDResolver;
 
 class HostInfoWindows : public HostInfoBase {
   friend class HostInfoBase;
@@ -28,6 +29,7 @@ public:
   static void Terminate();
 
   static size_t GetPageSize();
+  static UserIDResolver ();
 
   static llvm::VersionTuple GetOSVersion();
   static bool GetOSBuildString(std::string );

Modified: lldb/trunk/source/Host/windows/HostInfoWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/HostInfoWindows.cpp?rev=355329=355328=355329=diff
==
--- lldb/trunk/source/Host/windows/HostInfoWindows.cpp (original)
+++ lldb/trunk/source/Host/windows/HostInfoWindows.cpp Mon Mar  4 11:57:04 2019
@@ -14,15 +14,29 @@
 
 #include "lldb/Host/windows/HostInfoWindows.h"
 #include "lldb/Host/windows/PosixApi.h"
+#include "lldb/Utility/UserIDResolver.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Threading.h"
 #include "llvm/Support/raw_ostream.h"
 
 using namespace lldb_private;
 
+namespace {
+class WindowsUserIDResolver : public UserIDResolver {
+protected:
+  llvm::Optional DoGetUserName(id_t uid) override {
+return llvm::None;
+  }
+  llvm::Optional DoGetGroupName(id_t gid) override {
+return llvm::None;
+  }
+};
+} // namespace
+
 FileSpec HostInfoWindows::m_program_filespec;
 
 void HostInfoWindows::Initialize() {
@@ -117,3 +131,9 @@ bool HostInfoWindows::GetEnvironmentVar(
 return llvm::convertWideToUTF8(wvar, var);
   return false;
 }
+
+static llvm::ManagedStatic g_user_id_resolver;
+
+UserIDResolver ::GetUserIDResolver() {
+  return *g_user_id_resolver;
+}


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


[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

2019-03-04 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor marked an inline comment as done.
teemperor added inline comments.



Comment at: 
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/TestStdModuleWithConflicts.py:35
+
+self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+

aprantl wrote:
> teemperor wrote:
> > aprantl wrote:
> > > what's that for?
> > I think that's how we set our executable as the target? It's frankly 
> > cargo-culted setup code that we use in a few hundred other tests.
> lldbutil.run_break_set_by_file_and_line should be all you need. It has a.out 
> as a default argument. So I don't think you need this line or the one 
> defining exe, or the dictionary=... argument to build().
When I remove this line, I actually get `AssertionError: False is not True : 
Expecting 1 locations, got 0` from the 
`lldbutil.run_break_set_by_file_and_line`.

I can't remember if I added the `dictionary=` argument for a specific reason or 
if that was just a side effect when debugging tests. Doesn't seem to break 
anything though, so I'll remove it.


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

https://reviews.llvm.org/D58125



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


[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

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



Comment at: 
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/TestStdModuleWithConflicts.py:35
+
+self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+

teemperor wrote:
> aprantl wrote:
> > what's that for?
> I think that's how we set our executable as the target? It's frankly 
> cargo-culted setup code that we use in a few hundred other tests.
lldbutil.run_break_set_by_file_and_line should be all you need. It has a.out as 
a default argument. So I don't think you need this line or the one defining 
exe, or the dictionary=... argument to build().


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

https://reviews.llvm.org/D58125



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


[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

2019-03-04 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor marked an inline comment as done.
teemperor added inline comments.



Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:257
 
-CFLAGS += -I$(SRCDIR) -include $(THIS_FILE_DIR)test_common.h -I$(THIS_FILE_DIR)
+ifndef NO_INC_DIRS
+  CFLAGS += -I$(SRCDIR) -include $(THIS_FILE_DIR)test_common.h 
-I$(THIS_FILE_DIR)

labath wrote:
> I'm wondering why have you needed to do this (and whether we can figure out 
> another solution to that).
Yeah I should have added this as a comment to the test. Our sysroot system has 
only a few dummy headers, so we can resolve the `#include ` in 
`test_common.h`. The removed `-I` flags are actually unintentional, I'll revert 
removing them.


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

https://reviews.llvm.org/D58125



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


[Lldb-commits] [PATCH] D58833: Fix embedded Python initialization according to changes in version 3.7

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

I spent several hours reading through this code and I do believe this patch 
(and your reasoning) is correct.
The comment is fine to me, FWIW.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D58833



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


[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

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



Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:257
 
-CFLAGS += -I$(SRCDIR) -include $(THIS_FILE_DIR)test_common.h -I$(THIS_FILE_DIR)
+ifndef NO_INC_DIRS
+  CFLAGS += -I$(SRCDIR) -include $(THIS_FILE_DIR)test_common.h 
-I$(THIS_FILE_DIR)

teemperor wrote:
> labath wrote:
> > I'm wondering why have you needed to do this (and whether we can figure out 
> > another solution to that).
> Yeah I should have added this as a comment to the test. Our sysroot system 
> has only a few dummy headers, so we can resolve the `#include ` 
> in `test_common.h`. The removed `-I` flags are actually unintentional, I'll 
> revert removing them.
Ah, cool. I suspected something like that. In that case I suggest also renaming 
the flag to NO_TEST_COMMON_H or something. (We should probably replace the 
force-include by an actual include some day.)


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

https://reviews.llvm.org/D58125



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


[Lldb-commits] [PATCH] D58860: [build.py] Allow clang-cl to build files starting with '/U'

2019-03-04 Thread Alex Langford via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB355341: [build.py] Allow clang-cl to build files starting 
with /U (authored by xiaobai, committed by ).
Herald added subscribers: teemperor, abidh.
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D58860?vs=189015=189197#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D58860

Files:
  lit/helper/build.py


Index: lit/helper/build.py
===
--- lit/helper/build.py
+++ lit/helper/build.py
@@ -568,6 +568,8 @@
 args.append('/c')
 
 args.append('/Fo' + obj)
+if self.toolchain_type == 'clang-cl':
+args.append('--')
 args.append(source)
 
 return ('compiling', [source], obj,


Index: lit/helper/build.py
===
--- lit/helper/build.py
+++ lit/helper/build.py
@@ -568,6 +568,8 @@
 args.append('/c')
 
 args.append('/Fo' + obj)
+if self.toolchain_type == 'clang-cl':
+args.append('--')
 args.append(source)
 
 return ('compiling', [source], obj,
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D58125: Add ability to import std module into expression parser to improve C++ debugging

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



Comment at: 
lldb/packages/Python/lldbsuite/test/expression_command/import-std-module/conflicts/TestStdModuleWithConflicts.py:35
+
+self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+

teemperor wrote:
> aprantl wrote:
> > teemperor wrote:
> > > aprantl wrote:
> > > > what's that for?
> > > I think that's how we set our executable as the target? It's frankly 
> > > cargo-culted setup code that we use in a few hundred other tests.
> > lldbutil.run_break_set_by_file_and_line should be all you need. It has 
> > a.out as a default argument. So I don't think you need this line or the one 
> > defining exe, or the dictionary=... argument to build().
> When I remove this line, I actually get `AssertionError: False is not True : 
> Expecting 1 locations, got 0` from the 
> `lldbutil.run_break_set_by_file_and_line`.
> 
> I can't remember if I added the `dictionary=` argument for a specific reason 
> or if that was just a side effect when debugging tests. Doesn't seem to break 
> anything though, so I'll remove it.
Interesting. Looks like there are several very similarly named helper functions 
in lldbutil. There are several testcases that only use 
`run_to_source/line_breakpoint without running `file` manually, so perhaps 
those functions do more work than run_break_set_by_file_and_line. Since the 
line number comes from a regex anyway, I'd recommend using 
`run_to_source_breakpoint instead and also deleting the regex matching from 
setUp().


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

https://reviews.llvm.org/D58125



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


[Lldb-commits] [lldb] r355340 - [build] Rename clang-headers to clang-resource-headers

2019-03-04 Thread Shoaib Meenai via lldb-commits
Author: smeenai
Date: Mon Mar  4 13:19:53 2019
New Revision: 355340

URL: http://llvm.org/viewvc/llvm-project?rev=355340=rev
Log:
[build] Rename clang-headers to clang-resource-headers

Summary:
The current install-clang-headers target installs clang's resource
directory headers. This is different from the install-llvm-headers
target, which installs LLVM's API headers. We want to introduce the
corresponding target to clang, and the natural name for that new target
would be install-clang-headers. Rename the existing target to
install-clang-resource-headers to free up the install-clang-headers name
for the new target, following the discussion on cfe-dev [1].

I didn't find any bots on zorg referencing install-clang-headers. I'll
send out another PSA to cfe-dev to accompany this rename.

[1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html

Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille

Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, 
lldb-commits, cfe-commits, llvm-commits

Tags: #clang, #sanitizers, #lldb, #openmp, #llvm

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

Added:
lldb/trunk/scripts/Xcode/package-clang-resource-headers.py
Removed:
lldb/trunk/scripts/Xcode/package-clang-headers.py
Modified:
lldb/trunk/cmake/modules/LLDBFramework.cmake
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/API/CMakeLists.txt

Modified: lldb/trunk/cmake/modules/LLDBFramework.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBFramework.cmake?rev=355340=355339=355340=diff
==
--- lldb/trunk/cmake/modules/LLDBFramework.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBFramework.cmake Mon Mar  4 13:19:53 2019
@@ -98,10 +98,10 @@ add_custom_command(TARGET lldb-framework
 
 # Copy vendor-specific headers from clang (without staging).
 if(NOT IOS AND NOT LLDB_BUILT_STANDALONE)
-  add_dependencies(lldb-framework clang-headers)
+  add_dependencies(lldb-framework clang-resource-headers)
   add_custom_command(TARGET lldb-framework POST_BUILD
 COMMAND ${CMAKE_COMMAND} -E copy_directory
-$
+$
 $/Resources/Clang/include
 COMMENT "LLDB.framework: copy clang vendor-specific headers"
   )

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=355340=355339=355340=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Mar  4 13:19:53 2019
@@ -7618,7 +7618,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
-   shellScript = "/usr/bin/python 
$SRCROOT/scripts/Xcode/package-clang-headers.py $TARGET_BUILD_DIR 
$LLVM_BUILD_DIR/x86_64\n";
+   shellScript = "/usr/bin/python 
$SRCROOT/scripts/Xcode/package-clang-resource-headers.py $TARGET_BUILD_DIR 
$LLVM_BUILD_DIR/x86_64\n";
};
4C3326CA18B2A2B800EB5DD7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;

Removed: lldb/trunk/scripts/Xcode/package-clang-headers.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/package-clang-headers.py?rev=355339=auto
==
--- lldb/trunk/scripts/Xcode/package-clang-headers.py (original)
+++ lldb/trunk/scripts/Xcode/package-clang-headers.py (removed)
@@ -1,85 +0,0 @@
-#! /usr/bin/env python
-
-# package-clang-headers.py
-#
-# The Clang module loader depends on built-in headers for the Clang compiler.
-# We grab these from the Clang build and move them into the LLDB module.
-
-# TARGET_DIR is where the lldb framework/shared library gets put.
-# LLVM_BUILD_DIR is where LLVM and Clang got built
-# LLVM_BUILD_DIR/lib/clang should exist and contain headers
-
-import os
-import re
-import shutil
-import sys
-
-import lldbbuild
-
-if len(sys.argv) != 3:
-print "usage: " + sys.argv[0] + " TARGET_DIR LLVM_BUILD_DIR"
-sys.exit(1)
-
-target_dir = sys.argv[1]
-llvm_build_dir = lldbbuild.expected_package_build_path_for("llvm")
-
-if not os.path.isdir(target_dir):
-print target_dir + " doesn't exist"
-sys.exit(1)
-
-if not os.path.isdir(llvm_build_dir):
-llvm_build_dir = re.sub("-macosx-", "-iphoneos-", llvm_build_dir)
-
-if not os.path.isdir(llvm_build_dir):
-llvm_build_dir = re.sub("-iphoneos-", "-appletvos-", llvm_build_dir)
-
-if not os.path.isdir(llvm_build_dir):
-llvm_build_dir = re.sub("-appletvos-", "-watchos-", llvm_build_dir)
-
-if not os.path.isdir(llvm_build_dir):
-llvm_build_dir = re.sub("-watchos-", "-bridgeos-", llvm_build_dir)
-
-if not os.path.isdir(llvm_build_dir):
-print llvm_build_dir + " 

[Lldb-commits] [lldb] r355341 - [build.py] Allow clang-cl to build files starting with '/U'

2019-03-04 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Mon Mar  4 13:36:49 2019
New Revision: 355341

URL: http://llvm.org/viewvc/llvm-project?rev=355341=rev
Log:
[build.py] Allow clang-cl to build files starting with '/U'

Summary:
clang-cl tries to match cl's interface, and treats /U as "Removes a
predefined macro" as cl does. When you feed clang-cl a file that begins with
'/U' (e.g. /Users/xiaobai/foo.c), clang-cl will emit a warning and in some cases
an error, like so:

clang-9: warning: '/Users/xiaobai/foo.c' treated as the '/U' option 
[-Wslash-u-filename]
clang-9: note: Use '--' to treat subsequent arguments as filenames
clang-9: error: no input files

If you're using clang-cl, make sure '--' is passed before the source file.

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

Modified:
lldb/trunk/lit/helper/build.py

Modified: lldb/trunk/lit/helper/build.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/helper/build.py?rev=355341=355340=355341=diff
==
--- lldb/trunk/lit/helper/build.py (original)
+++ lldb/trunk/lit/helper/build.py Mon Mar  4 13:36:49 2019
@@ -568,6 +568,8 @@ class MsvcBuilder(Builder):
 args.append('/c')
 
 args.append('/Fo' + obj)
+if self.toolchain_type == 'clang-cl':
+args.append('--')
 args.append(source)
 
 return ('compiling', [source], obj,


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


[Lldb-commits] [lldb] r355342 - Move ProcessInfo from Host to Utility.

2019-03-04 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Mon Mar  4 13:51:03 2019
New Revision: 355342

URL: http://llvm.org/viewvc/llvm-project?rev=355342=rev
Log:
Move ProcessInfo from Host to Utility.

There are set of classes in Target that describe the parameters of a
process - e.g. it's PID, name, user id, and similar. However, since it
is a bare description of a process and contains no actual functionality,
there's nothing specifically that makes this appropriate for being in
Target -- it could just as well be describing a process on the host, or
some hypothetical virtual process that doesn't even exist.

To cement this, I'm moving these classes to Utility. It's possible that
we can find a better place for it in the future, but as it is neither
Host specific nor Target specific, Utility seems like the most appropriate
place for the time being.

After this there is only 2 remaining references to Target from Host,
which I'll address in a followup.

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

Added:
lldb/trunk/include/lldb/Utility/ProcessInfo.h
lldb/trunk/source/Utility/ProcessInfo.cpp
lldb/trunk/unittests/Utility/ProcessInfoTest.cpp
Removed:
lldb/trunk/include/lldb/Host/ProcessInfo.h
lldb/trunk/source/Host/common/ProcessInfo.cpp
lldb/trunk/unittests/Host/ProcessInfoTest.cpp
Modified:
lldb/trunk/include/lldb/Host/Host.h
lldb/trunk/include/lldb/Host/ProcessLaunchInfo.h
lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h
lldb/trunk/include/lldb/Target/Platform.h
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/include/lldb/module.modulemap
lldb/trunk/source/API/SBProcess.cpp
lldb/trunk/source/API/SBProcessInfo.cpp
lldb/trunk/source/API/SBTarget.cpp
lldb/trunk/source/Host/CMakeLists.txt
lldb/trunk/source/Host/freebsd/Host.cpp
lldb/trunk/source/Host/linux/Host.cpp
lldb/trunk/source/Host/macosx/objcxx/Host.mm
lldb/trunk/source/Host/netbsd/Host.cpp
lldb/trunk/source/Host/openbsd/Host.cpp
lldb/trunk/source/Host/posix/HostInfoPosix.cpp
lldb/trunk/source/Host/windows/Host.cpp

lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Utility/CMakeLists.txt
lldb/trunk/unittests/Host/CMakeLists.txt
lldb/trunk/unittests/Utility/CMakeLists.txt

Modified: lldb/trunk/include/lldb/Host/Host.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Host.h?rev=355342=355341=355342=diff
==
--- lldb/trunk/include/lldb/Host/Host.h (original)
+++ lldb/trunk/include/lldb/Host/Host.h Mon Mar  4 13:51:03 2019
@@ -26,6 +26,9 @@ namespace lldb_private {
 
 class FileAction;
 class ProcessLaunchInfo;
+class ProcessInstanceInfo;
+class ProcessInstanceInfoList;
+class ProcessInstanceInfoMatch;
 
 //--
 // Exit Type for inferior processes

Removed: lldb/trunk/include/lldb/Host/ProcessInfo.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/ProcessInfo.h?rev=355341=auto
==
--- lldb/trunk/include/lldb/Host/ProcessInfo.h (original)
+++ lldb/trunk/include/lldb/Host/ProcessInfo.h (removed)
@@ -1,101 +0,0 @@
-//===-- ProcessInfo.h ---*- C++ 
-*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===--===//
-
-#ifndef liblldb_ProcessInfo_h_
-#define liblldb_ProcessInfo_h_
-
-// LLDB headers
-#include "lldb/Utility/ArchSpec.h"
-#include "lldb/Utility/Args.h"
-#include "lldb/Utility/Environment.h"
-#include "lldb/Utility/FileSpec.h"
-
-namespace lldb_private {
-//--
-// ProcessInfo
-//
-// A base class for information for a process. This can be used to fill
-// out information for a process prior to launching it, or it can be used for
-// an instance of a process and can be filled in with the existing values for
-// that process.
-//--
-class ProcessInfo {
-public:
-  ProcessInfo();
-
-  ProcessInfo(const char *name, const ArchSpec , lldb::pid_t pid);
-
-  void Clear();
-
-  const char *GetName() const;
-
-  size_t GetNameLength() const;
-
-  FileSpec () { 

[Lldb-commits] [PATCH] D58842: Move ProcessInstanceInfo and similar to Utility

2019-03-04 Thread Zachary Turner via Phabricator via lldb-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL355342: Move ProcessInfo from Host to Utility. (authored by 
zturner, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D58842?vs=188950=189200#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D58842

Files:
  lldb/trunk/include/lldb/Host/Host.h
  lldb/trunk/include/lldb/Host/ProcessInfo.h
  lldb/trunk/include/lldb/Host/ProcessLaunchInfo.h
  lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h
  lldb/trunk/include/lldb/Target/Platform.h
  lldb/trunk/include/lldb/Target/Process.h
  lldb/trunk/include/lldb/Utility/ProcessInfo.h
  lldb/trunk/include/lldb/module.modulemap
  lldb/trunk/source/API/SBProcess.cpp
  lldb/trunk/source/API/SBProcessInfo.cpp
  lldb/trunk/source/API/SBTarget.cpp
  lldb/trunk/source/Host/CMakeLists.txt
  lldb/trunk/source/Host/common/ProcessInfo.cpp
  lldb/trunk/source/Host/freebsd/Host.cpp
  lldb/trunk/source/Host/linux/Host.cpp
  lldb/trunk/source/Host/macosx/objcxx/Host.mm
  lldb/trunk/source/Host/netbsd/Host.cpp
  lldb/trunk/source/Host/openbsd/Host.cpp
  lldb/trunk/source/Host/posix/HostInfoPosix.cpp
  lldb/trunk/source/Host/windows/Host.cpp
  lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
  lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
  lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
  lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
  lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
  lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  lldb/trunk/source/Target/Process.cpp
  lldb/trunk/source/Utility/CMakeLists.txt
  lldb/trunk/source/Utility/ProcessInfo.cpp
  lldb/trunk/unittests/Host/CMakeLists.txt
  lldb/trunk/unittests/Host/ProcessInfoTest.cpp
  lldb/trunk/unittests/Utility/CMakeLists.txt
  lldb/trunk/unittests/Utility/ProcessInfoTest.cpp

Index: lldb/trunk/include/lldb/module.modulemap
===
--- lldb/trunk/include/lldb/module.modulemap
+++ lldb/trunk/include/lldb/module.modulemap
@@ -39,7 +39,6 @@
   module PipeBase { header "Host/PipeBase.h" export * }
   module Pipe { header "Host/Pipe.h" export * }
   module PosixApi { header "Host/PosixApi.h" export * }
-  module ProcessInfo { header "Host/ProcessInfo.h" export * }
   module ProcessLauncher { header "Host/ProcessLauncher.h" export * }
   module ProcessLaunchInfo { header "Host/ProcessLaunchInfo.h" export * }
   module ProcessRunLock { header "Host/ProcessRunLock.h" export * }
Index: lldb/trunk/include/lldb/Utility/ProcessInfo.h
===
--- lldb/trunk/include/lldb/Utility/ProcessInfo.h
+++ lldb/trunk/include/lldb/Utility/ProcessInfo.h
@@ -0,0 +1,251 @@
+//===-- ProcessInfo.h ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLDB_UTILITY_PROCESSINFO_H
+#define LLDB_UTILITY_PROCESSINFO_H
+
+// LLDB headers
+#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/Environment.h"
+#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/NameMatches.h"
+
+#include 
+
+namespace lldb_private {
+
+class UserIDResolver;
+
+//--
+// ProcessInfo
+//
+// A base class for information for a process. This can be used to fill
+// out information for a process prior to launching it, or it can be used for
+// an instance of a process and can be filled in with the existing values for
+// that process.
+//--
+class ProcessInfo {
+public:
+  ProcessInfo();
+
+  ProcessInfo(const char *name, const ArchSpec , lldb::pid_t pid);
+
+  void Clear();
+
+  const char *GetName() const;
+
+  size_t GetNameLength() const;
+
+  FileSpec () { return m_executable; }
+
+  void SetExecutableFile(const FileSpec _file,
+ bool add_exe_file_as_first_arg);
+
+  const FileSpec () const { return m_executable; }
+
+  uint32_t GetUserID() const { return m_uid; }
+
+  uint32_t GetGroupID() const { return m_gid; }
+
+  bool UserIDIsValid() const { return m_uid != UINT32_MAX; }
+
+  bool GroupIDIsValid() const { return m_gid != UINT32_MAX; }
+
+  void SetUserID(uint32_t uid) { m_uid = uid; }
+
+  void SetGroupID(uint32_t gid) { m_gid = gid; }
+
+  ArchSpec () { return m_arch; }
+
+