[Lldb-commits] [lldb] r365295 - Change LaunchThread interface to return an Expected for non-Apple-non-Windows

2019-07-08 Thread Fangrui Song via lldb-commits
Author: maskray
Date: Mon Jul  8 00:07:05 2019
New Revision: 365295

URL: http://llvm.org/viewvc/llvm-project?rev=365295&view=rev
Log:
Change LaunchThread interface to return an Expected for non-Apple-non-Windows

Fixes Linux build errors after D64163/r365226

Modified:
lldb/trunk/include/lldb/Host/Host.h
lldb/trunk/include/lldb/Host/HostNativeProcessBase.h
lldb/trunk/include/lldb/Host/HostProcess.h
lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h
lldb/trunk/source/Host/common/Host.cpp
lldb/trunk/source/Host/common/HostProcess.cpp
lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp
lldb/trunk/source/Host/common/ProcessLaunchInfo.cpp
lldb/trunk/source/Host/posix/HostProcessPosix.cpp

Modified: lldb/trunk/include/lldb/Host/Host.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Host.h?rev=365295&r1=365294&r2=365295&view=diff
==
--- lldb/trunk/include/lldb/Host/Host.h (original)
+++ lldb/trunk/include/lldb/Host/Host.h Mon Jul  8 00:07:05 2019
@@ -99,7 +99,7 @@ public:
   /// was spawned to monitor \a pid.
   ///
   /// \see static void Host::StopMonitoringChildProcess (uint32_t)
-  static HostThread
+  static llvm::Expected
   StartMonitoringChildProcess(const MonitorChildProcessCallback &callback,
   lldb::pid_t pid, bool monitor_signals);
 

Modified: lldb/trunk/include/lldb/Host/HostNativeProcessBase.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostNativeProcessBase.h?rev=365295&r1=365294&r2=365295&view=diff
==
--- lldb/trunk/include/lldb/Host/HostNativeProcessBase.h (original)
+++ lldb/trunk/include/lldb/Host/HostNativeProcessBase.h Mon Jul  8 00:07:05 
2019
@@ -35,7 +35,7 @@ public:
 
   lldb::process_t GetSystemHandle() const { return m_process; }
 
-  virtual HostThread
+  virtual llvm::Expected
   StartMonitoring(const Host::MonitorChildProcessCallback &callback,
   bool monitor_signals) = 0;
 

Modified: lldb/trunk/include/lldb/Host/HostProcess.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostProcess.h?rev=365295&r1=365294&r2=365295&view=diff
==
--- lldb/trunk/include/lldb/Host/HostProcess.h (original)
+++ lldb/trunk/include/lldb/Host/HostProcess.h Mon Jul  8 00:07:05 2019
@@ -43,8 +43,9 @@ public:
   lldb::pid_t GetProcessId() const;
   bool IsRunning() const;
 
-  HostThread StartMonitoring(const Host::MonitorChildProcessCallback &callback,
- bool monitor_signals);
+  llvm::Expected
+  StartMonitoring(const Host::MonitorChildProcessCallback &callback,
+  bool monitor_signals);
 
   HostNativeProcessBase &GetNativeProcess();
   const HostNativeProcessBase &GetNativeProcess() const;

Modified: lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h?rev=365295&r1=365294&r2=365295&view=diff
==
--- lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h (original)
+++ lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h Mon Jul  8 00:07:05 
2019
@@ -32,8 +32,9 @@ public:
   lldb::pid_t GetProcessId() const override;
   bool IsRunning() const override;
 
