[Lldb-commits] [lldb] r321016 - Fix more inconsistent line endings. NFC.

2017-12-18 Thread Dimitry Andric via lldb-commits
Author: dim
Date: Mon Dec 18 11:46:56 2017
New Revision: 321016

URL: http://llvm.org/viewvc/llvm-project?rev=321016&view=rev
Log:
Fix more inconsistent line endings. NFC.

Modified:
lldb/trunk/www/build.html
lldb/trunk/www/test.html

Modified: lldb/trunk/www/build.html
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/www/build.html?rev=321016&r1=321015&r2=321016&view=diff
==
--- lldb/trunk/www/build.html (original)
+++ lldb/trunk/www/build.html Mon Dec 18 11:46:56 2017
@@ -123,20 +123,20 @@
   
 
 Sample command line:
-cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 
-DPYTHON_HOME=C:\Python35 
-DLLDB_TEST_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe 
..\..\llvm
-Working with both Ninja and MSVC
-
-  Compiling with ninja is both faster and simpler 
than compiling with MSVC, but chances are you still want
-  to debug LLDB with MSVC (at least until we can debug LLDB on 
Windows with LLDB!).  One solution to this is to run 
-  cmake twice and generate the output into two 
different folders.  One for compiling (the ninja
-  folder), and one for editing / browsing / debugging (the MSVC 
folder).
-
-
-  To do this, simply run `cmake -G Ninja 
` from one folder, and 
-  `cmake -G "Visual Studio 14 2015" 
` in another folder.  Then you can open the .sln file
-  in Visual Studio, set lldb as the startup project, 
and use F5 to run it.  You need only edit the project
-  settings to set the executable and the working directory to 
point to binaries inside of the ninja tree.
-
+cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 
-DPYTHON_HOME=C:\Python35 
-DLLDB_TEST_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe 
..\..\llvm
+Working with both Ninja and MSVC
+
+  Compiling with ninja is both faster and simpler 
than compiling with MSVC, but chances are you still want
+  to debug LLDB with MSVC (at least until we can debug LLDB on 
Windows with LLDB!).  One solution to this is to run 
+  cmake twice and generate the output into two 
different folders.  One for compiling (the ninja
+  folder), and one for editing / browsing / debugging (the MSVC 
folder).
+
+
+  To do this, simply run `cmake -G Ninja 
` from one folder, and 
+  `cmake -G "Visual Studio 14 2015" 
` in another folder.  Then you can open the .sln file
+  in Visual Studio, set lldb as the startup project, 
and use F5 to run it.  You need only edit the project
+  settings to set the executable and the working directory to 
point to binaries inside of the ninja tree.
+
   
 
 

Modified: lldb/trunk/www/test.html
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/www/test.html?rev=321016&r1=321015&r2=321016&view=diff
==
--- lldb/trunk/www/test.html (original)
+++ lldb/trunk/www/test.html Mon Dec 18 11:46:56 2017
@@ -27,13 +27,13 @@
   both the LLDB command line interface and the scripting API.
 
   
-  Running tests
+  Running tests
   
 Running the full test suite
 
-  Windows Note: In the examples that follow, any 
invocations of python
-  should be replaced with python_d, the debug 
interpreter, when running the test
-  suite against a debug version of LLDB.
+  Windows Note: In the examples that follow, any 
invocations of python
+  should be replaced with python_d, the debug 
interpreter, when running the test
+  suite against a debug version of LLDB.
 
 
   The easiest way to run the LLDB test suite is to use the 
check-lldb build
@@ -134,93 +134,93 @@
   Debugging test failures
   
 Non-Windows platforms
-
-  On non-Windows platforms, you can use the -d option 
to dotest.py which will cause the script to wait
+
+  On non-Windows platforms, you can use the -d option 
to dotest.py which will cause the script to wait
   for a while until a debugger is attached.
 
-Windows
+Windows
 
-  On Windows, it is strongly recommended to use https://github.com/Microsoft/PTVS/releases";>Python Tools for Visual 
Studio
-  for debugging test failures.  It can seamlessly step between 
native and managed code, which is very helpful when you need to step
-  through the test itself, and then into the LLDB code that

Re: [Lldb-commits] [lldb] r280755 - Reorder FreeBSD Host.cpp #includes to fix build

2016-09-06 Thread Dimitry Andric via lldb-commits
In general,  and  headers should be at the top, followed by 
standard headers such as , then followed by application-specific 
headers.  IIRC this is also the case for Linux.

-Dimitry

> On 07 Sep 2016, at 00:02, Zachary Turner via lldb-commits 
>  wrote:
> 
> Why was this causing a problem?  The only headers that were re-ordered are 
> system headers.  Does FreeBSD's libraries have requirements about certain 
> headers being included before other headers?
> 
> On Tue, Sep 6, 2016 at 2:33 PM Ed Maste via lldb-commits 
> mailto:lldb-commits@lists.llvm.org>> wrote:
> Author: emaste
> Date: Tue Sep  6 16:25:31 2016
> New Revision: 280755
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=280755&view=rev 
> 
> Log:
> Reorder FreeBSD Host.cpp #includes to fix build
> 
> Modified:
> lldb/trunk/source/Host/freebsd/Host.cpp
> 
> Modified: lldb/trunk/source/Host/freebsd/Host.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=280755&r1=280754&r2=280755&view=diff
>  
> 
> ==
> --- lldb/trunk/source/Host/freebsd/Host.cpp (original)
> +++ lldb/trunk/source/Host/freebsd/Host.cpp Tue Sep  6 16:25:31 2016
> @@ -9,17 +9,19 @@
>  
> //===--===//
> 
>  // C Includes
> -#include 
> -#include 
> -#include 
> +#include 
> +
> +#include 
>  #include 
> +#include 
>  #include 
> -#include 
>  #include 
> 
>  #include 
> -#include 
> -#include 
> +
> +#include 
> +#include 
> +#include 
> 
>  // C++ Includes
>  // Other libraries and framework includes
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org 
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D16027: Replace accidental DOS (and mixed) line endings in a few text files

