llvm-project/lldb
Jim Ingham 72ba78c29e When SendContinuePacketAndWaitForResponse returns eStateInvalid, don't fetch more packets.
This looks like just an oversight in the AsyncThread function.  It gets a result of
eStateInvalid, and then marks the process as exited, but doesn't set "done" to true,
so we go to fetch another event.  That is not safe, since you don't know when that
extra packet is going to arrive.  If it arrives while you are tearing down the
process, the internal-state-thread might try to handle it when the process in not
in a good state.

Rather than put more effort into checking all the shutdown paths to make sure this
extra packet doesn't cause problems, just don't fetch it.  We weren't going to do
anything useful with it anyway.

The main part of the patch is setting "done = true" when we get the eStateInvalid.
I also added a check at the beginning of the while(done) loop to prevent another error
from getting us to fetch packets for an exited process.

I added a test case to ensure that if an Interrupt fails, we call the process
exited.  I can't test exactly the error I'm fixing, there's no good way to know
that the stop reply for the failed interrupt wasn't fetched.  But at least this
asserts that the overall behavior is correct.

Differential Revision: https://reviews.llvm.org/D101933
2021-05-06 14:11:42 -07:00
..
bindings [lldb] [gdb-remote server] Introduce new stop reasons for fork and vfork 2021-04-24 11:08:33 +02:00
cmake [lldb] Remove XPCServices symlinking 2021-03-01 11:23:46 -08:00
docs Fix typo, arvm7 -> armv7 2021-05-05 00:56:44 -04:00
examples [lldb] [gdb-remote server] Introduce new stop reasons for fork and vfork 2021-04-24 11:08:33 +02:00
include/lldb [lldb/Symbol] Fix column breakpoint `move_to_nearest_code` match 2021-05-05 05:07:50 +00:00
packages/Python [lldb][AArch64] Don't check for VmFlags in smaps files 2021-04-29 09:30:14 +01:00
resources [lldb] Remove stale LLDB-Info.plist 2021-01-08 10:12:16 -08:00
scripts Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awk 2021-02-25 11:32:27 +01:00
source When SendContinuePacketAndWaitForResponse returns eStateInvalid, don't fetch more packets. 2021-05-06 14:11:42 -07:00
test When SendContinuePacketAndWaitForResponse returns eStateInvalid, don't fetch more packets. 2021-05-06 14:11:42 -07:00
third_party/Python/module Revert "[lldb] temporary commit to see why a test is failing only on lldb-aarch64-ubuntu" 2020-08-05 11:55:02 +02:00
tools Fix typo, arvm7 -> armv7 2021-05-05 00:56:44 -04:00
unittests [lldb] Handle missing SBStructuredData copy assignment cases 2021-05-05 15:12:03 -07:00
utils Reapply "[lldb/test] Automatically find debug servers to test" 2021-02-21 20:47:47 +01:00
.clang-format
.clang-tidy [lldb] Add .clang-tidy with customization to disable readability-identifier-naming 2020-03-09 12:50:28 -07:00
.gitignore
CMakeLists.txt [CMake] Remove dead code setting policies to NEW 2021-01-19 17:19:36 +02:00
CODE_OWNERS.txt
LICENSE.TXT
use_lldb_suite_root.py