llvm-project/lldb/source/Plugins
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
..
ABI [lldb] Implement ABI::Fix{Code,Data}Address for AArch64 2021-04-16 13:49:38 -07:00
Architecture Target::ReadMemory read from read-only binary file Section, not memory 2021-04-16 16:13:07 -07:00
Disassembler [MC] Untangle MCContext and MCObjectFileInfo 2021-05-05 10:03:02 -07:00
DynamicLoader Simplify the breakpoint setting in DynamicLoaderMacOS::SetNotificationBreakpoint 2021-04-24 14:03:41 -07:00
ExpressionParser [lldb] Fix DataLayout reference after 0f1137ba79 2021-04-27 20:07:09 -07:00
Instruction [MC] Untangle MCContext and MCObjectFileInfo 2021-05-05 10:03:02 -07:00
InstrumentationRuntime lldb/Instrumentation: NFC-ish use GetFrameCodeAddressForSymbolication() 2021-04-22 13:32:43 -07:00
JITLoader [lldb] Make DoReadMemory a protected method. 2021-01-07 21:06:36 -08:00
Language [lldb] Make the NSSet formatter faster and less prone to infinite recursion 2021-04-29 19:13:43 +02:00
LanguageRuntime [LLLDB] Adding additional check LibCppStdFunctionCallableInfo based on crash reports 2021-04-14 16:28:38 -07:00
MemoryHistory [lldb] Access the ModuleList through iterators where possible (NFC) 2021-01-07 21:06:36 -08:00
ObjectContainer [lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC) 2020-12-22 09:10:27 -08:00
ObjectFile [lldb/elf] Avoid side effects in function calls ParseUnwindSymbols 2021-04-22 14:31:00 +02:00
OperatingSystem [lldb] Use std::make_unique<DynamicRegisterInfo> (NFC) 2020-07-22 11:32:48 -07:00
Platform [lldb/PlatformPOSIX] Change LoadImage default to RTLD_LAZY (reapply) 2021-03-19 16:06:00 -07:00
Process When SendContinuePacketAndWaitForResponse returns eStateInvalid, don't fetch more packets. 2021-05-06 14:11:42 -07:00
ScriptInterpreter [NFC][LLDB] Removing extra semicolons to silence -Wc++98-compat-extra-semi diagnostics 2021-03-23 14:32:36 -07:00
StructuredData Use basic_string::find(char) instead of basic_string::find(const char *s, size_type pos=0) 2020-12-16 23:28:32 -08:00
SymbolFile [lldb] Refactor argument group by SourceLocationSpec (NFCI) 2021-05-04 23:04:31 +00:00
SymbolVendor [lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC) 2020-12-22 09:10:27 -08:00
SystemRuntime Make the error condition in Value::ValueType explicit (NFC) 2021-02-12 16:12:31 -08:00
Trace [trace] Dedup different source lines when dumping instructions + refactor 2021-05-04 19:40:52 -07:00
TypeSystem Updated LLDB for the new Clang Language enumerator 'OpenCLCXX' 2021-03-24 16:46:02 +01:00
UnwindAssembly Target::ReadMemory read from read-only binary file Section, not memory 2021-04-16 16:13:07 -07:00
CMakeLists.txt Add a "Trace" plug-in to LLDB to add process trace support in stages. 2020-09-21 17:13:18 -07:00
Plugins.def.in Re-land "[lldb/CMake] Auto-generate the Initialize and Terminate calls for plugin" 2020-02-18 19:16:07 -08:00