diff options
author | Pavel Labath <pavel@labath.sk> | 2022-02-22 17:45:35 +0100 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2022-02-24 11:12:59 +0100 |
commit | 12c9c4a8853740c41b183495f4d9931e7eee5268 (patch) | |
tree | 1abd3559d8e06fe522b27ce28af81e94a5ac03d6 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | fb3a2d45cd79d3573dafcb7d26df355266b0228c (diff) | |
download | llvm-12c9c4a8853740c41b183495f4d9931e7eee5268.zip llvm-12c9c4a8853740c41b183495f4d9931e7eee5268.tar.gz llvm-12c9c4a8853740c41b183495f4d9931e7eee5268.tar.bz2 |
[lldb/host] Remove monitor_signals argument from process monitoring functions
All current callers set the argument to false. monitor_signals=true used
to be used in the Process plugins (which needed to know when the
debugged process gets a signal), but this implementation has several
serious issues, which means that individual process plugins now
orchestrate the monitoring of debugged processes themselves.
This allows us to simplify the implementation (no need to play with
process groups), and the interface (we only catch fatal events, so the
callback is always called just once).
Differential Revision: https://reviews.llvm.org/D120425
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 3f5cb16..ebd5f73 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -3366,7 +3366,7 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver( const std::weak_ptr<ProcessGDBRemote> this_wp = std::static_pointer_cast<ProcessGDBRemote>(shared_from_this()); debugserver_launch_info.SetMonitorProcessCallback( - std::bind(MonitorDebugserverProcess, this_wp, _1, _2, _3, _4), false); + std::bind(MonitorDebugserverProcess, this_wp, _1, _2, _3)); debugserver_launch_info.SetUserID(process_info.GetUserID()); #if defined(__APPLE__) @@ -3445,16 +3445,14 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver( return error; } -bool ProcessGDBRemote::MonitorDebugserverProcess( +void ProcessGDBRemote::MonitorDebugserverProcess( std::weak_ptr<ProcessGDBRemote> process_wp, lldb::pid_t debugserver_pid, - bool exited, // True if the process did exit int signo, // Zero for no signal int exit_status // Exit value of process if signal is zero ) { // "debugserver_pid" argument passed in is the process ID for debugserver // that we are tracking... Log *log = GetLog(GDBRLog::Process); - const bool handled = true; LLDB_LOGF(log, "ProcessGDBRemote::%s(process_wp, pid=%" PRIu64 @@ -3465,7 +3463,7 @@ bool ProcessGDBRemote::MonitorDebugserverProcess( LLDB_LOGF(log, "ProcessGDBRemote::%s(process = %p)", __FUNCTION__, static_cast<void *>(process_sp.get())); if (!process_sp || process_sp->m_debugserver_pid != debugserver_pid) - return handled; + return; // Sleep for a half a second to make sure our inferior process has time to // set its exit status before we set it incorrectly when both the debugserver @@ -3499,7 +3497,6 @@ bool ProcessGDBRemote::MonitorDebugserverProcess( // Debugserver has exited we need to let our ProcessGDBRemote know that it no // longer has a debugserver instance process_sp->m_debugserver_pid = LLDB_INVALID_PROCESS_ID; - return handled; } void ProcessGDBRemote::KillDebugserverProcess() { |