2016-01-09 Thread Dimitry Andric via lldb-commits
dim created this revision.
dim added reviewers: emaste, jingham.
dim added a subscriber: lldb-commits.

Similar to rL256704 and rL256707, fix a few text files which were
accidentally checked in with DOS line endings, or mixed line endings.

http://reviews.llvm.org/D16027

Files:
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp
  packages/Python/lldbsuite/test/make/test_common.h
  source/Commands/CommandObjectLanguage.cpp
  source/Plugins/Process/Windows/Live/IDebugDelegate.h
  www/lldb-coding-conventions.html
  www/source.html

Index: www/source.html
===
--- www/source.html
+++ www/source.html
@@ -29,53 +29,53 @@
   
 For non-Mac platforms, and for MacOSX building with CMake (not Xcode), you should check out your sources to adhere to
 the following directory structure:
-  
-  llvm
-  |
-  `-- tools
-  |
-  +-- clang
-  |
-  `-- lldb
-
+  
+  llvm
+  |
+  `-- tools
+  |
+  +-- clang
+  |
+  `-- lldb
+
   
-  
-For MacOSX building from Xcode, simply checkout LLDB and then build from Xcode.  The Xcode project will
-automatically detect that it is a fresh checkout, and checkout LLVM and clang automatically.  Unlike other
-platforms / build systems, it will use the following directory structure.
-  
-  lldb
-  |
-  `-- llvm
-  |
-  +-- tools
-  |
-  `-- clang
-
-
-So updating your checkout will consist of updating lldb, llvm, and clang in these locations.
-  
-  
-Refer to the Build Instructions for more detailed instructions on how to build for a particular
-platform / build system combination.
+  
+For MacOSX building from Xcode, simply checkout LLDB and then build from Xcode.  The Xcode project will
+automatically detect that it is a fresh checkout, and checkout LLVM and clang automatically.  Unlike other
+platforms / build systems, it will use the following directory structure.
+  
+  lldb
+  |
+  `-- llvm
+  |
+  +-- tools
+  |
+  `-- clang
+
+
+So updating your checkout will consist of updating lldb, llvm, and clang in these locations.
+  
+  
+Refer to the Build Instructions for more detailed instructions on how to build for a particular
+platform / build system combination.
   
 
 			
 			
 Contributing to LLDB
 
-  
-Please refer to the http://llvm.org/docs/DeveloperPolicy.html";>LLVM Developer Policy
-for information about authoring and uploading a patch.  LLDB differs from the LLVM Developer Policy in
-the following respects.
-
-  Coding conventions.  Refer to LLDB Coding Conventions.
-  
-Test infrastructure.  It is still important to submit tests with your patches, but LLDB uses a different
-system for tests.  Refer to the lldb/test folder on disk for examples of how to write tests.
-  
-
-For anything not explicitly listed here, assume that LLDB follows the LLVM policy.
+  
+Please refer to the http://llvm.org/docs/DeveloperPolicy.html";>LLVM Developer Policy
+for information about authoring and uploading a patch.  LLDB differs from the LLVM Developer Policy in
+the following respects.
+
+  Coding conventions.  Refer to LLDB Coding Conventions.
+  
+Test infrastructure.  It is still important to submit tests with your patches, but LLDB uses a different
+system for tests.  Refer to the lldb/test folder on disk for examples of how to write tests.
+  
+
+For anything not explicitly listed here, assume that LLDB follows the LLVM policy.
   
 
 
Index: www/lldb-coding-conventions.html
===
--- www/lldb-coding-conventions.html
+++ www/lldb-coding-conventions.html
@@ -22,20 +22,20 @@
 
   The LLDB coding conventions differ in a few important respects from LLVM.
   
- 

Re: [Lldb-commits] [PATCH] D16027: Replace accidental DOS (and mixed) line endings in a few text files

2016-01-11 Thread Dimitry Andric via lldb-commits
dim updated this revision to Diff 44525.
dim added a comment.

Updating for upstream changes.


http://reviews.llvm.org/D16027

Files:
  
packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp
  source/Commands/CommandObjectLanguage.cpp
  source/Plugins/Process/Windows/Live/IDebugDelegate.h
  www/lldb-coding-conventions.html
  www/source.html

Index: www/source.html
===
--- www/source.html
+++ www/source.html
@@ -29,53 +29,53 @@
   
 For non-Mac platforms, and for MacOSX building with CMake (not Xcode), you should check out your sources to adhere to
 the following directory structure:
-  
-  llvm
-  |
-  `-- tools
-  |
-  +-- clang
-  |
-  `-- lldb
-
+  
+  llvm
+  |
+  `-- tools
+  |
+  +-- clang
+  |
+  `-- lldb
+
   
