llvm-project/lldb/source/Target
Pavel Labath a40929dcd2 [lldb] Fix cross-platform kills
This patch fixes an amusing bug where a Platform::Kill operation would
happily terminate a proces on a completely different platform, as long
as they have the same process ID. This was due to the fact that the
implementation was iterating through all known (debugged) processes in
order terminate them directly.

This patch just deletes that logic, and makes everything go through the
OS process termination APIs. While it would be possible to fix the logic
to check for a platform match, it seemed to me that the implementation
was being too smart for its own good -- accessing random Process
objects without knowing anything about their state is risky at best.
Going through the os ensures we avoid any races.

I also "upgrade" the termination signal to a SIGKILL to ensure the
process really dies after this operation.

Differential Revision: https://reviews.llvm.org/D113184
2021-11-09 15:31:07 +01:00
..
ABI.cpp [lldb] [ABI] Apply AugmentRegisterInfo() to DynamicRegisterInfo::Registers 2021-10-11 17:02:26 +02:00
AssertFrameRecognizer.cpp [lldb] Fix Recognizer/assert.test with glibc-2.33.9000-31.fc35.x86_64 2021-07-01 09:16:07 +02:00
CMakeLists.txt Modify "statistics dump" to dump JSON. 2021-10-21 12:14:21 -07:00
DynamicRegisterInfo.cpp [lldb] [DynamicRegisterInfo] Remove AddRegister() and make Finalize() protected 2021-10-25 20:05:30 +02:00
ExecutionContext.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
InstrumentationRuntime.cpp
InstrumentationRuntimeStopInfo.cpp
JITLoader.cpp
JITLoaderList.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
Language.cpp [lldb] Tighten lock in Language::ForEach 2021-08-31 15:45:38 -07:00
LanguageRuntime.cpp Add setting to disable LanguageRuntime UnwindPlans 2021-04-08 13:28:59 -07:00
Memory.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
MemoryHistory.cpp
MemoryRegionInfo.cpp [lldb][AArch64/Linux] Show memory tagged memory regions 2020-11-20 11:21:59 +00:00
ModuleCache.cpp [lldb] [gdb-remote] Add eOpenOptionReadWrite for future gdb compat 2021-08-09 12:06:59 +02:00
OperatingSystem.cpp [lldb] Remove ConstString from GetPluginNameStatic of some plugins 2021-10-21 12:58:45 +02:00
PathMappingList.cpp [lldb][NFC] avoid unnecessary roundtrips between different string types 2021-11-01 22:15:01 -07:00
Platform.cpp [lldb] Fix cross-platform kills 2021-11-09 15:31:07 +01:00
Process.cpp Reland "[lldb] Remove non address bits when looking up memory regions" 2021-11-03 13:56:51 +00:00
ProcessTrace.cpp [lldb] Remove ConstString from Process, ScriptInterpreter and StructuredData plugin names 2021-10-28 10:15:03 +02:00
Queue.cpp
QueueItem.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
QueueList.cpp
RegisterContext.cpp Recommit: [lldb] Remove "dwarf dynamic register size expressions" from RegisterInfo 2021-10-07 11:15:00 +02:00
RegisterContextUnwind.cpp [lldb] Fixup more code addresses 2021-05-13 10:27:22 -07:00
RegisterNumber.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
RemoteAwarePlatform.cpp Modernize Platform::GetOSKernelDescription 2021-10-27 10:46:47 +02:00
SectionLoadHistory.cpp
SectionLoadList.cpp [lldb] Switch Section-dumping code to raw_ostream 2020-05-14 11:59:18 +02:00
StackFrame.cpp Target::ReadMemory read from read-only binary file Section, not memory 2021-04-16 16:13:07 -07:00
StackFrameList.cpp [lldb] [gdb-remote server] Introduce new stop reasons for fork and vfork 2021-04-24 11:08:33 +02:00
StackFrameRecognizer.cpp [lldb] Make deleting frame recognizers actually work 2020-07-23 17:43:37 +02:00
StackID.cpp
Statistics.cpp Add unix signal hit counts to the target statistics. 2021-10-27 22:31:14 -07:00
StopInfo.cpp Add unix signal hit counts to the target statistics. 2021-10-27 22:31:14 -07:00
StructuredDataPlugin.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
SystemRuntime.cpp [lldb] Have LanguageRuntime and SystemRuntime share a base class (NFC) 2020-07-24 16:28:34 -07:00
Target.cpp Add modules stats into the "statistics dump" command. 2021-10-25 11:50:02 -07:00
TargetList.cpp [lldb] Add missing mutex guards to TargetList::CreateTarget 2021-05-24 19:49:57 +02:00
TargetProperties.td [lldb] Remove non-stop mode code 2021-09-28 14:13:50 +02:00
Thread.cpp [lldb] Remove shared_ptr from some global Properties objects 2021-10-08 10:43:37 +02:00
ThreadCollection.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
ThreadList.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
ThreadPlan.cpp [lldb] Avoid moving ThreadPlanSP from plans vector 2021-08-01 10:40:04 -07:00
ThreadPlanBase.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
ThreadPlanCallFunction.cpp [lldb] Avoid moving ThreadPlanSP from plans vector 2021-08-01 10:40:04 -07:00
ThreadPlanCallFunctionUsingABI.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanCallOnFunctionExit.cpp
ThreadPlanCallUserExpression.cpp [lldb] Avoid moving ThreadPlanSP from plans vector 2021-08-01 10:40:04 -07:00
ThreadPlanPython.cpp Add a setting to force stepping to always run all threads. 2020-08-07 14:47:31 -07:00
ThreadPlanRunToAddress.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanShouldStopHere.cpp
ThreadPlanStack.cpp [lldb] Avoid moving ThreadPlanSP from plans vector 2021-08-01 10:40:04 -07:00
ThreadPlanStepInRange.cpp [lldb][NFC] Remove all uses of StringRef::withNullAsEmpty in LLDB 2021-05-18 09:41:20 +02:00
ThreadPlanStepInstruction.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanStepOut.cpp [lldb] Rename {stop,run}_vote to report_{stop,run}_vote 2021-02-19 13:04:53 -08:00
ThreadPlanStepOverBreakpoint.cpp [lldb] Avoid moving ThreadPlanSP from plans vector 2021-08-01 10:40:04 -07:00
ThreadPlanStepOverRange.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanStepRange.cpp Target::ReadMemory read from read-only binary file Section, not memory 2021-04-16 16:13:07 -07:00
ThreadPlanStepThrough.cpp [lldb] Remove very old misleading comment (NFC) 2021-02-15 18:14:57 -08:00
ThreadPlanStepUntil.cpp Make ThreadPlans use TID and Process, rather than Thread *. 2020-04-03 14:56:28 -07:00
ThreadPlanTracer.cpp [lldb] Remove unused ThreadPlan tracer utilities (NFC) 2021-02-15 17:59:25 -08:00
ThreadSpec.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
Trace.cpp [lldb] Remove ConstString from SymbolVendor, Trace, TraceExporter, UnwindAssembly, MemoryHistory and InstrumentationRuntime plugin names 2021-10-29 12:08:57 +02:00
TraceCursor.cpp [trace][intel pt] Implement the Intel PT cursor 2021-07-16 16:47:43 -07:00
TraceExporter.cpp [lldb] Remove ConstString from SymbolVendor, Trace, TraceExporter, UnwindAssembly, MemoryHistory and InstrumentationRuntime plugin names 2021-10-29 12:08:57 +02:00
TraceInstructionDumper.cpp [intel pt] Add TSC timestamps 2021-07-20 16:29:17 -07:00
UnixSignals.cpp Add unix signal hit counts to the target statistics. 2021-10-27 22:31:14 -07:00
UnwindAssembly.cpp [lldb] Delete copy operations on PluginInterface class 2020-10-09 10:37:09 +02:00
UnwindLLDB.cpp LanguageRuntime for 0th frame unwind, simplify getting pc-for-symbolication 2021-03-03 19:29:40 -08:00