From 056c45a4a1ca505b5458a42516bd0e20a4f039c5 Mon Sep 17 00:00:00 2001 From: "Mohit K. Bhakkad" Date: Wed, 10 Jun 2015 10:02:21 +0000 Subject: [PATCH] [LLDB][MIPS] Getting correct signals for MIPS Host Patch by Nitesh Jain Reviewers: clayborg, ovyalov. Subscribers: jaydeep, bhushan, dsanders, mohit.bhakkad, sagar, labath, lldb-commits. Differential Revision: http://reviews.llvm.org/D10180 llvm-svn: 239463 --- lldb/source/Host/linux/Host.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp index 98b08d0927f3..dddd2f3e89d0 100644 --- a/lldb/source/Host/linux/Host.cpp +++ b/lldb/source/Host/linux/Host.cpp @@ -37,7 +37,7 @@ #include "lldb/Symbol/ObjectFile.h" #include "Plugins/Process/Linux/ProcFileReader.h" #include "Plugins/Process/Utility/LinuxSignals.h" - +#include "Plugins/Process/Utility/MipsLinuxSignals.h" using namespace lldb; using namespace lldb_private; @@ -390,11 +390,24 @@ Host::GetEnvironment (StringList &env) return i; } +// TODO: Generalize this with a function Host::GetSignals() as discussed at http://reviews.llvm.org/D10180 const lldb_private::UnixSignalsSP& Host::GetUnixSignals () { - static const lldb_private::UnixSignalsSP s_unix_signals_sp (new process_linux::LinuxSignals ()); - return s_unix_signals_sp; + ArchSpec target_arch = HostInfoBase::GetArchitecture(); + if(target_arch.GetTriple ().getArch () == llvm::Triple::mips64 || + target_arch.GetTriple ().getArch () == llvm::Triple::mips64el || + target_arch.GetTriple ().getArch () == llvm::Triple::mips || + target_arch.GetTriple ().getArch () == llvm::Triple::mipsel) { + static const lldb_private::UnixSignalsSP s_unix_signals_sp (new process_linux::MipsLinuxSignals ()); + return s_unix_signals_sp; + } + else + { + static const lldb_private::UnixSignalsSP s_unix_signals_sp (new process_linux::LinuxSignals ()); + return s_unix_signals_sp; + } + } Error