llvm-project/lldb/source
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
..
API [lldb] Handle missing SBStructuredData copy assignment cases 2021-05-05 15:12:03 -07:00
Breakpoint [lldb/Symbol] Fix column breakpoint `move_to_nearest_code` match 2021-05-05 05:07:50 +00:00
Commands Clarify the help for "breakpoint command add" and "watchpoint command add". 2021-05-03 17:22:43 -07:00
Core [trace] Dedup different source lines when dumping instructions + refactor 2021-05-04 19:40:52 -07:00
DataFormatters [lldb][NFC] Give CompilerType's IsArrayType/IsVectorType/IsBlockPointerType out-parameters default values 2021-02-23 11:15:31 +01:00
Expression Also display the underlying error message when displaying a fixit 2021-04-27 10:40:42 -07:00
Host Wrap edit line configuration calls into helper functions 2021-04-30 12:32:29 +02:00
Initialization [lldb] Fix shared library directory computation on windows 2021-02-18 15:37:52 +01:00
Interpreter [trace][intel-pt] Implement trace start and trace stop 2021-03-30 17:31:37 -07:00
Plugins When SendContinuePacketAndWaitForResponse returns eStateInvalid, don't fetch more packets. 2021-05-06 14:11:42 -07:00
Symbol [lldb/Symbol] Fix column breakpoint `move_to_nearest_code` match 2021-05-05 05:07:50 +00:00
Target [trace] Dedup different source lines when dumping instructions + refactor 2021-05-04 19:40:52 -07:00
Utility [lldb] [llgs] Support owning and detaching extra processes 2021-04-24 11:08:33 +02:00
CMakeLists.txt Remove HAVE_VCS_VERSION_INC, not needed 2020-10-29 13:09:05 -07:00
lldb.cpp [lldb] Reinstate support for LLDB_VERSION_STRING 2021-02-22 16:56:00 -08:00