llvm/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
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
scripts
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
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
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt
CODE_OWNERS.txt
LICENSE.TXT
use_lldb_suite_root.py