-  
-For MacOSX building from Xcode, simply checkout LLDB and then build from Xcode.  The Xcode project will
-automatically detect that it is a fresh checkout, and checkout LLVM and clang automatically.  Unlike other
-platforms / build systems, it will use the following directory structure.
-  
-  lldb
-  |
-  `-- llvm
-  |
-  +-- tools
-  |
-  `-- clang
-
-
-So updating your checkout will consist of updating lldb, llvm, and clang in these locations.
-  
-  
-Refer to the Build Instructions for more detailed instructions on how to build for a particular
-platform / build system combination.
+  
+For MacOSX building from Xcode, simply checkout LLDB and then build from Xcode.  The Xcode project will
+automatically detect that it is a fresh checkout, and checkout LLVM and clang automatically.  Unlike other
+platforms / build systems, it will use the following directory structure.
+  
+  lldb
+  |
+  `-- llvm
+  |
+  +-- tools
+  |
+  `-- clang
+
+
+So updating your checkout will consist of updating lldb, llvm, and clang in these locations.
+  
+  
+Refer to the Build Instructions for more detailed instructions on how to build for a particular
+platform / build system combination.
   
 
 			
 			
 Contributing to LLDB
 
-  
-Please refer to the http://llvm.org/docs/DeveloperPolicy.html";>LLVM Developer Policy
-for information about authoring and uploading a patch.  LLDB differs from the LLVM Developer Policy in
-the following respects.
-
-  Coding conventions.  Refer to LLDB Coding Conventions.
-  
-Test infrastructure.  It is still important to submit tests with your patches, but LLDB uses a different
-system for tests.  Refer to the lldb/test folder on disk for examples of how to write tests.
-  
-
-For anything not explicitly listed here, assume that LLDB follows the LLVM policy.
+  
+Please refer to the http://llvm.org/docs/DeveloperPolicy.html";>LLVM Developer Policy
+for information about authoring and uploading a patch.  LLDB differs from the LLVM Developer Policy in
+the following respects.
+
+  Coding conventions.  Refer to LLDB Coding Conventions.
+  
+Test infrastructure.  It is still important to submit tests with your patches, but LLDB uses a different
+system for tests.  Refer to the lldb/test folder on disk for examples of how to write tests.
+  
+
+For anything not explicitly listed here, assume that LLDB follows the LLVM policy.
   
 
 
Index: www/lldb-coding-conventions.html
===
--- www/lldb-coding-conventions.html
+++ www/lldb-coding-conventions.html
@@ -22,20 +22,20 @@
 
   The LLDB coding conventions differ in a few important respects from LLVM.
   
-  
-Note that http://clang.llvm.org/docs/ClangFormat.html";>clang-format will deal with
-most of t

[Lldb-commits] [lldb] r257361 - Replace accidental DOS (and mixed) line endings in a few text files

2016-01-11 Thread Dimitry Andric via lldb-commits
Author: dim
Date: Mon Jan 11 12:07:47 2016
New Revision: 257361

URL: http://llvm.org/viewvc/llvm-project?rev=257361&view=rev
Log:
Replace accidental DOS (and mixed) line endings in a few text files

Summary:
Similar to rL256704 and rL256707, fix a few text files which were
accidentally checked in with DOS line endings, or mixed line endings.

Reviewers: jingham, emaste

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D16027

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp
lldb/trunk/source/Commands/CommandObjectLanguage.cpp
lldb/trunk/source/Plugins/Process/Windows/Live/IDebugDelegate.h
lldb/trunk/www/lldb-coding-conventions.html
lldb/trunk/www/source.html

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp?rev=257361&r1=257360&r2=257361&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/fizzbuzz.cpp
 Mon Jan 11 12:07:47 2016
@@ -1,31 +1,31 @@
-// A sample program for getting minidumps on Windows.
-
-#include 
-
-bool
-fizz(int x)
-{
-return x % 3 == 0;
-}
-
-bool
-buzz(int x)
-{
-return x % 5 == 0;
-}
-
-int
-main()
-{
-int *buggy = 0;
-
-for (int i = 1; i <= 100; ++i)
-{
-if (fizz(i)) std::cout << "fizz";
-if (buzz(i)) std::cout << "buzz";
-if (!fizz(i) && !buzz(i)) std::cout << i;
-std::cout << '\n';
-}
-
-return *buggy;
-}
+// A sample program for getting minidumps on Windows.
+
+#include 
+
+bool
+fizz(int x)
+{
+return x % 3 == 0;
+}
+
+bool
+buzz(int x)
+{
+return x % 5 == 0;
+}
+
+int
+main()
+{
+int *buggy = 0;
+
+for (int i = 1; i <= 100; ++i)
+{
+if (fizz(i)) std::cout << "fizz";
+if (buzz(i)) std::cout << "buzz";
+if (!fizz(i) && !buzz(i)) std::cout << i;
+std::cout << '\n';
+}
+
+return *buggy;
+}

