Revert the ELF core file support until a few things can be worked out:
RegisterContextCoreLinux_x86_64 inherits from RegisterContextLinux_x86_64 which inherits from RegisterContext_x86_64 which uses has:
ProcessMonitor &GetMonitor();
This register context used by the core file can't use this since the process plug-in will be ProcessElfCore and the implementation of GetMonitor() does:
ProcessMonitor &
RegisterContext_x86_64::GetMonitor()
{
ProcessSP base = CalculateProcess();
ProcessPOSIX *process = static_cast<ProcessPOSIX*>(base.get());
return process->GetMonitor();
}
ProcessELFCore doesn't, nor should it inherit from ProcessPOSIX and any call to GetMonitor() will fail for ELF core files.
Suggested cleanups:
- Make a register context class that is a base class that doesn't have any reading smarts, then make one that uses ProcessPOSIX and the has the GetMonitor() call, and one that gets its data straight from the core file.
llvm-svn: 186223
diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
index 0051fad..8c0a2a2 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
@@ -32,9 +32,9 @@
// Static functions.
ProcessSP
-ProcessLinux::CreateInstance(Target &target, Listener &listener, const FileSpec *core_file)
+ProcessLinux::CreateInstance(Target &target, Listener &listener, const FileSpec *)
{
- return ProcessSP(new ProcessLinux(target, listener, (FileSpec *)core_file));
+ return ProcessSP(new ProcessLinux(target, listener));
}
void
@@ -63,10 +63,9 @@
//------------------------------------------------------------------------------
// Constructors and destructors.
-ProcessLinux::ProcessLinux(Target& target, Listener &listener, FileSpec *core_file)
+ProcessLinux::ProcessLinux(Target& target, Listener &listener)
: ProcessPOSIX(target, listener), m_stopping_threads(false)
{
- m_core_file = core_file;
#if 0
// FIXME: Putting this code in the ctor and saving the byte order in a
// member variable is a hack to avoid const qual issues in GetByteOrder.
@@ -171,17 +170,3 @@
if (log)
log->Printf ("ProcessLinux::%s() finished", __FUNCTION__);
}
-
-bool
-ProcessLinux::CanDebug(Target &target, bool plugin_specified_by_name)
-{
- if (plugin_specified_by_name)
- return true;
-
- /* If core file is specified then let elf-core plugin handle it */
- if (m_core_file)
- return false;
-
- return ProcessPOSIX::CanDebug(target, plugin_specified_by_name);
-}
-
diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.h b/lldb/source/Plugins/Process/Linux/ProcessLinux.h
index c651351..d7f338f 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessLinux.h
+++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.h
@@ -51,8 +51,7 @@
// Constructors and destructors
//------------------------------------------------------------------
ProcessLinux(lldb_private::Target& target,
- lldb_private::Listener &listener,
- lldb_private::FileSpec *core_file);
+ lldb_private::Listener &listener);
virtual bool
UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list);
@@ -85,9 +84,6 @@
return m_linux_signals;
}
- virtual bool
- CanDebug(lldb_private::Target &target, bool plugin_specified_by_name);
-
//------------------------------------------------------------------
// ProcessPOSIX overrides
//------------------------------------------------------------------
@@ -99,8 +95,6 @@
/// Linux-specific signal set.
LinuxSignals m_linux_signals;
- lldb_private::FileSpec *m_core_file;
-
// Flag to avoid recursion when stopping all threads.
bool m_stopping_threads;
};