[Lldb-commits] [lldb] r206469 - elf-core: Add FreeBSD signals
Ed Maste
emaste at freebsd.org
Thu Apr 17 06:09:29 PDT 2014
Author: emaste
Date: Thu Apr 17 08:09:29 2014
New Revision: 206469
URL: http://llvm.org/viewvc/llvm-project?rev=206469&view=rev
Log:
elf-core: Add FreeBSD signals
Sponsored by: DARPA, AFRL
Differential Revision: http://reviews.llvm.org/D3401
Modified:
lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.h
Modified: lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp?rev=206469&r1=206468&r2=206469&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp Thu Apr 17 08:09:29 2014
@@ -25,6 +25,7 @@
#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
#include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
+#include "Plugins/Process/Utility/FreeBSDSignals.h"
// Project includes
#include "ProcessElfCore.h"
@@ -105,6 +106,8 @@ ProcessElfCore::ProcessElfCore(Target& t
m_core_module_sp (),
m_core_file (core_file),
m_dyld_plugin_name (),
+ m_os(llvm::Triple::UnknownOS),
+ m_signals_sp (),
m_thread_data_valid(false),
m_thread_data(),
m_core_aranges ()
@@ -229,6 +232,15 @@ ProcessElfCore::DoLoadCore ()
if (arch.IsValid())
m_target.SetArchitecture(arch);
+ switch (m_os)
+ {
+ case llvm::Triple::FreeBSD:
+ m_signals_sp.reset(new FreeBSDSignals());
+ break;
+ default:
+ break;
+ }
+
return error;
}
@@ -342,6 +354,8 @@ void
ProcessElfCore::Clear()
{
m_thread_list.Clear();
+ m_os = llvm::Triple::UnknownOS;
+ m_signals_sp.reset();
}
void
@@ -486,6 +500,7 @@ ProcessElfCore::ParseThreadContextsFromN
DataExtractor note_data (segment_data, note_start, note_size);
if (note.n_name == "FreeBSD")
{
+ m_os = llvm::Triple::FreeBSD;
switch (note.n_type)
{
case NT_FREEBSD_PRSTATUS:
Modified: lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.h?rev=206469&r1=206468&r2=206469&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.h (original)
+++ lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.h Thu Apr 17 08:09:29 2014
@@ -104,6 +104,18 @@ public:
IsAlive ();
//------------------------------------------------------------------
+ // Process Signals
+ //------------------------------------------------------------------
+ virtual lldb_private::UnixSignals &
+ GetUnixSignals()
+ {
+ if (m_signals_sp)
+ return *m_signals_sp;
+ else
+ return Process::GetUnixSignals();
+ }
+
+ //------------------------------------------------------------------
// Process Memory
//------------------------------------------------------------------
virtual size_t
@@ -142,6 +154,9 @@ private:
std::string m_dyld_plugin_name;
DISALLOW_COPY_AND_ASSIGN (ProcessElfCore);
+ llvm::Triple::OSType m_os;
+ std::shared_ptr<lldb_private::UnixSignals> m_signals_sp;
+
// True if m_thread_contexts contains valid entries
bool m_thread_data_valid;
More information about the lldb-commits
mailing list