This revision was automatically updated to reflect the committed changes.
Closed by commit rG46e93c9df287: [lldb] Unify default/hijack listener between
Process{Attach,Launch}Info (NFC) (authored by mib).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148395/new/
https://reviews.llvm.org/D148395
Files:
lldb/include/lldb/Host/ProcessLaunchInfo.h
lldb/include/lldb/Target/Process.h
lldb/include/lldb/Utility/ProcessInfo.h
lldb/source/Host/common/ProcessLaunchInfo.cpp
lldb/source/Utility/ProcessInfo.cpp
Index: lldb/source/Utility/ProcessInfo.cpp
===================================================================
--- lldb/source/Utility/ProcessInfo.cpp
+++ lldb/source/Utility/ProcessInfo.cpp
@@ -22,12 +22,14 @@
using namespace lldb_private;
ProcessInfo::ProcessInfo()
- : m_executable(), m_arguments(), m_environment(), m_arch() {}
+ : m_executable(), m_arguments(), m_environment(), m_arch(), m_listener_sp(),
+ m_hijack_listener_sp(), m_passthrough_listener_sp() {}
ProcessInfo::ProcessInfo(const char *name, const ArchSpec &arch,
lldb::pid_t pid)
: m_executable(name), m_arguments(), m_environment(), m_arch(arch),
- m_pid(pid) {}
+ m_pid(pid), m_listener_sp(), m_hijack_listener_sp(),
+ m_passthrough_listener_sp() {}
void ProcessInfo::Clear() {
m_executable.Clear();
Index: lldb/source/Host/common/ProcessLaunchInfo.cpp
===================================================================
--- lldb/source/Host/common/ProcessLaunchInfo.cpp
+++ lldb/source/Host/common/ProcessLaunchInfo.cpp
@@ -31,8 +31,8 @@
ProcessLaunchInfo::ProcessLaunchInfo()
: ProcessInfo(), m_working_dir(), m_plugin_name(), m_flags(0),
- m_file_actions(), m_pty(new PseudoTerminal), m_monitor_callback(nullptr),
- m_listener_sp(), m_hijack_listener_sp() {}
+ m_file_actions(), m_pty(new PseudoTerminal), m_monitor_callback(nullptr) {
+}
ProcessLaunchInfo::ProcessLaunchInfo(const FileSpec &stdin_file_spec,
const FileSpec &stdout_file_spec,
Index: lldb/include/lldb/Utility/ProcessInfo.h
===================================================================
--- lldb/include/lldb/Utility/ProcessInfo.h
+++ lldb/include/lldb/Utility/ProcessInfo.h
@@ -97,6 +97,19 @@
m_scripted_metadata_sp = metadata_sp;
}
+ // Get and set the actual listener that will be used for the process events
+ lldb::ListenerSP GetListener() const { return m_listener_sp; }
+
+ void SetListener(const lldb::ListenerSP &listener_sp) {
+ m_listener_sp = listener_sp;
+ }
+
+ lldb::ListenerSP GetHijackListener() const { return m_hijack_listener_sp; }
+
+ void SetHijackListener(const lldb::ListenerSP &listener_sp) {
+ m_hijack_listener_sp = listener_sp;
+ }
+
protected:
FileSpec m_executable;
std::string m_arg0; // argv[0] if supported. If empty, then use m_executable.
@@ -109,6 +122,8 @@
ArchSpec m_arch;
lldb::pid_t m_pid = LLDB_INVALID_PROCESS_ID;
lldb::ScriptedMetadataSP m_scripted_metadata_sp = nullptr;
+ lldb::ListenerSP m_listener_sp = nullptr;
+ lldb::ListenerSP m_hijack_listener_sp = nullptr;
};
// ProcessInstanceInfo
Index: lldb/include/lldb/Target/Process.h
===================================================================
--- lldb/include/lldb/Target/Process.h
+++ lldb/include/lldb/Target/Process.h
@@ -122,8 +122,6 @@
ProcessInfo::operator=(launch_info);
SetProcessPluginName(launch_info.GetProcessPluginName());
SetResumeCount(launch_info.GetResumeCount());
- SetListener(launch_info.GetListener());
- SetHijackListener(launch_info.GetHijackListener());
m_detach_on_error = launch_info.GetDetachOnError();
}
@@ -174,28 +172,13 @@
return false;
}
- lldb::ListenerSP GetHijackListener() const { return m_hijack_listener_sp; }
-
- void SetHijackListener(const lldb::ListenerSP &listener_sp) {
- m_hijack_listener_sp = listener_sp;
- }
-
bool GetDetachOnError() const { return m_detach_on_error; }
void SetDetachOnError(bool enable) { m_detach_on_error = enable; }
- // Get and set the actual listener that will be used for the process events
- lldb::ListenerSP GetListener() const { return m_listener_sp; }
-
- void SetListener(const lldb::ListenerSP &listener_sp) {
- m_listener_sp = listener_sp;
- }
-
lldb::ListenerSP GetListenerForProcess(Debugger &debugger);
protected:
- lldb::ListenerSP m_listener_sp;
- lldb::ListenerSP m_hijack_listener_sp;
std::string m_plugin_name;
uint32_t m_resume_count = 0; // How many times do we resume after launching
bool m_wait_for_launch = false;
Index: lldb/include/lldb/Host/ProcessLaunchInfo.h
===================================================================
--- lldb/include/lldb/Host/ProcessLaunchInfo.h
+++ lldb/include/lldb/Host/ProcessLaunchInfo.h
@@ -120,19 +120,6 @@
PseudoTerminal &GetPTY() { return *m_pty; }
- // Get and set the actual listener that will be used for the process events
- lldb::ListenerSP GetListener() const { return m_listener_sp; }
-
- void SetListener(const lldb::ListenerSP &listener_sp) {
- m_listener_sp = listener_sp;
- }
-
- lldb::ListenerSP GetHijackListener() const { return m_hijack_listener_sp; }
-
- void SetHijackListener(const lldb::ListenerSP &listener_sp) {
- m_hijack_listener_sp = listener_sp;
- }
-
void SetLaunchEventData(const char *data) { m_event_data.assign(data); }
const char *GetLaunchEventData() const { return m_event_data.c_str(); }
@@ -154,8 +141,6 @@
Host::MonitorChildProcessCallback m_monitor_callback;
std::string m_event_data; // A string passed to the plugin launch, having no
// meaning to the upper levels of lldb.
- lldb::ListenerSP m_listener_sp;
- lldb::ListenerSP m_hijack_listener_sp;
};
}
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits