llvm-project/lldb
Dimitry Andric a42942e0ec 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<T> must be checked before access or destruction.
Expected<T> value was in success state. (Note: Expected<T> 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

llvm-svn: 374444
2019-10-10 20:26:59 +00:00
..
cmake [CMake] Fix add_lldb_test_dependency 2019-10-09 20:36:29 +00:00
docs [Docs] Update testing documentaton 2019-10-10 19:35:20 +00:00
examples Revert [heap.py] Add missing declaration for malloc_get_all_zones 2019-08-22 21:01:45 +00:00
include/lldb update SBDebugger::SetInputFile() etc to work on native Files 2019-10-10 19:10:59 +00:00
packages/Python/lldbsuite update TestRunCommandInterpreterAPI to use SBFile 2019-10-10 19:24:07 +00:00
resources [CMake] Revised LLDB.framework builds 2019-01-04 12:46:50 +00:00
scripts update SBDebugger::SetInputFile() etc to work on native Files 2019-10-10 19:10:59 +00:00
source Fix process launch failure on FreeBSD after r365761 2019-10-10 20:26:59 +00:00
test [test] Add timeout to API tests. 2019-10-10 19:51:50 +00:00
third_party/Python/module Increase timeout in pexpect to lower chances of tests failing under ASAN. 2019-10-10 16:16:49 +00:00
tools Change debugserver to use the brk #0 for breakpoints. 2019-10-10 00:12:05 +00:00
unittests Fix the unwinding plan augmentation from x86 assembly 2019-10-10 13:23:09 +00:00
utils [utils] Update lldb-dotest for new test layout 2019-10-09 20:30:54 +00:00
.arcconfig
.clang-format
.gitignore Add .noindex to the gitignore 2019-04-05 17:57:42 +00:00
CMakeLists.txt [lldb] Put site-packages into a sub dir of CMAKE_CFG_INTDIR 2019-10-09 22:34:55 +00:00
CODE_OWNERS.txt [lldb][NFC] Cleanup mentions and code related to lldb-mi 2019-07-19 15:55:23 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
use_lldb_suite_root.py