-  HostThread StartMonitoring(const Host::MonitorChildProcessCallback &callback,
- bool monitor_signals) override;
+  llvm::Expected
+  StartMonitoring(const Host::MonitorChildProcessCallback &callback,
+  bool monitor_signals) override;
 };
 
 } // namespace lldb_private

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=365295&r1=365294&r2=365295&view=diff
==
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Mon Jul  8 00:07:05 2019
@@ -99,7 +99,7 @@ struct MonitorInfo {
 
 static thread_result_t MonitorChildProcessThreadFunction(void *arg);
 
-HostThread Host::StartMonitoringChildProcess(
+llvm::Expected Host::StartMonitoringChildProcess(
 const Host::MonitorChildProcessCallback &callback, lldb::pid_t pid,
 bool monitor_signals) {
   MonitorInfo *info_ptr = new MonitorInfo();
@@ -112,7 +112,7 @@ HostThread Host::StartMonitoringChildPro
   ::snprintf(thread_name, sizeof(thread_name),
  "", pid);
   return ThreadLauncher::LaunchThread(
-  thread_name, MonitorChildProcessThreadFunction, info_ptr, nullptr);
+  thread_name, MonitorChildProcessThreadFunction, info_ptr, 0);
 }
 
 #ifndef __linux__

Modified: lldb/trunk/source/Host/common/HostProcess.cpp
URL: 
http://llvm.org/viewv

Re: [Lldb-commits] [lldb] r365295 - Change LaunchThread interface to return an Expected for non-Apple-non-Windows

2019-07-08 Thread Carlo Kok via lldb-commits
This looks to be broken on Windows: 

SeverityCodeDescription Project FileLineSuppression 
State
Error   C2555   'lldb_private::HostProcessWindows::StartMonitoring': overriding 
virtual function return type differs and is not covariant from 
'lldb_private::HostNativeProcessBase::StartMonitoring'   
lldbPluginProcessWindowsCommon  
C:\p\llvm\llvm\tools\lldb\include\lldb\Host\windows\HostProcessWindows.h
33  
Error   C2664   'llvm::Expected 
lldb_private::ThreadLauncher::LaunchThread(llvm::StringRef,lldb::thread_func_t,lldb::thread_arg_t,size_t)':
 cannot convert argument 4 from 'lldb_private::Status *' to 'size_t'   
lldbPluginProcessWindowsCommon  
C:\p\llvm\llvm\tools\lldb\source\Plugins\Process\Windows\Common\DebuggerThread.cpp
  68  
Error   C2664   'llvm::Expected 
lldb_private::ThreadLauncher::LaunchThread(llvm::StringRef,lldb::thread_func_t,lldb::thread_arg_t,size_t)':
 cannot convert argument 4 from 'lldb_private::Status *' to 'size_t'   
lldbPluginProcessWindowsCommon  
C:\p\llvm\llvm\tools\lldb\source\Plugins\Process\Windows\Common\DebuggerThread.cpp
  85  

On Mon, Jul 8, 2019, at 09:06, Fangrui Song via lldb-commits wrote:
> Author: maskray
> Date: Mon Jul  8 00:07:05 2019
> New Revision: 365295
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=365295&view=rev
> Log:
> Change LaunchThread interface to return an Expected for non-Apple-non-Windows
> 
> Fixes Linux build errors after D64163/r365226
> 
> Modified:
> lldb/trunk/include/lldb/Host/Host.h
> lldb/trunk/include/lldb/Host/HostNativeProcessBase.h
> lldb/trunk/include/lldb/Host/HostProcess.h
> lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h
> lldb/trunk/source/Host/common/Host.cpp
> lldb/trunk/source/Host/common/HostProcess.cpp
> lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp
> lldb/trunk/source/Host/common/ProcessLaunchInfo.cpp
> lldb/trunk/source/Host/posix/HostProcessPosix.cpp
> 
> Modified: lldb/trunk/include/lldb/Host/Host.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Host.h?rev=365295&r1=365294&r2=365295&view=diff
> ==
> --- lldb/trunk/include/lldb/Host/Host.h (original)
> +++ lldb/trunk/include/lldb/Host/Host.h Mon Jul  8 00:07:05 2019
> @@ -99,7 +99,7 @@ public:
>/// was spawned to monitor \a pid.
>///
>/// \see static void Host::StopMonitoringChildProcess (uint32_t)
> -  static HostThread
> +  static llvm::Expected
>StartMonitoringChildProcess(const MonitorChildProcessCallback 
> &callback,
>lldb::pid_t pid, bool monitor_signals);
>  
> 
> Modified: lldb/trunk/include/lldb/Host/HostNativeProcessBase.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostNativeProcessBase.h?rev=365295&r1=365294&r2=365295&view=diff
> ==
> --- lldb/trunk/include/lldb/Host/HostNativeProcessBase.h (original)
> +++ lldb/trunk/include/lldb/Host/HostNativeProcessBase.h Mon Jul  8 
> 00:07:05 2019
> @@ -35,7 +35,7 @@ public:
>  
>lldb::process_t GetSystemHandle() const { return m_process; }
>  
> -  virtual HostThread
> +  virtual llvm::Expected
>StartMonitoring(const Host::MonitorChildProcessCallback &callback,
>bool monitor_signals) = 0;
>  
> 
> Modified: lldb/trunk/include/lldb/Host/HostProcess.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/HostProcess.h?rev=365295&r1=365294&r2=365295&view=diff
> ==
> --- lldb/trunk/include/lldb/Host/HostProcess.h (original)
> +++ lldb/trunk/include/lldb/Host/HostProcess.h Mon Jul  8 00:07:05 2019
> @@ -43,8 +43,9 @@ public:
>lldb::pid_t GetProcessId() const;
>bool IsRunning() const;
>  
> -  HostThread StartMonitoring(const Host::MonitorChildProcessCallback 
> &callback,
> - bool monitor_signals);
> +  llvm::Expected
> +  StartMonitoring(const Host::MonitorChildProcessCallback &callback,
> +  bool monitor_signals);
>  
>HostNativeProcessBase &GetNativeProcess();
>const HostNativeProcessBase &GetNativeProcess() const;
> 
> Modified: lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h?rev=365295&r1=365294&r2=365295&view=diff
> ==
> --- lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h (original)
> +++ lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h Mon Jul  8 
> 00:07:05 2019
> @@ -32,8 +32,9 @@ public:
>lldb::pid_t GetProcessId() const override;
>bool IsRunning() const override;
>  
> -  HostThread StartMonitoring(const Host::MonitorChildProcessCallback 
> &callback,
> 

[Lldb-commits] [lldb] r365338 - [lldb] [test] Update NetBSD XFAILs in test suite

2019-07-08 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Mon Jul  8 09:16:07 2019
New Revision: 365338

URL: http://llvm.org/viewvc/llvm-project?rev=365338&view=rev
Log:
[lldb] [test] Update NetBSD XFAILs in test suite

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py

lldb/trunk/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py

lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py

lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py

lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py

lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py?rev=365338&r1=365337&r2=365338&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
 Mon Jul  8 09:16:07 2019
@@ -41,6 +41,7 @@ class HelloWatchLocationTestCase(TestBas
 @expectedFailureAll(triple=re.compile('^mips'))
 # SystemZ and PowerPC also currently supports only one H/W watchpoint
 @expectedFailureAll(archs=['powerpc64le', 's390x'])
+@expectedFailureNetBSD
 @skipIfDarwin
 def test_hello_watchlocation(self):
 """Test watching a location with '-s size' option."""

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py?rev=365338&r1=365337&r2=365338&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
 Mon Jul  8 09:16:07 2019
@@ -23,6 +23,7 @@ class WatchpointForMultipleThreadsTestCa
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not 
supported on Windows")
+@expectedFailureNetBSD
 def test_watchpoint_before_thread_start(self):
 """Test that we can hit a watchpoint we set before starting another 
thread"""
 self.do_watchpoint_test("Before running the thread")
@@ -30,6 +31,7 @@ class WatchpointForMultipleThreadsTestCa
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not 
supported on Windows")
+@expectedFailureNetBSD
 def test_watchpoint_after_thread_start(self):
 """Test that we can hit a watchpoint we set after starting another 
thread"""
 self.do_watchpoint_test("After running the thread")

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py?rev=365338&r1=365337&r2=365338&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
 Mon Jul  8 09:16:07 2019
@@ -40,6 +40,7 @@ class WatchpointLLDBCommandTestCase(Test
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not

[Lldb-commits] [lldb] r365344 - [Host] Fix out-of-line definition of StartMonitoringChildProcess

2019-07-08 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jul  8 09:31:37 2019
New Revision: 365344

URL: http://llvm.org/viewvc/llvm-project?rev=365344&view=rev
Log:
[Host] Fix out-of-line definition of StartMonitoringChildProcess

Modified:
lldb/trunk/source/Host/macosx/objcxx/Host.mm

Modified: lldb/trunk/source/Host/macosx/objcxx/Host.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/objcxx/Host.mm?rev=365344&r1=365343&r2=365344&view=diff
==
--- lldb/trunk/source/Host/macosx/objcxx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/objcxx/Host.mm Mon Jul  8 09:31:37 2019
@@ -1420,7 +1420,7 @@ Status Host::ShellExpandArguments(Proces
   return error;
 }
 
-HostThread Host::StartMonitoringChildProcess(
+llvm::Expected Host::StartMonitoringChildProcess(
 const Host::MonitorChildProcessCallback &callback, lldb::pid_t pid,
 bool monitor_signals) {
   unsigned long mask = DISPATCH_PROC_EXIT;


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


[Lldb-commits] [lldb] r365358 - [Host] Fix out-of-line definition on Windows

2019-07-08 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jul  8 10:45:11 2019
New Revision: 365358

URL: http://llvm.org/viewvc/llvm-project?rev=365358&view=rev
Log:
[Host] Fix out-of-line definition on Windows

Add missing interface changes after r365295.

Modified:
lldb/trunk/source/Host/windows/Host.cpp
lldb/trunk/source/Host/windows/HostProcessWindows.cpp

Modified: lldb/trunk/source/Host/windows/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/Host.cpp?rev=365358&r1=365357&r2=365358&view=diff
==
--- lldb/trunk/source/Host/windows/Host.cpp (original)
+++ lldb/trunk/source/Host/windows/Host.cpp Mon Jul  8 10:45:11 2019
@@ -172,7 +172,7 @@ bool Host::GetProcessInfo(lldb::pid_t pi
   return true;
 }
 
-HostThread Host::StartMonitoringChildProcess(
+llvm::Expected Host::StartMonitoringChildProcess(
 const Host::MonitorChildProcessCallback &callback, lldb::pid_t pid,
 bool monitor_signals) {
   return HostThread();

Modified: lldb/trunk/source/Host/windows/HostProcessWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/HostProcessWindows.cpp?rev=365358&r1=365357&r2=365358&view=diff
==
--- lldb/trunk/source/Host/windows/HostProcessWindows.cpp (original)
+++ lldb/trunk/source/Host/windows/HostProcessWindows.cpp Mon Jul  8 10:45:11 
2019
@@ -80,7 +80,7 @@ bool HostProcessWindows::IsRunning() con
   return (code == STILL_ACTIVE);
 }
 
-HostThread HostProcessWindows::StartMonitoring(
+llvm::Expected HostProcessWindows::StartMonitoring(
 const Host::MonitorChildProcessCallback &callback, bool monitor_signals) {
   HostThread monitor_thread;
   MonitorInfo *info = new MonitorInfo;


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


[Lldb-commits] [PATCH] D64255: Remove lldb-mi

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

This was discussed 
 on the mailing 
list and the consensus was that developers want it out of the lldb test suite 
(because it essentially doesn't work) but at the same time users want to keep 
it around. We moved lldb-mi here  for 
downstream maintainers/users to package/compile, so I think the removal is fine.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D64255



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


[Lldb-commits] [PATCH] D64118: [lldb_test_suite] Fix lldb test suite targeting remote Android

2019-07-08 Thread Wanyi Ye via Phabricator via lldb-commits
kusmour updated this revision to Diff 208465.
kusmour edited the summary of this revision.
kusmour added a comment.

added method skipIfTargetAndroid


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D64118

Files:
  
lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
  lldb/packages/Python/lldbsuite/test/decorators.py
  lldb/packages/Python/lldbsuite/test/make/Android.rules


Index: lldb/packages/Python/lldbsuite/test/make/Android.rules
===
--- lldb/packages/Python/lldbsuite/test/make/Android.rules
+++ lldb/packages/Python/lldbsuite/test/make/Android.rules
@@ -90,5 +90,6 @@
 
ARCH_LDFLAGS += \
-L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
-   
$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++.a
+   
$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++_static.a \
+   -lc++abi
 endif
Index: lldb/packages/Python/lldbsuite/test/decorators.py
===
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -596,6 +596,10 @@
 """Decorate the item to skip tests that should be skipped on Windows."""
 return skipIfPlatform(["windows"])(func)
 
+def skipIfTargetAndroid(func):
+return unittest2.skipIf(lldbplatformutil.target_is_android(),
+"skip on target Android")(func)
+
 
 def skipUnlessWindows(func):
 """Decorate the item to skip tests that should be skipped on any 
non-Windows platform."""
@@ -606,6 +610,10 @@
 """Decorate the item to skip tests that should be skipped on any non 
Darwin platform."""
 return skipUnlessPlatform(lldbplatformutil.getDarwinOSTriples())(func)
 
+def skipUnlessTargetAndroid(func):
+return unittest2.skipUnless(lldbplatformutil.target_is_android(),
+"requires target to be Android")(func)
+
 
 def skipIfHostIncompatibleWithRemote(func):
 """Decorate the item to skip tests if binaries built on this host are 
incompatible."""
Index: 
lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
===
--- 
lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
+++ 
lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
@@ -16,7 +16,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipUnlessPlatform(['android'])
+@skipUnlessTargetAndroid
 def test_cache_line_size(self):
 self.build(dictionary=self.getBuildFlags())
 exe = self.getBuildArtifact("a.out")


Index: lldb/packages/Python/lldbsuite/test/make/Android.rules
===
--- lldb/packages/Python/lldbsuite/test/make/Android.rules
+++ lldb/packages/Python/lldbsuite/test/make/Android.rules
@@ -90,5 +90,6 @@
 
 	ARCH_LDFLAGS += \
 		-L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
-		$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++.a
+		$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++_static.a \
+		-lc++abi
 endif
Index: lldb/packages/Python/lldbsuite/test/decorators.py
===
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -596,6 +596,10 @@
 """Decorate the item to skip tests that should be skipped on Windows."""
 return skipIfPlatform(["windows"])(func)
 
+def skipIfTargetAndroid(func):
+return unittest2.skipIf(lldbplatformutil.target_is_android(),
+"skip on target Android")(func)
+
 
 def skipUnlessWindows(func):
 """Decorate the item to skip tests that should be skipped on any non-Windows platform."""
@@ -606,6 +610,10 @@
 """Decorate the item to skip tests that should be skipped on any non Darwin platform."""
 return skipUnlessPlatform(lldbplatformutil.getDarwinOSTriples())(func)
 
+def skipUnlessTargetAndroid(func):
+return unittest2.skipUnless(lldbplatformutil.target_is_android(),
+"requires target to be Android")(func)
+
 
 def skipIfHostIncompatibleWithRemote(func):
 """Decorate the item to skip tests if binaries built on this host are incompatible."""
Index: lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
===
--- lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
+++ lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
@@ -16,7 +16,7 @@
 
 mydir = TestBase.compute_mydir(__file__)
 
-@skipUnlessPlatform(['android'])
+@skipUnle

[Lldb-commits] [lldb] r365371 - Revert "Move common functionality from processwindows into processdebugger"

2019-07-08 Thread Stella Stamenova via lldb-commits
Author: stella.stamenova
Date: Mon Jul  8 11:53:32 2019
New Revision: 365371

URL: http://llvm.org/viewvc/llvm-project?rev=365371&view=rev
Log:
Revert "Move common functionality from processwindows into processdebugger"

This reverts commit 9c01eaff6aa3f59d91530f47b85bb470377a7780.

The changes in this commit are causing several of the LLDB tests to hang and/or 
timeout.

Removed:
lldb/trunk/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp
lldb/trunk/source/Plugins/Process/Windows/Common/ProcessDebugger.h
Modified:
lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt
lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.h

Modified: lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt?rev=365371&r1=365370&r2=365371&view=diff
==
--- lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/CMakeLists.txt Mon Jul  8 
11:53:32 2019
@@ -2,7 +2,6 @@
 add_lldb_library(lldbPluginProcessWindowsCommon PLUGIN
   DebuggerThread.cpp
   LocalDebugDelegate.cpp
-  ProcessDebugger.cpp
   ProcessWindows.cpp
   ProcessWindowsLog.cpp
   RegisterContextWindows.cpp

Removed: lldb/trunk/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp?rev=365370&view=auto
==
--- lldb/trunk/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp 
(removed)
@@ -1,572 +0,0 @@
-//===-- ProcessDebugger.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 "ProcessDebugger.h"
-
-// Windows includes
-#include "lldb/Host/windows/windows.h"
-#include 
-
-#include "lldb/Host/FileSystem.h"
-#include "lldb/Host/HostNativeProcessBase.h"
-#include "lldb/Host/HostProcess.h"
-#include "lldb/Host/HostThread.h"
-#include "lldb/Host/ProcessLaunchInfo.h"
-#include "lldb/Target/MemoryRegionInfo.h"
-#include "lldb/Target/Process.h"
-#include "llvm/Support/ConvertUTF.h"
-#include "llvm/Support/Error.h"
-
-#include "DebuggerThread.h"
-#include "ExceptionRecord.h"
-#include "ProcessWindowsLog.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-static DWORD ConvertLldbToWinApiProtect(uint32_t protect) {
-  // We also can process a read / write permissions here, but if the debugger
-  // will make later a write into the allocated memory, it will fail. To get
-  // around it is possible inside DoWriteMemory to remember memory permissions,
-  // allow write, write and restore permissions, but for now we process only
-  // the executable permission.
-  //
-  // TODO: Process permissions other than executable
-  if (protect & ePermissionsExecutable)
-return PAGE_EXECUTE_READWRITE;
-
-  return PAGE_READWRITE;
-}
-
-// The Windows page protection bits are NOT independent masks that can be
-// bitwise-ORed together.  For example, PAGE_EXECUTE_READ is not (PAGE_EXECUTE
-// | PAGE_READ).  To test for an access type, it's necessary to test for any of
-// the bits that provide that access type.
-static bool IsPageReadable(uint32_t protect) {
-  return (protect & PAGE_NOACCESS) == 0;
-}
-
-static bool IsPageWritable(uint32_t protect) {
-  return (protect & (PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY |
- PAGE_READWRITE | PAGE_WRITECOPY)) != 0;
-}
-
-static bool IsPageExecutable(uint32_t protect) {
-  return (protect & (PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE 
|
- PAGE_EXECUTE_WRITECOPY)) != 0;
-}
-
-namespace lldb_private {
-
-lldb::pid_t ProcessDebugger::GetDebuggedProcessId() const {
-  if (m_session_data)
-return m_session_data->m_debugger->GetProcess().GetProcessId();
-  return LLDB_INVALID_PROCESS_ID;
-}
-
-Status ProcessDebugger::DetachProcess() {
-  Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_PROCESS);
-  DebuggerThreadSP debugger_thread;
-  {
-// Acquire the lock only long enough to get the DebuggerThread.
-// StopDebugging() will trigger a call back into ProcessDebugger which will
-// also acquire the lock.  Thus we have to release the lock before calling
-// StopDebugging().
-llvm::sys::ScopedLock lock(m_mutex);
-
-if (!m_session_data) {
-  LLDB_LOG(log, "there is no active session.");
-  return S

[Lldb-commits] [PATCH] D64194: [lldb] Fix crash due to dollar character in variable names.

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

Do we really expect users to actually write code where variables start with 
'$'? We will need to make some clear rules of the lookup order if so. I would 
suggest the following order

- look for real variables by exact name match first
- look for expression global variables next
- look for expression results next ($)
- look for registers




Comment at: 
lldb/packages/Python/lldbsuite/test/expression_command/dollar-in-variable/main.c:5
+  int $foo = 42;
+  return 0; //%self.expect("expr $foo", substrs=['(int) $0 = 42'])
+}

The idea was that a "$" prefix wouldn't be found in normal code. In LLDB $ has 
the following special use cases:
- all expression results are named $ just like LLDB
- if you use $ it can be followed by a register name so you can access 
registers in expressions ($rax, $sp, etc)
- any definitions in your expression where the variable is prefixed with '$' 
will become an expression global variable available to all subsequent 
expressions:
```
(lldb) expr int $my_global = 12;
(lldb) expr ++$my_global
```
- All function names that start with '$' are currently thought to be reserved 
for expression and so that any functions we create don't interact with real 
functions


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D64194



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


[Lldb-commits] [PATCH] D64194: [lldb] Fix crash due to dollar character in variable names.

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

So the actual code that hit his use case was when one steps into the expression 
wrapper function we create in LLDB (which uses these dollar signs). So we 
(luckily) don't have any user code that triggers this.

I should note that I anyway discovered that the variable loading optimization 
that caused this regression doesn't support any unicode characters (not that we 
encourage that), so I'll anyway rewrite this parsing code with something that 
reuses the Clang lexer instead of our own ad-hoc parsing (which probably wil 
save us from more weird corner cases in the future).


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D64194



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


[Lldb-commits] [PATCH] D64254: Add lldb-mi deprecation to the release notes

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

Random idea: Should we force the user to pass something like 
-DLLDB_TEMPORARILY_ENABLE_LLDB_MI to cmake to make sure it gets noticed that it 
is going away (I don't know how many people read release notes).

And yeah, I should write something about type units in the release notes...


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64254



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


[Lldb-commits] [PATCH] D64365: [lldb] Let table gen create command option initializers.

2019-07-08 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added reviewers: JDevlieghere, davide, sgraenitz.
Herald added subscribers: lldb-commits, abidh, mgorny.
Herald added a project: LLDB.
teemperor marked an inline comment as done.
teemperor added inline comments.



Comment at: lldb/source/Commands/OptionsBase.td:11
+  // *.inc file.
+  string Command;
+}

I'm open to renaming this if anyone has a better name for this.


We currently have man large arrays containing initializers for our command 
options.
These tables are tricky maintain as we don't have any good place to check them 
for consistency and
it's also hard to read (`nullptr, {}, 0` is not very descriptive).

This patch fixes this by letting table gen generate those tables. This way we 
can have a more readable
syntax for this (especially for all the default arguments) and we can let 
TableCheck check them
for consistency (e.g. an option with an optional argument can't have 
`eArgTypeNone`, naming of flags', etc.).

Also refactoring the related data structures can now be done without changing 
the hundred of option initializers.

For example, this line:

  {LLDB_OPT_SET_ALL, false, "hide-aliases", 'a', 
OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Hide aliases in the 
command list."},

becomes this:

  def hide_aliases : Option<"hide-aliases", "a">, Desc<"Hide aliases in the 
command list.">;

For now I just moved a few initializers to the new format to demonstrate the 
change. I'll slowly migrate the other
option initializers tables  in separate patches.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D64365

Files:
  lldb/CMakeLists.txt
  lldb/cmake/modules/AddLLDB.cmake
  lldb/source/Commands/BreakpointList.td
  lldb/source/Commands/CMakeLists.txt
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectHelp.cpp
  lldb/source/Commands/CommandObjectSettings.cpp
  lldb/source/Commands/Options.td
  lldb/source/Commands/OptionsBase.td
  lldb/utils/TableGen/CMakeLists.txt
  lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
  lldb/utils/TableGen/LLDBTableGen.cpp
  lldb/utils/TableGen/LLDBTableGenBackends.h

Index: lldb/utils/TableGen/LLDBTableGenBackends.h
===
--- /dev/null
+++ lldb/utils/TableGen/LLDBTableGenBackends.h
@@ -0,0 +1,35 @@
+//===- LLDBTableGenBackends.h - Declarations for LLDB TableGen Backends ---===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+//
+// This file contains the declarations for all of the LLDB TableGen
+// backends. A "TableGen backend" is just a function. See
+// "$LLVM_ROOT/utils/TableGen/TableGenBackends.h" for more info.
+//
+//===--===//
+
+#ifndef LLVM_LLDB_UTILS_TABLEGEN_TABLEGENBACKENDS_H
+#define LLVM_LLDB_UTILS_TABLEGEN_TABLEGENBACKENDS_H
+
+#include 
+
+namespace llvm {
+class raw_ostream;
+class RecordKeeper;
+} // namespace llvm
+
+using llvm::raw_ostream;
+using llvm::RecordKeeper;
+
+namespace lldb_private {
+
+void EmitOptionDefs(RecordKeeper &RK, raw_ostream &OS);
+
+} // namespace lldb_private
+
+#endif
Index: lldb/utils/TableGen/LLDBTableGen.cpp
===
--- /dev/null
+++ lldb/utils/TableGen/LLDBTableGen.cpp
@@ -0,0 +1,74 @@
+//===- TableGen.cpp - Top-Level TableGen implementation for Clang -===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+//
+// This file contains the main function for Clang's TableGen.
+//
+//===--===//
+
+#include "LLDBTableGenBackends.h" // Declares all backends.
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/PrettyStackTrace.h"
+#include "llvm/Support/Signals.h"
+#include "llvm/TableGen/Error.h"
+#include "llvm/TableGen/Main.h"
+#include "llvm/TableGen/Record.h"
+
+using namespace llvm;
+using namespace lldb_private;
+
+enum ActionType {
+  PrintRecords,
+  DumpJSON,
+  GenOptionDefs,
+};
+
+namespace {
+cl::opt
+Action(cl::desc("Action to perform:"),
+   cl::values(clEnumValN(PrintRecords, "print-records",
+ "Print all records to stdout (default)"),
+  clEnumValN(DumpJSON, "dump-json",
+ "Dump all records as machine-readable JSON"),
+  clEnumValN(GenOptionDefs, "gen-lldb-option-defs",
+ "Generate clang attribute clases")));
+
+bool LLDBTableGen

[Lldb-commits] [PATCH] D64365: [lldb] Let table gen create command option initializers.

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



Comment at: lldb/source/Commands/OptionsBase.td:11
+  // *.inc file.
+  string Command;
+}

I'm open to renaming this if anyone has a better name for this.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D64365



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


[Lldb-commits] [PATCH] D64366: Add lldb type unit support to the release notes

2019-07-08 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: JDevlieghere, teemperor.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D64366

Files:
  docs/ReleaseNotes.rst


Index: docs/ReleaseNotes.rst
===
--- docs/ReleaseNotes.rst
+++ docs/ReleaseNotes.rst
@@ -131,6 +131,8 @@
 
 * Backtraces are now color highlighting in the terminal.
 
+* DWARF4 (debug_types) and DWARF5 (debug_info) type units are now supported.
+
 * This release will be the last where ``lldb-mi`` is shipped as part of LLDB.
   The tool will still be available in a `downstream repository on GitHub
   `_.


Index: docs/ReleaseNotes.rst
===
--- docs/ReleaseNotes.rst
+++ docs/ReleaseNotes.rst
@@ -131,6 +131,8 @@
 
 * Backtraces are now color highlighting in the terminal.
 
+* DWARF4 (debug_types) and DWARF5 (debug_info) type units are now supported.
+
 * This release will be the last where ``lldb-mi`` is shipped as part of LLDB.
   The tool will still be available in a `downstream repository on GitHub
   `_.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

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

`lldbassert(x)` already expands to `assert(x)` in a debug 
(LLDB_CONFIGURATION_DEBUG) build. It sounds like you want this to assert in a 
non-debug build which has assertions enabled (Release+Assertions) ? If that's 
the case, then I think we should just change the `#ifdef 
LLDB_CONFIGURATION_DEBUG` in `LLDBAssert.h` into `#ifdef _DEBUG`..


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64267



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


[Lldb-commits] [PATCH] D64365: [lldb] Let table gen create command option initializers.

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

I like this, though I am not really familiar with details of implementing a 
tablegen backend. This should make it easier to migrate to the llvmOption 
library, once we arrive to that point.




Comment at: lldb/utils/TableGen/LLDBOptionDefEmitter.cpp:26
+/// Map of command names to their associated records.
+typedef std::map> RecordsByCommand;
+

llvm::StringMap



Comment at: lldb/utils/TableGen/LLDBTableGen.cpp:31
+
+namespace {
+cl::opt

use static instead of anonymous namespace.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D64365



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


[Lldb-commits] [PATCH] D64163: Change LaunchThread interface to return an expected.

2019-07-08 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: lldb/trunk/source/Core/Debugger.cpp:1652
+} else {
+  LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST),
+   "failed to launch host thread: {}",

I'm sorry to be such a nag, but this is incorrect for two reasons:
- this won't clear the error object if logging is disabled. There's an 
LLDB_LOG_ERROR macro to handle that correctly.
- llvm::formatv does not accept `{}` as a format argument. You need to use 
`{0}` instead.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64163



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


[Lldb-commits] [lldb] r365388 - [lldb] Fix two more issues in Windows following rL365226: Change LaunchThread interface to return an expected

2019-07-08 Thread Stella Stamenova via lldb-commits
Author: stella.stamenova
Date: Mon Jul  8 14:17:58 2019
New Revision: 365388

URL: http://llvm.org/viewvc/llvm-project?rev=365388&view=rev
Log:
[lldb] Fix two more issues in Windows following rL365226: Change LaunchThread 
interface to return an expected

A couple of the function signatures changed and they were not updated in the 
Windows HostProcess

Modified:
lldb/trunk/include/lldb/Host/windows/HostProcessWindows.h
lldb/trunk/source/Host/windows/HostProcessWindows.cpp

Modified: lldb/trunk/include/lldb/Host/windows/HostProcessWindows.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/HostProcessWindows.h?rev=365388&r1=365387&r2=365388&view=diff
==
--- lldb/trunk/include/lldb/Host/windows/HostProcessWindows.h (original)
+++ lldb/trunk/include/lldb/Host/windows/HostProcessWindows.h Mon Jul  8 
14:17:58 2019
@@ -30,8 +30,9 @@ public:
   lldb::pid_t GetProcessId() const override;
   bool IsRunning() const override;
 
-  HostThread StartMonitoring(const Host::MonitorChildProcessCallback &callback,
- bool monitor_signals) override;
+  virtual llvm::Expected
+  StartMonitoring(const Host::MonitorChildProcessCallback &callback,
+  bool monitor_signals) override;
 
 private:
   static lldb::thread_result_t MonitorThread(void *thread_arg);

Modified: lldb/trunk/source/Host/windows/HostProcessWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/HostProcessWindows.cpp?rev=365388&r1=365387&r2=365388&view=diff
==
--- lldb/trunk/source/Host/windows/HostProcessWindows.cpp (original)
+++ lldb/trunk/source/Host/windows/HostProcessWindows.cpp Mon Jul  8 14:17:58 
2019
@@ -94,7 +94,7 @@ llvm::Expected HostProcessWi
 &info->process_handle, 0, FALSE, 
DUPLICATE_SAME_ACCESS))
 result = ThreadLauncher::LaunchThread("ChildProcessMonitor",
   HostProcessWindows::MonitorThread,
-  info, nullptr);
+  info);
   return result;
 }
 


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


[Lldb-commits] [PATCH] D64042: [Symbol] Improve Variable::GetLanguage

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

ping


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

https://reviews.llvm.org/D64042



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


[Lldb-commits] [lldb] r365390 - [Windows] Convert GetLastError to std::error_code

2019-07-08 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jul  8 14:19:02 2019
New Revision: 365390

URL: http://llvm.org/viewvc/llvm-project?rev=365390&view=rev
Log:
[Windows] Convert GetLastError to std::error_code

Create a std::error_code from the result of GetLastError, which in turn
we can use to return an llvm::Error.

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

Modified: lldb/trunk/source/Host/common/ThreadLauncher.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/ThreadLauncher.cpp?rev=365390&r1=365389&r2=365390&view=diff
==
--- lldb/trunk/source/Host/common/ThreadLauncher.cpp (original)
+++ lldb/trunk/source/Host/common/ThreadLauncher.cpp Mon Jul  8 14:19:02 2019
@@ -31,8 +31,10 @@ llvm::Expected ThreadLaunche
   thread = (lldb::thread_t)::_beginthreadex(
   0, (unsigned)min_stack_byte_size,
   HostNativeThread::ThreadCreateTrampoline, info_ptr, 0, NULL);
-  if (thread == (lldb::thread_t)(-1L))
-return llvm::errorCodeToError(::GetLastError());
+  if (thread == (lldb::thread_t)(-1L)) {
+DWORD err = GetLastError();
+return llvm::errorCodeToError(std::error_code(err, 
std::system_category()));
+  }
 #else
 
 // ASAN instrumentation adds a lot of bookkeeping overhead on stack frames.


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


[Lldb-commits] [PATCH] D64362: Remove lldb-perf

2019-07-08 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.

Thanks Jonas, yes we need to come up with a perf testing infrastructure in lldb 
but there isn't a lot of value in this original attempt from c. 2013.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D64362



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


[Lldb-commits] [PATCH] D64365: [lldb] Let table gen create command option initializers.

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

- Added comment that std::map is also used to make sure our commands are sorted.
- anonymous namespace -> static


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

https://reviews.llvm.org/D64365

Files:
  lldb/CMakeLists.txt
  lldb/cmake/modules/AddLLDB.cmake
  lldb/source/Commands/BreakpointList.td
  lldb/source/Commands/CMakeLists.txt
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectHelp.cpp
  lldb/source/Commands/CommandObjectSettings.cpp
  lldb/source/Commands/Options.td
  lldb/source/Commands/OptionsBase.td
  lldb/utils/TableGen/CMakeLists.txt
  lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
  lldb/utils/TableGen/LLDBTableGen.cpp
  lldb/utils/TableGen/LLDBTableGenBackends.h

Index: lldb/utils/TableGen/LLDBTableGenBackends.h
===
--- /dev/null
+++ lldb/utils/TableGen/LLDBTableGenBackends.h
@@ -0,0 +1,35 @@
+//===- LLDBTableGenBackends.h - Declarations for LLDB TableGen Backends ---===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+//
+// This file contains the declarations for all of the LLDB TableGen
+// backends. A "TableGen backend" is just a function. See
+// "$LLVM_ROOT/utils/TableGen/TableGenBackends.h" for more info.
+//
+//===--===//
+
+#ifndef LLVM_LLDB_UTILS_TABLEGEN_TABLEGENBACKENDS_H
+#define LLVM_LLDB_UTILS_TABLEGEN_TABLEGENBACKENDS_H
+
+#include 
+
+namespace llvm {
+class raw_ostream;
+class RecordKeeper;
+} // namespace llvm
+
+using llvm::raw_ostream;
+using llvm::RecordKeeper;
+
+namespace lldb_private {
+
+void EmitOptionDefs(RecordKeeper &RK, raw_ostream &OS);
+
+} // namespace lldb_private
+
+#endif
Index: lldb/utils/TableGen/LLDBTableGen.cpp
===
--- /dev/null
+++ lldb/utils/TableGen/LLDBTableGen.cpp
@@ -0,0 +1,72 @@
+//===- TableGen.cpp - Top-Level TableGen implementation for Clang -===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+//
+// This file contains the main function for Clang's TableGen.
+//
+//===--===//
+
+#include "LLDBTableGenBackends.h" // Declares all backends.
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/PrettyStackTrace.h"
+#include "llvm/Support/Signals.h"
+#include "llvm/TableGen/Error.h"
+#include "llvm/TableGen/Main.h"
+#include "llvm/TableGen/Record.h"
+
+using namespace llvm;
+using namespace lldb_private;
+
+enum ActionType {
+  PrintRecords,
+  DumpJSON,
+  GenOptionDefs,
+};
+
+static cl::opt
+Action(cl::desc("Action to perform:"),
+   cl::values(clEnumValN(PrintRecords, "print-records",
+ "Print all records to stdout (default)"),
+  clEnumValN(DumpJSON, "dump-json",
+ "Dump all records as machine-readable JSON"),
+  clEnumValN(GenOptionDefs, "gen-lldb-option-defs",
+ "Generate clang attribute clases")));
+
+static bool LLDBTableGenMain(raw_ostream &OS, RecordKeeper &Records) {
+  switch (Action) {
+  case PrintRecords:
+OS << Records; // No argument, dump all contents
+break;
+  case DumpJSON:
+EmitJSON(Records, OS);
+break;
+  case GenOptionDefs:
+EmitOptionDefs(Records, OS);
+break;
+  }
+  return false;
+}
+
+int main(int argc, char **argv) {
+  sys::PrintStackTraceOnErrorSignal(argv[0]);
+  PrettyStackTraceProgram X(argc, argv);
+  cl::ParseCommandLineOptions(argc, argv);
+
+  llvm_shutdown_obj Y;
+
+  return TableGenMain(argv[0], &LLDBTableGenMain);
+}
+
+#ifdef __has_feature
+#if __has_feature(address_sanitizer)
+#include 
+// Disable LeakSanitizer for this binary as it has too many leaks that are not
+// very interesting to fix. See compiler-rt/include/sanitizer/lsan_interface.h .
+int __lsan_is_turned_off() { return 1; }
+#endif // __has_feature(address_sanitizer)
+#endif // defined(__has_feature)
Index: lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
===
--- /dev/null
+++ lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
@@ -0,0 +1,145 @@
+//===- LLDBOptionDefEmitter.cpp - Generate LLDB command options =-*- C++ -*--=//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See 

[Lldb-commits] [PATCH] D64365: [lldb] Let table gen create command option initializers.

2019-07-08 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor marked 3 inline comments as done.
teemperor added inline comments.



Comment at: lldb/utils/TableGen/LLDBOptionDefEmitter.cpp:26
+/// Map of command names to their associated records.
+typedef std::map> RecordsByCommand;
+

labath wrote:
> llvm::StringMap
So the map is also supposed to make sure that our commands in the options file 
are (deterministically) sorted, so that's why it's just a map. I documented 
that now.


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

https://reviews.llvm.org/D64365



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


[Lldb-commits] [PATCH] D57880: Add assert for 'bad' code path in GetUniqueNamespaceDeclaration

2019-07-08 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added inline comments.



Comment at: lldb/trunk/source/Symbol/ClangASTContext.cpp:1957
   } else {
-// BAD!!!
+assert(false && "GetUniqueNamespaceDeclaration called with no name and 
"
+"no namespace as decl_ctx");

We don't have a way to trigger this branch?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D57880



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


[Lldb-commits] [PATCH] D64159: [Core] Generalize ValueObject::MaybeCalculateCompleteType

2019-07-08 Thread Alex Langford via Phabricator via lldb-commits
xiaobai marked 2 inline comments as done.
xiaobai added inline comments.



Comment at: include/lldb/Target/ObjCLanguageRuntime.h:253
 
+  CompilerType CalculateCompleteType(CompilerType base_type) override;
+

clayborg wrote:
> Is this named correctly? Maybe this should be named "CompilerType 
> GetRuntimeType(CompilerType base_type) override;"? 
> 
> What this function does is gets the real definition from the objective C 
> runtime at the moment. This name would better reflect what is going on and 
> would be something we might ask of a runtime.
> 
I have no problem with renaming it "GetRuntimeType". Will do that.



Comment at: source/Target/ObjCLanguageRuntime.cpp:403
+CompilerType
+ObjCLanguageRuntime::CalculateCompleteType(CompilerType base_type) {
+  CompilerType type_to_return;

clayborg wrote:
> So a main question for ObjC here: do we always want to show the runtime type? 
> Should we not check if the class inside of "base_type" is the one true 
> definition and skip grabbing the runtime type here and return {}?
How do you know which is the "one true definition"?


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

https://reviews.llvm.org/D64159



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


[Lldb-commits] [PATCH] D64042: [Symbol] Improve Variable::GetLanguage

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

Why did you make this a function of Variable, rather than SymbolContextScope?


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

https://reviews.llvm.org/D64042



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


[Lldb-commits] [lldb] r365391 - Remove lldb-perf

2019-07-08 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jul  8 14:38:34 2019
New Revision: 365391

URL: http://llvm.org/viewvc/llvm-project?rev=365391&view=rev
Log:
Remove lldb-perf

As discussed offline, this tool is no longer used or maintained, and
doesn't provide the right abstraction for performance tracking in lldb.

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

Removed:
lldb/trunk/tools/lldb-perf/README
lldb/trunk/tools/lldb-perf/common/
lldb/trunk/tools/lldb-perf/darwin/formatters/
lldb/trunk/tools/lldb-perf/darwin/sketch/sketch.cpp
lldb/trunk/tools/lldb-perf/lib/
lldb/trunk/tools/lldb-perf/lldbperf.xcodeproj/
Modified:
lldb/trunk/lldb.xcworkspace/contents.xcworkspacedata

Modified: lldb/trunk/lldb.xcworkspace/contents.xcworkspacedata
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcworkspace/contents.xcworkspacedata?rev=365391&r1=365390&r2=365391&view=diff
==
--- lldb/trunk/lldb.xcworkspace/contents.xcworkspacedata (original)
+++ lldb/trunk/lldb.xcworkspace/contents.xcworkspacedata Mon Jul  8 14:38:34 
2019
@@ -7,7 +7,4 @@


-   
-   
 

Removed: lldb/trunk/tools/lldb-perf/README
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-perf/README?rev=365390&view=auto
==
--- lldb/trunk/tools/lldb-perf/README (original)
+++ lldb/trunk/tools/lldb-perf/README (removed)
@@ -1,295 +0,0 @@
- The lldb-perf infrastructure for LLDB performance testing
-===
-
-lldb-perf is an infrastructure meant to simplify the creation of performance 
-tests for the LLDB debugger. It is contained in liblldbperf.a which is part of
-the standard opensource checkout of LLDB
-
-Its main concepts are:
-- Gauges: a gauge is a thing that takes a sample. Samples include elapsed time,
-  memory used, and energy consumed.
-- Metrics: a metric is a collection of samples that knows how to do statistics
-  like sum() and average(). Metrics can be extended as needed.
-- Measurements: a measurement is the thing that stores an action, a gauge and
-  a metric. You define measurements as in “take the time to run this 
function”,
-  “take the memory to run this block of code”, and then after you invoke 
it, 
-  your stats will automagically be there.
-- Tests: a test is a sequence of steps and measurements.
-
-Tests cases should be added as targets to the lldbperf.xcodeproj project. It 
-is probably easiest to duplicate one of the existing targets. In order to 
-write a test based on lldb-perf, you need to subclass  lldb_perf::TestCase:
-
-using namespace lldb_perf;
-
-class FormattersTest : public TestCase
-{
-
-Usually, you will define measurements as variables of your test case class:
-
-private:
-// C++ formatters
-TimeMeasurement> 
m_dump_std_vector_measurement;
-TimeMeasurement> m_dump_std_list_measurement;
-TimeMeasurement> m_dump_std_map_measurement;
-TimeMeasurement> 
m_dump_std_string_measurement;
-
-// Cocoa formatters
-TimeMeasurement> m_dump_nsstring_measurement;
-TimeMeasurement> m_dump_nsarray_measurement;
-TimeMeasurement> 
m_dump_nsdictionary_measurement;
-TimeMeasurement> m_dump_nsset_measurement;
-TimeMeasurement> m_dump_nsbundle_measurement;
-TimeMeasurement> m_dump_nsdate_measurement;
-
-A TimeMeasurement is, obviously, a class that measures “how much time to run 
-this block of code”. The block of code is passed as an std::function which 
you
-can construct with a lambda! You need to give the prototype of your block of
-code. In this example, we run blocks of code that take an SBValue and return
-nothing.
-
-These blocks look like:
-
-m_dump_std_vector_measurement = CreateTimeMeasurement([] (SBValue value) 
-> void {
-lldb_perf::Xcode::FetchVariable (value,1,false);
-}, "std-vector", "time to dump an std::vector");
-
-Here we are saying: make me a measurement named “std-vector”, whose 
-description is “time to dump an std::vector” and that takes the time 
required
-to call lldb_perf::Xcode::FetchVariable(value,1,false).
-
-The Xcode class is a collection of utility functions that replicate common
-Xcode patterns (FetchVariable unsurprisingly calls API functions that Xcode
-could use when populating a variables view entry - the 1 means “expand 1 
level
-of depth” and the false means “do not dump the data to stdout”)
-
-A full constructor for a TestCase looks like:
-
-FormattersTest () : TestCase()
-{
-m_dump_std_vector_measurement = CreateTimeMeasurement([] (SBValue value) 
-> void {
-lldb_perf::Xcode::FetchVariable (value,1,false);
-}, "std-vector", "time to dump an std::vector");
-m_dump_std_list_measurement = CreateTimeMeasurement([] (SBValue value) -> 
void {
-lldb_perf::Xcode::FetchVariable (value,1,false);
-}, "std-list", "time to dump an std::list")

[Lldb-commits] [PATCH] D57880: Add assert for 'bad' code path in GetUniqueNamespaceDeclaration

2019-07-08 Thread Davide Italiano via Phabricator via lldb-commits
davide added inline comments.



Comment at: lldb/trunk/source/Symbol/ClangASTContext.cpp:1957
   } else {
-// BAD!!!
+assert(false && "GetUniqueNamespaceDeclaration called with no name and 
"
+"no namespace as decl_ctx");

shafik wrote:
> We don't have a way to trigger this branch?
I guess this is the whole point of the assertion. It can't be hit. BTW, you can 
replace it with `llvm_unreachable()`


Repository:
  rL LLVM

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

https://reviews.llvm.org/D57880



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


[Lldb-commits] [lldb] r365392 - Remove install-headers

2019-07-08 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jul  8 14:53:22 2019
New Revision: 365392

URL: http://llvm.org/viewvc/llvm-project?rev=365392&view=rev
Log:
Remove install-headers

After discussing this internally, it is my understanding this was used
for building LLDB internally at Apple, and is no longer used or
necessary.

Removed:
lldb/trunk/tools/install-headers/
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=365392&r1=365391&r2=365392&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Jul  8 14:53:22 2019
@@ -16,7 +16,6 @@
dependencies = (
26B391F11A6DCCBE00456239 /* PBXTargetDependency 
*/,
26CEF3B014FD591F007286B2 /* PBXTargetDependency 
*/,
-   2687EACD1508115900DD8C2E /* PBXTargetDependency 
*/,
);
name = desktop_no_xpc;
productName = snowleopard;
@@ -30,7 +29,6 @@
dependencies = (
26CEF3BB14FD595B007286B2 /* PBXTargetDependency 
*/,
26B391EF1A6DCCAF00456239 /* PBXTargetDependency 
*/,
-   2687EACB1508115000DD8C2E /* PBXTargetDependency 
*/,
);
name = desktop;
productName = desktop;
@@ -45,7 +43,6 @@
dependencies = (
AFCA21D21D18E556004386B8 /* PBXTargetDependency 
*/,
26CEF3C214FD5973007286B2 /* PBXTargetDependency 
*/,
-   2687EACF1508116300DD8C2E /* PBXTargetDependency 
*/,
);
name = ios;
productName = ios;
@@ -1188,27 +1185,6 @@
remoteGlobalIDString = 26680206115FD0ED008E1FE4;
remoteInfo = LLDB;
};
-   2687EACA1508115000DD8C2E /* PBXContainerItemProxy */ = {
-   isa = PBXContainerItemProxy;
-   containerPortal = 08FB7793FE84155DC02AAC07 /* Project 
object */;
-   proxyType = 1;
-   remoteGlobalIDString = 2687EAC51508110B00DD8C2E;
-   remoteInfo = "install-headers";
-   };
-   2687EACC1508115900DD8C2E /* PBXContainerItemProxy */ = {
-   isa = PBXContainerItemProxy;
-   containerPortal = 08FB7793FE84155DC02AAC07 /* Project 
object */;
-   proxyType = 1;
-   remoteGlobalIDString = 2687EAC51508110B00DD8C2E;
-   remoteInfo = "install-headers";
-   };
-   2687EACE1508116300DD8C2E /* PBXContainerItemProxy */ = {
-   isa = PBXContainerItemProxy;
-   containerPortal = 08FB7793FE84155DC02AAC07 /* Project 
object */;
-   proxyType = 1;
-   remoteGlobalIDString = 2687EAC51508110B00DD8C2E;
-   remoteInfo = "install-headers";
-   };
2689011413353E9B00698AC0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project 
object */;
@@ -7181,20 +7157,6 @@
passBuildSettingsInEnvironment = 1;
productName = "LLDB Python Test Suite";
};
-   2687EAC51508110B00DD8C2E /* install-headers */ = {
-   isa = PBXLegacyTarget;
-   buildArgumentsString = "$(ACTION)";
-   buildConfigurationList = 2687EAC61508110B00DD8C2E /* 
Build configuration list for PBXLegacyTarget "install-headers" */;
-   buildPhases = (
-   );
-   buildToolPath = /usr/bin/make;
-   buildWorkingDirectory = 
"$(SRCROOT)/tools/install-headers";
-   dependencies = (
-   );
-   name = "install-headers";
-   passBuildSettingsInEnvironment = 1;
-   productName = "install-headers";
-   };
 /* End PBXLegacyTarget section */
 
 /* Begin PBXNativeTarget section */
@@ -7448,7 +7410,6 @@
26579F67126A25920007C5CB /* darwin-debug */,
2689FFC913353D7A00698AC0 /* lldb-core */,
26DC6A0F1337FE6900FF7998 /* lldb-server */,
-   2687EAC51508110B00DD8C2E /* i

[Lldb-commits] [PATCH] D64042: [Symbol] Improve Variable::GetLanguage

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

In D64042#1574438 , @jingham wrote:

> Why did you make this a function of Variable, rather than SymbolContextScope?


After thinking about it more, I realized that the implementation inside of 
SymbolContextScope would be identical or near identical to the implementation 
in SymbolContext. I thought that because `IsRuntimeSupportValue` requires that 
you have a Variable, that it would make sense to ask the Variable for its 
language. An alternative could be to ask the SymbolContext for its language 
instead, which I think will be effectively equivalent here.

I also noticed that there's a lot of repetitive code around asking for 
languages. Everybody always guesses from the mangled name and asks the 
compilation unit at some point during the process. Adding another 
implementation inside of SymbolContextScope would kind of add to the cruft a 
bit here I think.


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

https://reviews.llvm.org/D64042



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


[Lldb-commits] [PATCH] D64159: [Core] Generalize ValueObject::MaybeCalculateCompleteType

2019-07-08 Thread Jim Ingham via Phabricator via lldb-commits
jingham added inline comments.



Comment at: source/Target/ObjCLanguageRuntime.cpp:403
+CompilerType
+ObjCLanguageRuntime::CalculateCompleteType(CompilerType base_type) {
+  CompilerType type_to_return;

xiaobai wrote:
> clayborg wrote:
> > So a main question for ObjC here: do we always want to show the runtime 
> > type? Should we not check if the class inside of "base_type" is the one 
> > true definition and skip grabbing the runtime type here and return {}?
> How do you know which is the "one true definition"?
The only places you can add ivars to an ObjC class are in the @interface 
declaration (which is usually in the .h file for the class) and in the 
@implementation and the "class category" - which has to be in the same source 
file as the @implementation.  So if you find debug information for the .m file 
that contains the @implementation you have seen all the ivars of the class.  
Clang marks that fact by putting "DW_AT_APPLE_objc_complete_type" with value 
"true" in the DW_TAG_structure_type die for the class.  If you see a type 
definition so marked, that it the "one true definition".


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

https://reviews.llvm.org/D64159



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


[Lldb-commits] [PATCH] D57880: Add assert for 'bad' code path in GetUniqueNamespaceDeclaration

2019-07-08 Thread Davide Italiano via Phabricator via lldb-commits
davide added inline comments.



Comment at: lldb/trunk/source/Symbol/ClangASTContext.cpp:1957
   } else {
-// BAD!!!
+assert(false && "GetUniqueNamespaceDeclaration called with no name and 
"
+"no namespace as decl_ctx");

davide wrote:
> shafik wrote:
> > We don't have a way to trigger this branch?
> I guess this is the whole point of the assertion. It can't be hit. BTW, you 
> can replace it with `llvm_unreachable()`
"can't" in this context is a very strong word. It shouldn't. If it gets hit, we 
should remove the assertion.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D57880



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


[Lldb-commits] [PATCH] D64365: [lldb] Let table gen create command option initializers.

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

This is awesome, thanks for doing this! I was also thinking about doing 
something like this at some point as well. :)




Comment at: lldb/cmake/modules/AddLLDB.cmake:17
+  if( NOT LTG_SOURCE )
+message(FATAL_ERROR "SOURCE source-file required by clang_tablegen")
+  endif()

`clang_tablegen` -> `lldb_tablegen`



Comment at: lldb/source/Commands/BreakpointList.td:1
+include "Options.td"
+

Is BreakpointList.td used? I noticed `hide_aliases` is also implemented in 
Options.td too.


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

https://reviews.llvm.org/D64365



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


[Lldb-commits] [PATCH] D64365: [lldb] Let table gen create command option initializers.

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



Comment at: lldb/cmake/modules/AddLLDB.cmake:16
+
+  if( NOT LTG_SOURCE )
+message(FATAL_ERROR "SOURCE source-file required by clang_tablegen")

nit: remove the spaces to be consistent. 



Comment at: lldb/utils/TableGen/LLDBOptionDefEmitter.cpp:57
+
+  // If we have any grous, we merge them. Otherwise we move this option into
+  // the all group.

s/grous/groups/



Comment at: lldb/utils/TableGen/LLDBOptionDefEmitter.cpp:68
+  if (auto R = Option->getValue("Required"))
+OS << "true";
+  else

ternary operator?



Comment at: lldb/utils/TableGen/LLDBTableGenBackends.h:1
+//===- LLDBTableGenBackends.h - Declarations for LLDB TableGen Backends 
---===//
+//

Use the new license header.


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

https://reviews.llvm.org/D64365



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


Re: [Lldb-commits] [lldb] r365390 - [Windows] Convert GetLastError to std::error_code

2019-07-08 Thread Pavel Labath via lldb-commits
Are you sure this will actually produce something meaningful? I know
llvm usually uses llvm::mapWindowsError for this kind of thing...

On Mon, 8 Jul 2019 at 14:18, Jonas Devlieghere via lldb-commits
 wrote:
>
> Author: jdevlieghere
> Date: Mon Jul  8 14:19:02 2019
> New Revision: 365390
>
> URL: http://llvm.org/viewvc/llvm-project?rev=365390&view=rev
> Log:
> [Windows] Convert GetLastError to std::error_code
>
> Create a std::error_code from the result of GetLastError, which in turn
> we can use to return an llvm::Error.
>
> Modified:
> lldb/trunk/source/Host/common/ThreadLauncher.cpp
>
> Modified: lldb/trunk/source/Host/common/ThreadLauncher.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/ThreadLauncher.cpp?rev=365390&r1=365389&r2=365390&view=diff
> ==
> --- lldb/trunk/source/Host/common/ThreadLauncher.cpp (original)
> +++ lldb/trunk/source/Host/common/ThreadLauncher.cpp Mon Jul  8 14:19:02 2019
> @@ -31,8 +31,10 @@ llvm::Expected ThreadLaunche
>thread = (lldb::thread_t)::_beginthreadex(
>0, (unsigned)min_stack_byte_size,
>HostNativeThread::ThreadCreateTrampoline, info_ptr, 0, NULL);
> -  if (thread == (lldb::thread_t)(-1L))
> -return llvm::errorCodeToError(::GetLastError());
> +  if (thread == (lldb::thread_t)(-1L)) {
> +DWORD err = GetLastError();
> +return llvm::errorCodeToError(std::error_code(err, 
> std::system_category()));
> +  }
>  #else
>
>  // ASAN instrumentation adds a lot of bookkeeping overhead on stack frames.
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r365400 - [lldb, windows] When StartMonitoring fails, return a proper error

2019-07-08 Thread Stella Stamenova via lldb-commits
Author: stella.stamenova
Date: Mon Jul  8 15:09:08 2019
New Revision: 365400

URL: http://llvm.org/viewvc/llvm-project?rev=365400&view=rev
Log:
[lldb, windows] When StartMonitoring fails, return a proper error

This is possible now that the function returns an llvm::Expected

Modified:
lldb/trunk/source/Host/windows/HostProcessWindows.cpp

Modified: lldb/trunk/source/Host/windows/HostProcessWindows.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/HostProcessWindows.cpp?rev=365400&r1=365399&r2=365400&view=diff
==
--- lldb/trunk/source/Host/windows/HostProcessWindows.cpp (original)
+++ lldb/trunk/source/Host/windows/HostProcessWindows.cpp Mon Jul  8 15:09:08 
2019
@@ -82,20 +82,21 @@ bool HostProcessWindows::IsRunning() con
 
 llvm::Expected HostProcessWindows::StartMonitoring(
 const Host::MonitorChildProcessCallback &callback, bool monitor_signals) {
-  HostThread monitor_thread;
   MonitorInfo *info = new MonitorInfo;
   info->callback = callback;
 
   // Since the life of this HostProcessWindows instance and the life of the
   // process may be different, duplicate the handle so that the monitor thread
   // can have ownership over its own copy of the handle.
-  HostThread result;
   if (::DuplicateHandle(GetCurrentProcess(), m_process, GetCurrentProcess(),
-&info->process_handle, 0, FALSE, 
DUPLICATE_SAME_ACCESS))
-result = ThreadLauncher::LaunchThread("ChildProcessMonitor",
-  HostProcessWindows::MonitorThread,
-  info);
-  return result;
+&info->process_handle, 0, FALSE, 
DUPLICATE_SAME_ACCESS)) {
+return ThreadLauncher::LaunchThread("ChildProcessMonitor",
+HostProcessWindows::MonitorThread,
+info);
+  } else {
+DWORD err = GetLastError();
+return llvm::errorCodeToError(std::error_code(err, 
std::system_category()));
+  }
 }
 
 lldb::thread_result_t HostProcessWindows::MonitorThread(void *thread_arg) {


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


[Lldb-commits] [PATCH] D64366: Add lldb type unit support to the release notes

2019-07-08 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

🎉


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64366



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


[Lldb-commits] [PATCH] D64373: Don't use PyInt on Python 3

2019-07-08 Thread Christian Biesinger via Phabricator via lldb-commits
cbiesinger created this revision.
cbiesinger added a reviewer: clayborg.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

In Python 3, PyInt doesn't exist (all integers are PyLongs). This patch
makes LLVM not use PyInt when compiling for Python 3. (Some code already
had such #ifs)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64373

Files:
  lldb/scripts/Python/python-swigsafecast.swig
  lldb/scripts/Python/python-typemaps.swig
  lldb/tools/intel-features/scripts/python-typemaps.txt

Index: lldb/tools/intel-features/scripts/python-typemaps.txt
===
--- lldb/tools/intel-features/scripts/python-typemaps.txt
+++ lldb/tools/intel-features/scripts/python-typemaps.txt
@@ -2,9 +2,12 @@
 
 // typemap for an incoming buffer
 %typemap(in) (void *buf, size_t size) {
+#if PY_MAJOR_VERSION < 3
if (PyInt_Check($input)) {
   $2 = PyInt_AsLong($input);
-   } else if (PyLong_Check($input)) {
+   } else
+#endif
+   if (PyLong_Check($input)) {
   $2 = PyLong_AsLong($input);
} else {
   PyErr_SetString(PyExc_ValueError, "Expecting an integer or long object");
Index: lldb/scripts/Python/python-typemaps.swig
===
--- lldb/scripts/Python/python-typemaps.swig
+++ lldb/scripts/Python/python-typemaps.swig
@@ -102,11 +102,20 @@
 // typemap for a char buffer
 // See also SBThread::GetStopDescription.
 %typemap(in) (char *dst, size_t dst_len) {
+   // In Python 3, all integers are PyLongs
+#if PY_MAJOR_VERSION < 3
if (!PyInt_Check($input)) {
+#else
+   if (!PyLong_Check($input)) {
+#endif
PyErr_SetString(PyExc_ValueError, "Expecting an integer");
return NULL;
}
+#if PY_MAJOR_VERSION < 3
$2 = PyInt_AsLong($input);
+#else
+   $2 = PyLong_AsLong($input);
+#endif
if ($2 <= 0) {
PyErr_SetString(PyExc_ValueError, "Positive integer expected");
return NULL;
@@ -191,9 +200,14 @@
 // typemap for an incoming buffer
 // See also SBProcess::ReadMemory.
 %typemap(in) (void *buf, size_t size) {
+   // In Python 3, all integers are PyLongs, so the PyInt code is only needed
+   // on Python 2.
+#if PY_MAJOR_VERSION < 3
if (PyInt_Check($input)) {
   $2 = PyInt_AsLong($input);
-   } else if (PyLong_Check($input)) {
+   } else
+#endif
+   if (PyLong_Check($input)) {
   $2 = PyLong_AsLong($input);
} else {
   PyErr_SetString(PyExc_ValueError, "Expecting an integer or long object");
@@ -245,9 +259,14 @@
 
 template 
 bool SetNumberFromPyObject(T &number, PyObject *obj) {
+   // In Python 3, all integers are PyLongs, so the PyInt code is only needed
+   // on Python 2.
+#if PY_MAJOR_VERSION < 3
   if (PyInt_Check(obj))
 number = static_cast(PyInt_AsLong(obj));
-  else if (PyLong_Check(obj))
+  else
+#endif
+  if (PyLong_Check(obj))
 number = PyLongAsT(obj);
   else return false;
 
@@ -333,7 +352,11 @@
 PyObject* list = PyList_New(count);
 for (uint32_t j = 0; j < count; j++)
 {
+#if PY_MAJOR_VERSION < 3
 PyObject* item = PyInt_FromLong($1[j]);
+#else
+PyObject* item = PyLong_FromLong($1[j]);
+#endif
 int ok = PyList_SetItem(list,j,item);
 if (ok != 0)
 {
Index: lldb/scripts/Python/python-swigsafecast.swig
===
--- lldb/scripts/Python/python-swigsafecast.swig
+++ lldb/scripts/Python/python-swigsafecast.swig
@@ -31,7 +31,11 @@
 {
 if (!c_int)
 return NULL;
+#if PY_MAJOR_VERSION < 3
 return PyInt_FromLong(*c_int);
+#else
+return PyLong_FromLong(*c_int);
+#endif
 }
 
 template <>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r365390 - [Windows] Convert GetLastError to std::error_code

2019-07-08 Thread Jim Ingham via lldb-commits
Why is the thread ID getting checked against -1L? Did Windows not define 
LLDB_INVALID_HOST_THREAD?

Jim

> On Jul 8, 2019, at 3:06 PM, Pavel Labath via lldb-commits 
>  wrote:
> 
> Are you sure this will actually produce something meaningful? I know
> llvm usually uses llvm::mapWindowsError for this kind of thing...
> 
> On Mon, 8 Jul 2019 at 14:18, Jonas Devlieghere via lldb-commits
>  wrote:
>> 
>> Author: jdevlieghere
>> Date: Mon Jul  8 14:19:02 2019
>> New Revision: 365390
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=365390&view=rev
>> Log:
>> [Windows] Convert GetLastError to std::error_code
>> 
>> Create a std::error_code from the result of GetLastError, which in turn
>> we can use to return an llvm::Error.
>> 
>> Modified:
>>lldb/trunk/source/Host/common/ThreadLauncher.cpp
>> 
>> Modified: lldb/trunk/source/Host/common/ThreadLauncher.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/ThreadLauncher.cpp?rev=365390&r1=365389&r2=365390&view=diff
>> ==
>> --- lldb/trunk/source/Host/common/ThreadLauncher.cpp (original)
>> +++ lldb/trunk/source/Host/common/ThreadLauncher.cpp Mon Jul  8 14:19:02 2019
>> @@ -31,8 +31,10 @@ llvm::Expected ThreadLaunche
>>   thread = (lldb::thread_t)::_beginthreadex(
>>   0, (unsigned)min_stack_byte_size,
>>   HostNativeThread::ThreadCreateTrampoline, info_ptr, 0, NULL);
>> -  if (thread == (lldb::thread_t)(-1L))
>> -return llvm::errorCodeToError(::GetLastError());
>> +  if (thread == (lldb::thread_t)(-1L)) {
>> +DWORD err = GetLastError();
>> +return llvm::errorCodeToError(std::error_code(err, 
>> std::system_category()));
>> +  }
>> #else
>> 
>> // ASAN instrumentation adds a lot of bookkeeping overhead on stack frames.
>> 
>> 
>> ___
>> lldb-commits mailing list
>> lldb-commits@lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


[Lldb-commits] [lldb] r365403 - [ThreadLauncher] Use mapWindowsError and LLDB_INVALID_HOST_THREAD

2019-07-08 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jul  8 15:45:59 2019
New Revision: 365403

URL: http://llvm.org/viewvc/llvm-project?rev=365403&view=rev
Log:
[ThreadLauncher] Use mapWindowsError and LLDB_INVALID_HOST_THREAD

Address post-commit feedback from Pavel and Jim.

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

Modified: lldb/trunk/source/Host/common/ThreadLauncher.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/ThreadLauncher.cpp?rev=365403&r1=365402&r2=365403&view=diff
==
--- lldb/trunk/source/Host/common/ThreadLauncher.cpp (original)
+++ lldb/trunk/source/Host/common/ThreadLauncher.cpp Mon Jul  8 15:45:59 2019
@@ -31,10 +31,8 @@ llvm::Expected ThreadLaunche
   thread = (lldb::thread_t)::_beginthreadex(
   0, (unsigned)min_stack_byte_size,
   HostNativeThread::ThreadCreateTrampoline, info_ptr, 0, NULL);
-  if (thread == (lldb::thread_t)(-1L)) {
-DWORD err = GetLastError();
-return llvm::errorCodeToError(std::error_code(err, 
std::system_category()));
-  }
+  if (thread == LLDB_INVALID_HOST_THREAD)
+return llvm::errorCodeToError(llvm::mapWindowsError(GetLastError()));
 #else
 
 // ASAN instrumentation adds a lot of bookkeeping overhead on stack frames.


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


Re: [Lldb-commits] [lldb] r365390 - [Windows] Convert GetLastError to std::error_code

2019-07-08 Thread Jonas Devlieghere via lldb-commits
Thank you for the comments. Addressed in r365403.

On Mon, Jul 8, 2019 at 3:40 PM Jim Ingham  wrote:

> Why is the thread ID getting checked against -1L? Did Windows not define
> LLDB_INVALID_HOST_THREAD?
>
> Jim
>
> > On Jul 8, 2019, at 3:06 PM, Pavel Labath via lldb-commits <
> lldb-commits@lists.llvm.org> wrote:
> >
> > Are you sure this will actually produce something meaningful? I know
> > llvm usually uses llvm::mapWindowsError for this kind of thing...
> >
> > On Mon, 8 Jul 2019 at 14:18, Jonas Devlieghere via lldb-commits
> >  wrote:
> >>
> >> Author: jdevlieghere
> >> Date: Mon Jul  8 14:19:02 2019
> >> New Revision: 365390
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=365390&view=rev
> >> Log:
> >> [Windows] Convert GetLastError to std::error_code
> >>
> >> Create a std::error_code from the result of GetLastError, which in turn
> >> we can use to return an llvm::Error.
> >>
> >> Modified:
> >>lldb/trunk/source/Host/common/ThreadLauncher.cpp
> >>
> >> Modified: lldb/trunk/source/Host/common/ThreadLauncher.cpp
> >> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/ThreadLauncher.cpp?rev=365390&r1=365389&r2=365390&view=diff
> >>
> ==
> >> --- lldb/trunk/source/Host/common/ThreadLauncher.cpp (original)
> >> +++ lldb/trunk/source/Host/common/ThreadLauncher.cpp Mon Jul  8
> 14:19:02 2019
> >> @@ -31,8 +31,10 @@ llvm::Expected ThreadLaunche
> >>   thread = (lldb::thread_t)::_beginthreadex(
> >>   0, (unsigned)min_stack_byte_size,
> >>   HostNativeThread::ThreadCreateTrampoline, info_ptr, 0, NULL);
> >> -  if (thread == (lldb::thread_t)(-1L))
> >> -return llvm::errorCodeToError(::GetLastError());
> >> +  if (thread == (lldb::thread_t)(-1L)) {
> >> +DWORD err = GetLastError();
> >> +return llvm::errorCodeToError(std::error_code(err,
> std::system_category()));
> >> +  }
> >> #else
> >>
> >> // ASAN instrumentation adds a lot of bookkeeping overhead on stack
> frames.
> >>
> >>
> >> ___
> >> lldb-commits mailing list
> >> lldb-commits@lists.llvm.org
> >> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> > ___
> > lldb-commits mailing list
> > lldb-commits@lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D64373: Don't use PyInt on Python 3

2019-07-08 Thread Christian Biesinger via Phabricator via lldb-commits
cbiesinger abandoned this revision.
cbiesinger added a comment.

It seems this wasn't necessary, I had just misconfigured my build. (I don't 
understand how this works though...)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64373



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


[Lldb-commits] [PATCH] D64365: [lldb] Let table gen create command option initializers.

2019-07-08 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 208539.
teemperor marked 3 inline comments as done.
teemperor added a comment.

- Addressed feedback


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

https://reviews.llvm.org/D64365

Files:
  lldb/CMakeLists.txt
  lldb/cmake/modules/AddLLDB.cmake
  lldb/source/Commands/CMakeLists.txt
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectHelp.cpp
  lldb/source/Commands/CommandObjectSettings.cpp
  lldb/source/Commands/Options.td
  lldb/source/Commands/OptionsBase.td
  lldb/utils/TableGen/CMakeLists.txt
  lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
  lldb/utils/TableGen/LLDBTableGen.cpp
  lldb/utils/TableGen/LLDBTableGenBackends.h

Index: lldb/utils/TableGen/LLDBTableGenBackends.h
===
--- /dev/null
+++ lldb/utils/TableGen/LLDBTableGenBackends.h
@@ -0,0 +1,34 @@
+//===- TableGen.cpp - Top-Level TableGen implementation for Clang -===//
+//
+// 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
+//
+//===--===//
+//
+// This file contains the declarations for all of the LLDB TableGen
+// backends. A "TableGen backend" is just a function. See
+// "$LLVM_ROOT/utils/TableGen/TableGenBackends.h" for more info.
+//
+//===--===//
+
+#ifndef LLVM_LLDB_UTILS_TABLEGEN_TABLEGENBACKENDS_H
+#define LLVM_LLDB_UTILS_TABLEGEN_TABLEGENBACKENDS_H
+
+#include 
+
+namespace llvm {
+class raw_ostream;
+class RecordKeeper;
+} // namespace llvm
+
+using llvm::raw_ostream;
+using llvm::RecordKeeper;
+
+namespace lldb_private {
+
+void EmitOptionDefs(RecordKeeper &RK, raw_ostream &OS);
+
+} // namespace lldb_private
+
+#endif
Index: lldb/utils/TableGen/LLDBTableGen.cpp
===
--- /dev/null
+++ lldb/utils/TableGen/LLDBTableGen.cpp
@@ -0,0 +1,71 @@
+//===- TableGen.cpp - Top-Level TableGen implementation for Clang -===//
+//
+// 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
+//
+//===--===//
+//
+// This file contains the main function for Clang's TableGen.
+//
+//===--===//
+
+#include "LLDBTableGenBackends.h" // Declares all backends.
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/PrettyStackTrace.h"
+#include "llvm/Support/Signals.h"
+#include "llvm/TableGen/Error.h"
+#include "llvm/TableGen/Main.h"
+#include "llvm/TableGen/Record.h"
+
+using namespace llvm;
+using namespace lldb_private;
+
+enum ActionType {
+  PrintRecords,
+  DumpJSON,
+  GenOptionDefs,
+};
+
+static cl::opt
+Action(cl::desc("Action to perform:"),
+   cl::values(clEnumValN(PrintRecords, "print-records",
+ "Print all records to stdout (default)"),
+  clEnumValN(DumpJSON, "dump-json",
+ "Dump all records as machine-readable JSON"),
+  clEnumValN(GenOptionDefs, "gen-lldb-option-defs",
+ "Generate clang attribute clases")));
+
+static bool LLDBTableGenMain(raw_ostream &OS, RecordKeeper &Records) {
+  switch (Action) {
+  case PrintRecords:
+OS << Records; // No argument, dump all contents
+break;
+  case DumpJSON:
+EmitJSON(Records, OS);
+break;
+  case GenOptionDefs:
+EmitOptionDefs(Records, OS);
+break;
+  }
+  return false;
+}
+
+int main(int argc, char **argv) {
+  sys::PrintStackTraceOnErrorSignal(argv[0]);
+  PrettyStackTraceProgram X(argc, argv);
+  cl::ParseCommandLineOptions(argc, argv);
+
+  llvm_shutdown_obj Y;
+
+  return TableGenMain(argv[0], &LLDBTableGenMain);
+}
+
+#ifdef __has_feature
+#if __has_feature(address_sanitizer)
+#include 
+// Disable LeakSanitizer for this binary as it has too many leaks that are not
+// very interesting to fix. See compiler-rt/include/sanitizer/lsan_interface.h .
+int __lsan_is_turned_off() { return 1; }
+#endif // __has_feature(address_sanitizer)
+#endif // defined(__has_feature)
Index: lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
===
--- /dev/null
+++ lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
@@ -0,0 +1,141 @@
+//===- TableGen.cpp - Top-Level TableGen implementation for Clang -===//
+//
+// 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 WIT

[Lldb-commits] [PATCH] D64365: [lldb] Let table gen create command option initializers.

2019-07-08 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor marked 5 inline comments as done.
teemperor added a comment.

Thanks for the feedback!




Comment at: lldb/source/Commands/BreakpointList.td:1
+include "Options.td"
+

xiaobai wrote:
> Is BreakpointList.td used? I noticed `hide_aliases` is also implemented in 
> Options.td too.
Yeah, that was just me accidentally adding some unneeded file I used for 
prototyping. Thanks!


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

https://reviews.llvm.org/D64365



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


[Lldb-commits] [PATCH] D64365: [lldb] Let table gen create command option initializers.

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

Do you know how you are going to do enum option values?


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

https://reviews.llvm.org/D64365



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


[Lldb-commits] [PATCH] D64365: [lldb] Let table gen create command option initializers.

2019-07-08 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor marked an inline comment as done.
teemperor added a comment.

In D64365#1574785 , @jingham wrote:

> Do you know how you are going to do enum option values?


We could implement the enums in our table gen file, but then we would have the 
enums duplicated in code and table gen (unless we also table gen the enum 
definition). At the moment I'm just using plain strings in table gen which then 
get type checked by Clang during compilation. The *.inc file should have enough 
comments in it that it should be trivial to find out in what option definition 
you made a typo.

But I'm open to suggestions how to make this more user-friendly if people 
encounter problems with this.


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

https://reviews.llvm.org/D64365



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


[Lldb-commits] [lldb] r365416 - [crashlog] Fix a mismatch between bytes and strings.

2019-07-08 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Jul  8 18:05:12 2019
New Revision: 365416

URL: http://llvm.org/viewvc/llvm-project?rev=365416&view=rev
Log:
[crashlog] Fix a mismatch between bytes and strings.

The functions in read_plist() want bytes as input, not
strings.



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

Modified: lldb/trunk/examples/python/crashlog.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/crashlog.py?rev=365416&r1=365415&r2=365416&view=diff
==
--- lldb/trunk/examples/python/crashlog.py (original)
+++ lldb/trunk/examples/python/crashlog.py Mon Jul  8 18:05:12 2019
@@ -300,7 +300,7 @@ class CrashLog(symbolication.Symbolicato
 if os.path.exists(self.dsymForUUIDBinary):
 dsym_for_uuid_command = '%s %s' % (
 self.dsymForUUIDBinary, uuid_str)
-s = subprocess.check_output(dsym_for_uuid_command, 
shell=True).decode("utf-8")
+s = subprocess.check_output(dsym_for_uuid_command, shell=True)
 if s:
 try:
 plist_root = read_plist(s)


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


[Lldb-commits] [lldb] r365420 - [Windows] Include ErrorHandling.h

2019-07-08 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jul  8 18:35:31 2019
New Revision: 365420

URL: http://llvm.org/viewvc/llvm-project?rev=365420&view=rev
Log:
[Windows] Include ErrorHandling.h

Include ErrorHandling.h for mapWindowsError.

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

Modified: lldb/trunk/source/Host/common/ThreadLauncher.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/ThreadLauncher.cpp?rev=365420&r1=365419&r2=365420&view=diff
==
--- lldb/trunk/source/Host/common/ThreadLauncher.cpp (original)
+++ lldb/trunk/source/Host/common/ThreadLauncher.cpp Mon Jul  8 18:35:31 2019
@@ -17,6 +17,8 @@
 #include "lldb/Host/windows/windows.h"
 #endif
 
+#include "llvm/Support/ErrorHandling.h"
+
 using namespace lldb;
 using namespace lldb_private;
 


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


[Lldb-commits] [lldb] r365421 - Fix ASCII art header

2019-07-08 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon Jul  8 18:35:34 2019
New Revision: 365421

URL: http://llvm.org/viewvc/llvm-project?rev=365421&view=rev
Log:
Fix ASCII art header

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

Modified: lldb/trunk/source/Host/common/ThreadLauncher.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/ThreadLauncher.cpp?rev=365421&r1=365420&r2=365421&view=diff
==
--- lldb/trunk/source/Host/common/ThreadLauncher.cpp (original)
+++ lldb/trunk/source/Host/common/ThreadLauncher.cpp Mon Jul  8 18:35:34 2019
@@ -1,5 +1,4 @@
-//===-- ThreadLauncher.cpp ---*- C++
-//-*-===//
+//===-- ThreadLauncher.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.


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


[Lldb-commits] [PATCH] D64194: [lldb] Fix crash due to unicode characters and dollars in variable names.

2019-07-08 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 208569.
teemperor retitled this revision from "[lldb] Fix crash due to dollar character 
in variable names." to "[lldb] Fix crash due to unicode characters and dollars 
in variable names.".
teemperor edited the summary of this revision.
teemperor added a comment.

- Rewrote the patch to use the Clang lexer, dropped our ad-hoc lexer.
- Make sure we only lex the expression once, not for each local variable.
- Added tests for unicode characters and a bunch of dollar-related corner 
cases. The current behavior seems reasonable and what people expect in the 
comments, so I just keep them around.

I would prefer if we could just consider this patch as a regression fix and not 
some official support for dollar-variables in user code (which seems like a 
mess to define properly). I added some tests that at least make sure the 
current behavior is tested, we can decide later if that's really what we want 
to do (but the current behavior seems quite reasonable and similar to what 
people suggest).


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

https://reviews.llvm.org/D64194

Files:
  
lldb/packages/Python/lldbsuite/test/expression_command/dollar-in-variable/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/dollar-in-variable/TestDollarInVariable.py
  
lldb/packages/Python/lldbsuite/test/expression_command/dollar-in-variable/main.c
  
lldb/packages/Python/lldbsuite/test/expression_command/unicode-in-variable/Makefile
  
lldb/packages/Python/lldbsuite/test/expression_command/unicode-in-variable/TestUnicodeInVariable.py
  
lldb/packages/Python/lldbsuite/test/expression_command/unicode-in-variable/main.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp

Index: lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
===
--- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
+++ lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
@@ -9,6 +9,8 @@
 #include "ClangExpressionSourceCode.h"
 
 #include "clang/Basic/CharInfo.h"
+#include "clang/Basic/SourceManager.h"
+#include "clang/Lex/Lexer.h"
 #include "llvm/ADT/StringRef.h"
 
 #include "Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h"
@@ -164,44 +166,87 @@
   }
 }
 
-/// Checks if the expression body contains the given variable as a token.
-/// \param body The expression body.
-/// \param var The variable token we are looking for.
-/// \return True iff the expression body containes the variable as a token.
-static bool ExprBodyContainsVar(llvm::StringRef body, llvm::StringRef var) {
-  assert(var.find_if([](char c) { return !clang::isIdentifierBody(c); }) ==
- llvm::StringRef::npos &&
- "variable contains non-identifier chars?");
-
-  size_t start = 0;
-  // Iterate over all occurences of the variable string in our expression.
-  while ((start = body.find(var, start)) != llvm::StringRef::npos) {
-// We found our variable name in the expression. Check that the token
-// that contains our needle is equal to our variable and not just contains
-// the character sequence by accident.
-// Prevents situations where we for example inlcude the variable 'FOO' in an
-// expression like 'FOObar + 1'.
-bool has_characters_before =
-start != 0 && clang::isIdentifierBody(body[start - 1]);
-bool has_characters_after =
-start + var.size() < body.size() &&
-clang::isIdentifierBody(body[start + var.size()]);
-
-// Our token just contained the variable name as a substring. Continue
-// searching the rest of the expression.
-if (has_characters_before || has_characters_after) {
-  ++start;
+namespace {
+/// Allows checking if a token is contained in a given expression.
+class TokenVerifier {
+  /// The tokens we found in the expression.
+  llvm::StringSet<> m_tokens;
+
+public:
+  TokenVerifier(std::string body);
+  /// Returns true iff the given expression body contained a token with the
+  /// given content.
+  bool hasToken(llvm::StringRef token) const {
+return m_tokens.find(token) != m_tokens.end();
+  }
+};
+} // namespace
+
+TokenVerifier::TokenVerifier(std::string body) {
+  using namespace clang;
+
+  // We only care about tokens and not their original source locations. If we
+  // move the whole expression to only be in one line we can simplify the
+  // following code that extracts the token contents.
+  std::replace(body.begin(), body.end(), '\n', ' ');
+  std::replace(body.begin(), body.end(), '\r', ' ');
+
+  FileSystemOptions file_opts;
+  FileManager file_mgr(file_opts,
+   FileSystem::Instance().GetVirtualFileSystem());
+
+  // Let's build the actual source code Clang needs and setup some utility
+  // objects.
+  llvm::IntrusiveRefCntPtr diag_ids(new DiagnosticIDs());
+  llvm::IntrusiveRefCntPtr diags_opts(
+  new DiagnosticOptio