Modified: lldb/trunk/source/Commands/CommandObjectLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectLanguage.cpp?rev=257361&r1=257360&r2=257361&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectLanguage.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectLanguage.cpp Mon Jan 11 12:07:47 
2016
@@ -1,41 +1,41 @@
-//===-- CommandObjectLanguage.cpp ---*- C++ 
-*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#include "CommandObjectLanguage.h"
-
-#include "lldb/Host/Host.h"
-
-#include "lldb/Interpreter/CommandInterpreter.h"
-#include "lldb/Interpreter/CommandReturnObject.h"
-
-#include "lldb/Target/Language.h"
-#include "lldb/Target/LanguageRuntime.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-CommandObjectLanguage::CommandObjectLanguage (CommandInterpreter &interpreter) 
:
-CommandObjectMultiword (interpreter,
-"language",
-"A set of commands for managing language-specific 
functionality.'.",
-"language   
[]"
-)
-{
-//Let the LanguageRuntime populates this command with subcommands
-LanguageRuntime::InitializeCommands(this);
-}
-
-void
-CommandObjectLanguage::GenerateHelpText (Stream &output_stream) {
-CommandObjectMultiword::GenerateHelpText(output_stream);
-}
-
-CommandObjectLanguage::~CommandObjectLanguage ()
-{
-}
+//===-- CommandObjectLanguage.cpp ---*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "CommandObjectLanguage.h"
+
+#include "lldb/Host/Host.h"
+
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/CommandReturnObject.h"
+
+#include "lldb/Target/Language.h"
+#include "lldb/Target/LanguageRuntime.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+CommandObjectLanguage::CommandObjectLanguage (CommandInterpreter &interpreter) 
:
+CommandObjectMultiword (interpreter,
+"language",
+"A set of commands for managing language-specific 
functionality.'.",
+"language   
[]"
+

[Lldb-commits] [lldb] [lldb][FreeBSD] Fix NativeRegisterContextFreeBSD_{arm,mips64,powerpc}… (PR #101403)

2024-07-31 Thread Dimitry Andric via lldb-commits

https://github.com/DimitryAndric created 
https://github.com/llvm/llvm-project/pull/101403

…() declarations

Similar to #97796, fix the type of the `native_thread` parameter for the arm, 
mips64 and powerpc variants of `NativeRegisterContextFreeBSD_*`.

Otherwise, this leads to compile errors similar to:


lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.cpp:85:39:
 error: out-of-line definition of 'NativeRegisterContextFreeBSD_powerpc' does 
not match any declaration in 
'lldb_private::process_freebsd::NativeRegisterContextFreeBSD_powerpc'
   85 | 
NativeRegisterContextFreeBSD_powerpc::NativeRegisterContextFreeBSD_powerpc(
  |   
^~~~

>From e01640f6d737edd957a85ab8e56ff7f47ff2a3b7 Mon Sep 17 00:00:00 2001
From: Dimitry Andric 
Date: Wed, 31 Jul 2024 22:13:19 +0200
Subject: [PATCH] [lldb][FreeBSD] Fix
 NativeRegisterContextFreeBSD_{arm,mips64,powerpc}() declarations

Similar to #97796, fix the type of the `native_thread` parameter for the
arm, mips64 and powerpc variants of `NativeRegisterContextFreeBSD_*`.

Otherwise, this leads to compile errors similar to:


lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.cpp:85:39:
 error: out-of-line definition of 'NativeRegisterContextFreeBSD_powerpc' does 
not match any declaration in 
'lldb_private::process_freebsd::NativeRegisterContextFreeBSD_powerpc'
   85 | 
NativeRegisterContextFreeBSD_powerpc::NativeRegisterContextFreeBSD_powerpc(
  |   
^~~~
---
 .../Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h  | 2 +-
 .../Process/FreeBSD/NativeRegisterContextFreeBSD_mips64.h   | 2 +-
 .../Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h 
b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h
index 89ffa617294aa..b9537e6952f6c 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h
@@ -30,7 +30,7 @@ class NativeProcessFreeBSD;
 class NativeRegisterContextFreeBSD_arm : public NativeRegisterContextFreeBSD {
 public:
   NativeRegisterContextFreeBSD_arm(const ArchSpec &target_arch,
-   NativeThreadProtocol &native_thread);
+   NativeThreadFreeBSD &native_thread);
 
   uint32_t GetRegisterSetCount() const override;
 
diff --git 
a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_mips64.h 
b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_mips64.h
index 0b4a508a7d5dd..286b4fd8d8b99 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_mips64.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_mips64.h
@@ -31,7 +31,7 @@ class NativeRegisterContextFreeBSD_mips64
 : public NativeRegisterContextFreeBSD {
 public:
   NativeRegisterContextFreeBSD_mips64(const ArchSpec &target_arch,
-  NativeThreadProtocol &native_thread);
+  NativeThreadFreeBSD &native_thread);
 
   uint32_t GetRegisterSetCount() const override;
 
diff --git 
a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h 
b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h
index 3df371036f915..420db822acc0f 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h
@@ -31,7 +31,7 @@ class NativeRegisterContextFreeBSD_powerpc
 : public NativeRegisterContextFreeBSD {
 public:
   NativeRegisterContextFreeBSD_powerpc(const ArchSpec &target_arch,
-   NativeThreadProtocol &native_thread);
+   NativeThreadFreeBSD &native_thread);
 
   uint32_t GetRegisterSetCount() const override;
 

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


[Lldb-commits] [lldb] [lldb][FreeBSD] Fix NativeRegisterContextFreeBSD_{arm,mips64,powerpc}… (PR #101403)

2024-08-01 Thread Dimitry Andric via lldb-commits

https://github.com/DimitryAndric closed 
https://github.com/llvm/llvm-project/pull/101403
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 7abfaa0 - [lldb] Define LLDB_VERSION_PATCH correctly

2022-04-29 Thread Dimitry Andric via lldb-commits

Author: Dimitry Andric
Date: 2022-04-29T19:29:51+02:00
New Revision: 7abfaa0a815a37ef6abd3ad7eb169007bdc36619

URL: 
https://github.com/llvm/llvm-project/commit/7abfaa0a815a37ef6abd3ad7eb169007bdc36619
DIFF: 
https://github.com/llvm/llvm-project/commit/7abfaa0a815a37ef6abd3ad7eb169007bdc36619.diff

LOG: [lldb] Define LLDB_VERSION_PATCH correctly

In commit ccf1469a4cdb lldb got its own generated Version.inc file, with
`LLDB_VERSION` macros. However, it used `LLDB_VERSION_PATCHLEVEL`
instead of the actually correct `LLDB_VERSION_PATCH`. Correct this.

Reviewed By: JDevlieghere

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

Added: 


Modified: 
lldb/include/lldb/Version/Version.inc.in
llvm/utils/gn/secondary/lldb/include/lldb/Version/BUILD.gn

Removed: 




diff  --git a/lldb/include/lldb/Version/Version.inc.in 
b/lldb/include/lldb/Version/Version.inc.in
index 5098bb1c2be5a..148bac2ffcff7 100644
--- a/lldb/include/lldb/Version/Version.inc.in
+++ b/lldb/include/lldb/Version/Version.inc.in
@@ -2,5 +2,5 @@
 #define LLDB_VERSION_STRING "@LLDB_VERSION@"
 #define LLDB_VERSION_MAJOR @LLDB_VERSION_MAJOR@
 #define LLDB_VERSION_MINOR @LLDB_VERSION_MINOR@
-#define LLDB_VERSION_PATCHLEVEL @LLDB_VERSION_PATCHLEVEL@
+#define LLDB_VERSION_PATCH @LLDB_VERSION_PATCH@
 #cmakedefine LLDB_FULL_VERSION_STRING "@LLDB_FULL_VERSION_STRING@"

diff  --git a/llvm/utils/gn/secondary/lldb/include/lldb/Version/BUILD.gn 
b/llvm/utils/gn/secondary/lldb/include/lldb/Version/BUILD.gn
index 43987b3712623..2093c57c50763 100644
--- a/llvm/utils/gn/secondary/lldb/include/lldb/Version/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/include/lldb/Version/BUILD.gn
@@ -9,7 +9,7 @@ write_cmake_config("version") {
 "LLDB_VERSION=$llvm_version",
 "LLDB_VERSION_MAJOR=$llvm_version_major",
 "LLDB_VERSION_MINOR=$llvm_version_minor",
-"LLDB_VERSION_PATCHLEVEL=$llvm_version_patch",
+"LLDB_VERSION_PATCH=$llvm_version_patch",
 "LLDB_FULL_VERSION_STRING=",
   ]
 }



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


[Lldb-commits] [lldb] b5a927b - [lldb] Move create_relative_symlink function up in CMake hierarchy

2021-11-23 Thread Dimitry Andric via lldb-commits

Author: Dimitry Andric
Date: 2021-11-23T21:59:49+01:00
New Revision: b5a927b972b2c07b4597e93ed0b57803bfc0e6ae

URL: 
https://github.com/llvm/llvm-project/commit/b5a927b972b2c07b4597e93ed0b57803bfc0e6ae
DIFF: 
https://github.com/llvm/llvm-project/commit/b5a927b972b2c07b4597e93ed0b57803bfc0e6ae.diff

LOG: [lldb] Move create_relative_symlink function up in CMake hierarchy

Configuring lldb with `LLDB_ENABLE_PYTHON=OFF` and `LLDB_ENABLE_LUA=ON` results 
in a CMake error:

CMake Error at lldb/bindings/lua/CMakeLists.txt:47 
(create_relative_symlink):
  Unknown CMake command "create_relative_symlink".
Call Stack (most recent call first):
  lldb/CMakeLists.txt:117 (finish_swig_lua)

This is because the CMake function `create_relative_symlink` only exists in 
`lldb/bindings/python/CMakeLists.txt`, and not in 
`lldb/bindings/lua/CMakeLists.txt`.

Move the function to `lldb/bindings/CMakeLists.txt`, so it is available for all 
language bindings.

Reviewed By: labath

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

Added: 


Modified: 
lldb/bindings/CMakeLists.txt
lldb/bindings/python/CMakeLists.txt

Removed: 




diff  --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt
index 9759b069fdc45..c8aa0bcf96817 100644
--- a/lldb/bindings/CMakeLists.txt
+++ b/lldb/bindings/CMakeLists.txt
@@ -31,6 +31,20 @@ set(SWIG_COMMON_FLAGS
   ${DARWIN_EXTRAS}
 )
 
+function(create_relative_symlink swig_target dest_file output_dir output_name)
+  get_filename_component(dest_file ${dest_file} ABSOLUTE)
+  get_filename_component(output_dir ${output_dir} ABSOLUTE)
+  file(RELATIVE_PATH rel_dest_file ${output_dir} ${dest_file})
+  if(CMAKE_HOST_UNIX)
+set(LLVM_LINK_OR_COPY create_symlink)
+  else()
+set(LLVM_LINK_OR_COPY copy)
+  endif()
+  add_custom_command(TARGET ${swig_target} POST_BUILD VERBATIM
+COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} ${rel_dest_file} 
${output_name}
+WORKING_DIRECTORY ${output_dir})
+endfunction()
+
 if (LLDB_ENABLE_PYTHON)
   add_subdirectory(python)
 endif()

diff  --git a/lldb/bindings/python/CMakeLists.txt 
b/lldb/bindings/python/CMakeLists.txt
index 1f7ed18a2a0cb..cecf1e0fc095f 100644
--- a/lldb/bindings/python/CMakeLists.txt
+++ b/lldb/bindings/python/CMakeLists.txt
@@ -52,20 +52,6 @@ function(create_python_package swig_target working_dir 
pkg_dir)
 WORKING_DIRECTORY ${working_dir})
 endfunction()
 
-function(create_relative_symlink swig_target dest_file output_dir output_name)
-  get_filename_component(dest_file ${dest_file} ABSOLUTE)
-  get_filename_component(output_dir ${output_dir} ABSOLUTE)
-  file(RELATIVE_PATH rel_dest_file ${output_dir} ${dest_file})
-  if(CMAKE_HOST_UNIX)
-set(LLVM_LINK_OR_COPY create_symlink)
-  else()
-set(LLVM_LINK_OR_COPY copy)
-  endif()
-  add_custom_command(TARGET ${swig_target} POST_BUILD VERBATIM
-COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} ${rel_dest_file} 
${output_name}
-WORKING_DIRECTORY ${output_dir})
-endfunction()
-
 function(finish_swig_python swig_target lldb_python_bindings_dir 
lldb_python_target_dir)
   # Add a Post-Build Event to copy over Python files and create the symlink to
   # liblldb.so for the Python API(hardlink on Windows).



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


[Lldb-commits] [lldb] 5033f07 - [lldb] Avoid unhandled Error in TypeSystemMap::GetTypeSystemForLanguage

2021-08-16 Thread Dimitry Andric via lldb-commits

Author: Dimitry Andric
Date: 2021-08-16T17:34:42+02:00
New Revision: 5033f0793fe6e8b36990e6ce9f9ec2bf2ff79923

URL: 
https://github.com/llvm/llvm-project/commit/5033f0793fe6e8b36990e6ce9f9ec2bf2ff79923
DIFF: 
https://github.com/llvm/llvm-project/commit/5033f0793fe6e8b36990e6ce9f9ec2bf2ff79923.diff

LOG: [lldb] Avoid unhandled Error in TypeSystemMap::GetTypeSystemForLanguage

When assertions are turned off, the `llvm::Error` value created at the
start of this function is overwritten using the move-assignment
operator, but the success value is never checked. Whenever a TypeSystem
cannot be found or created, this can lead to lldb core dumping with:

Program aborted due to an unhandled Error:
Error value was Success. (Note: Success values must still be checked prior 
to being destroyed).

Fix this by not creating a `llvm::Error` value in advance, and directly
returning the result of `llvm::make_error` instead, whenever an error is
encountered.

See also:  and
.

Reviewed By: teemperor

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

Added: 


Modified: 
lldb/source/Symbol/TypeSystem.cpp

Removed: 




diff  --git a/lldb/source/Symbol/TypeSystem.cpp 
b/lldb/source/Symbol/TypeSystem.cpp
index 252b06e269d6b..0b3f7e4f3bd4e 100644
--- a/lldb/source/Symbol/TypeSystem.cpp
+++ b/lldb/source/Symbol/TypeSystem.cpp
@@ -223,62 +223,32 @@ void TypeSystemMap::ForEach(std::function const &callback) {
 llvm::Expected TypeSystemMap::GetTypeSystemForLanguage(
 lldb::LanguageType language,
 llvm::Optional create_callback) {
-  llvm::Error error = llvm::Error::success();
-  assert(!error); // Check the success value when assertions are enabled
   std::lock_guard guard(m_mutex);
-  if (m_clear_in_progress) {
-error = llvm::make_error(
+  if (m_clear_in_progress)
+return llvm::make_error(
 "Unable to get TypeSystem because TypeSystemMap is being cleared",
 llvm::inconvertibleErrorCode());
-  } else {
-collection::iterator pos = m_map.find(language);
-if (pos != m_map.end()) {
-  auto *type_system = pos->second.get();
-  if (type_system) {
-llvm::consumeError(std::move(error));
-return *type_system;
-  }
-  error = llvm::make_error(
-  "TypeSystem for language " +
-  llvm::StringRef(Language::GetNameForLanguageType(language)) +
-  " doesn't exist",
-  llvm::inconvertibleErrorCode());
-  return std::move(error);
-}
 
-for (const auto &pair : m_map) {
-  if (pair.second && pair.second->SupportsLanguage(language)) {
-// Add a new mapping for "language" to point to an already existing
-// TypeSystem that supports this language
-m_map[language] = pair.second;
-if (pair.second.get()) {
-  llvm::consumeError(std::move(error));
-  return *pair.second.get();
-}
-error = llvm::make_error(
-"TypeSystem for language " +
-llvm::StringRef(Language::GetNameForLanguageType(language)) +
-" doesn't exist",
-llvm::inconvertibleErrorCode());
-return std::move(error);
-  }
-}
+  collection::iterator pos = m_map.find(language);
+  if (pos != m_map.end()) {
+auto *type_system = pos->second.get();
+if (type_system)
+  return *type_system;
+return llvm::make_error(
+"TypeSystem for language " +
+llvm::StringRef(Language::GetNameForLanguageType(language)) +
+" doesn't exist",
+llvm::inconvertibleErrorCode());
+  }
 
-if (!create_callback) {
-  error = llvm::make_error(
-  "Unable to find type system for language " +
-  llvm::StringRef(Language::GetNameForLanguageType(language)),
-  llvm::inconvertibleErrorCode());
-} else {
-  // Cache even if we get a shared pointer that contains a null type system
-  // back
-  TypeSystemSP type_system_sp = (*create_callback)();
-  m_map[language] = type_system_sp;
-  if (type_system_sp.get()) {
-llvm::consumeError(std::move(error));
-return *type_system_sp.get();
-  }
-  error = llvm::make_error(
+  for (const auto &pair : m_map) {
+if (pair.second && pair.second->SupportsLanguage(language)) {
+  // Add a new mapping for "language" to point to an already existing
+  // TypeSystem that supports this language
+  m_map[language] = pair.second;
+  if (pair.second.get())
+return *pair.second.get();
+  return llvm::make_error(
   "TypeSystem for language " +
   llvm::StringRef(Language::GetNameForLanguageType(language)) +
   " doesn't exist",
@@ -286,7 +256,23 @@ llvm::Expected 
TypeSystemMap::GetTypeSystemForLanguage(
 }
   }
 
-  return std::move(error);
+  if (!create_callback)
+return

[Lldb-commits] [lldb] 1ce07cd - Instantiate Error in Target::GetEntryPointAddress() only when necessary

2020-08-22 Thread Dimitry Andric via lldb-commits

Author: Dimitry Andric
Date: 2020-08-22T12:47:13+02:00
New Revision: 1ce07cd614beab5150a5440c7faf195009f99e2c

URL: 
https://github.com/llvm/llvm-project/commit/1ce07cd614beab5150a5440c7faf195009f99e2c
DIFF: 
https://github.com/llvm/llvm-project/commit/1ce07cd614beab5150a5440c7faf195009f99e2c.diff

LOG: Instantiate Error in Target::GetEntryPointAddress() only when necessary

When `Target::GetEntryPointAddress()` calls 
`exe_module->GetObjectFile()->GetEntryPointAddress()`, and the returned
`entry_addr` is valid, it can immediately be returned.

However, just before that, an `llvm::Error` value has been setup, but in this 
case it is not consumed before returning, like is done further below in the 
function.

In https://bugs.freebsd.org/248745 we got a bug report for this, where a very 
simple test case aborts and dumps core:

```
* thread #1, name = 'testcase', stop reason = breakpoint 1.1
frame #0: 0x002018d4 testcase`main(argc=1, argv=0x7fffea18) 
at testcase.c:3:5
   1int main(int argc, char *argv[])
   2{
-> 3return 0;
   4}
(lldb) p argc
Program aborted due to an unhandled Error:
Error value was Success. (Note: Success values must still be checked prior to 
being destroyed).

Thread 1 received signal SIGABRT, Aborted.
thr_kill () at thr_kill.S:3
3   thr_kill.S: No such file or directory.
(gdb) bt
#0  thr_kill () at thr_kill.S:3
#1  0x0008049a0004 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
#2  0x000804916229 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
#3  0x0451b5f5 in fatalUncheckedError () at 
/usr/src/contrib/llvm-project/llvm/lib/Support/Error.cpp:112
#4  0x019cf008 in GetEntryPointAddress () at 
/usr/src/contrib/llvm-project/llvm/include/llvm/Support/Error.h:267
#5  0x01bccbd8 in ConstructorSetup () at 
/usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:67
#6  0x01bcd2c0 in ThreadPlanCallFunction () at 
/usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:114
#7  0x020076d4 in InferiorCallMmap () at 
/usr/src/contrib/llvm-project/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp:97
#8  0x01f4be33 in DoAllocateMemory () at 
/usr/src/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp:604
#9  0x01fe51b9 in AllocatePage () at 
/usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:347
#10 0x01fe5385 in AllocateMemory () at 
/usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:383
#11 0x01974da2 in AllocateMemory () at 
/usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2301
#12 CanJIT () at 
/usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2331
#13 0x01a1bf3d in Evaluate () at 
/usr/src/contrib/llvm-project/lldb/source/Expression/UserExpression.cpp:190
#14 0x019ce7a2 in EvaluateExpression () at 
/usr/src/contrib/llvm-project/lldb/source/Target/Target.cpp:2372
#15 0x01ad784c in EvaluateExpression () at 
/usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:414
#16 0x01ad86ae in DoExecute () at 
/usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:646
#17 0x01a5e3ed in Execute () at 
/usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp:1003
#18 0x01a6c4a3 in HandleCommand () at 
/usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:1762
#19 0x01a6f98c in IOHandlerInputComplete () at 
/usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2760
#20 0x01a90b08 in Run () at 
/usr/src/contrib/llvm-project/lldb/source/Core/IOHandler.cpp:548
#21 0x019a6c6a in ExecuteIOHandlers () at 
/usr/src/contrib/llvm-project/lldb/source/Core/Debugger.cpp:903
#22 0x01a70337 in RunCommandInterpreter () at 
/usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2946
#23 0x01d9d812 in RunCommandInterpreter () at 
/usr/src/contrib/llvm-project/lldb/source/API/SBDebugger.cpp:1169
#24 0x01918be8 in MainLoop () at 
/usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:675
#25 0x0191a114 in main () at 
/usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:890```

Fix the incorrect error catch by only instantiating an `Error` object if it is 
necessary.

Reviewed By: JDevlieghere

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

Added: 


Modified: 
lldb/source/Target/Target.cpp

Removed: 




diff  --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index aab9097458c9..a529df998ba7 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -2407,21 +2407,13 @@ lldb::addr_t Target::GetPersistentSymbol(ConstString 
name) {
 
 llvm::Expected Target::GetEntryPointAddress() {
   Module *exe_module = 

[Lldb-commits] [lldb] r374444 - Fix process launch failure on FreeBSD after r365761

2019-10-10 Thread Dimitry Andric via lldb-commits
Author: dim
Date: Thu Oct 10 13:26:59 2019
New Revision: 37

URL: http://llvm.org/viewvc/llvm-project?rev=37&view=rev
Log:
Fix process launch failure on FreeBSD after r365761

Summary:
After rLLDB365761, and with `LLVM_ENABLE_ABI_BREAKING_CHECKS` enabled,
launching any process on FreeBSD crashes lldb with:

```
Expected must be checked before access or destruction.
Expected value was in success state. (Note: Expected values in success 
mode must still be checked prior to being destroyed).
```

This is because `m_operation_thread` and `m_monitor_thread` were wrapped
in `llvm::Expected<>`, but this requires the objects to be correctly
initialized before accessing them.

To fix the crashes, use `llvm::Optional<>` for the members (as indicated
by labath), and use local variables to store the return values of
`LaunchThread` and `StartMonitoringChildProcess`.  Then, only assign to
the member variables after checking if the return values indicated
success.

Reviewers: devnexen, emaste, MaskRay, mgorny

Reviewed By: devnexen

Subscribers: jfb, labath, krytarowski, lldb-commits

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

Modified:
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.h

Modified: lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp?rev=37&r1=374443&r2=37&view=diff
==
--- lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Thu Oct 10 
13:26:59 2019
@@ -703,7 +703,7 @@ ProcessMonitor::ProcessMonitor(
 const lldb_private::ProcessLaunchInfo & /* launch_info */,
 lldb_private::Status &error)
 : m_process(static_cast(process)),
-  m_operation_thread(nullptr), m_monitor_thread(nullptr), 
m_pid(LLDB_INVALID_PROCESS_ID), m_terminal_fd(-1), m_operation(0) {
+  m_operation_thread(), m_monitor_thread(), 
m_pid(LLDB_INVALID_PROCESS_ID), m_terminal_fd(-1), m_operation(0) {
   using namespace std::placeholders;
 
   std::unique_ptr args(
@@ -730,20 +730,22 @@ ProcessMonitor::ProcessMonitor(
   }
 
   // Finally, start monitoring the child process for change in state.
-  m_monitor_thread = Host::StartMonitoringChildProcess(
+  llvm::Expected monitor_thread =
+Host::StartMonitoringChildProcess(
   std::bind(&ProcessMonitor::MonitorCallback, this, _1, _2, _3, _4),
   GetPID(), true);
-  if (!m_monitor_thread->IsJoinable()) {
+  if (!monitor_thread || !monitor_thread->IsJoinable()) {
 error.SetErrorToGenericError();
 error.SetErrorString("Process launch failed.");
 return;
   }
+  m_monitor_thread = *monitor_thread;
 }
 
 ProcessMonitor::ProcessMonitor(ProcessFreeBSD *process, lldb::pid_t pid,
lldb_private::Status &error)
 : m_process(static_cast(process)),
-  m_operation_thread(nullptr), m_monitor_thread(nullptr), m_pid(pid), 
m_terminal_fd(-1), m_operation(0) {
+  m_operation_thread(), m_monitor_thread(), m_pid(pid), m_terminal_fd(-1), 
m_operation(0) {
   using namespace std::placeholders;
 
   sem_init(&m_operation_pending, 0, 0);
@@ -768,14 +770,16 @@ ProcessMonitor::ProcessMonitor(ProcessFr
   }
 
   // Finally, start monitoring the child process for change in state.
-  m_monitor_thread = Host::StartMonitoringChildProcess(
+  llvm::Expected monitor_thread =
+Host::StartMonitoringChildProcess(
   std::bind(&ProcessMonitor::MonitorCallback, this, _1, _2, _3, _4),
   GetPID(), true);
-  if (!m_monitor_thread->IsJoinable()) {
+  if (!monitor_thread || !monitor_thread->IsJoinable()) {
 error.SetErrorToGenericError();
 error.SetErrorString("Process attach failed.");
 return;
   }
+  m_monitor_thread = *monitor_thread;
 }
 
 ProcessMonitor::~ProcessMonitor() { StopMonitor(); }
@@ -784,13 +788,15 @@ ProcessMonitor::~ProcessMonitor() { Stop
 void ProcessMonitor::StartLaunchOpThread(LaunchArgs *args, Status &error) {
   static const char *g_thread_name = "lldb.process.freebsd.operation";
 
-  if (m_operation_thread->IsJoinable())
+  if (m_operation_thread && m_operation_thread->IsJoinable())
 return;
 
-  m_operation_thread =
-  ThreadLauncher::LaunchThread(g_thread_name, LaunchOpThread, args);
-  if (!m_operation_thread)
- error = m_operation_thread.takeError();
+  llvm::Expected operation_thread =
+ThreadLauncher::LaunchThread(g_thread_name, LaunchOpThread, args);
+  if (operation_thread)
+m_operation_thread = *operation_thread;
+  else
+error = operation_thread.takeError();
 }
 
 void *ProcessMonitor::LaunchOpThread(void *arg) {
@@ -952,14 +958,15 @@ void ProcessMonitor::StartAttachOpThread
  lldb_private::Status &error) {
   static const char *g_thread_name = "lldb.process.freeb