summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp4
-rw-r--r--lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp5
-rw-r--r--lldb/source/Plugins/Process/elf-core/ThreadElfCore.h22
3 files changed, 31 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index 8b527402316..5ff3aaa3e08 100644
--- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -212,7 +212,11 @@ ProcessElfCore::DoLoadCore ()
arch.SetTriple ("i386", m_target.GetPlatform().get());
break;
case ArchSpec::eCore_x86_64_x86_64:
+#ifdef __FreeBSD__
+ arch.SetTriple ("x86_64-freebsd-unknown", m_target.GetPlatform().get());
+#else
arch.SetTriple ("x86_64-linux-gnu", m_target.GetPlatform().get());
+#endif
break;
default:
assert(false && "Unhandled core type");
diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
index de57d25316d..6ac12fef719 100644
--- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -16,6 +16,7 @@
#include "ThreadElfCore.h"
#include "ProcessElfCore.h"
+#include "RegisterContextCoreFreeBSD_x86_64.h"
#include "RegisterContextCoreLinux_x86_64.h"
using namespace lldb;
@@ -94,7 +95,11 @@ ThreadElfCore::CreateRegisterContextForFrame (StackFrame *frame)
switch (arch.GetMachine())
{
case llvm::Triple::x86_64:
+#ifdef __FreeBSD__
+ m_thread_reg_ctx_sp.reset(new RegisterContextCoreFreeBSD_x86_64 (*this, gpregset_data, m_fpregset_data));
+#else
m_thread_reg_ctx_sp.reset(new RegisterContextCoreLinux_x86_64 (*this, gpregset_data, m_fpregset_data));
+#endif
break;
default:
if (log)
diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h
index 34598a4f52b..ad0f67aaf5b 100644
--- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h
+++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h
@@ -26,11 +26,25 @@ struct compat_timeval
// simply reading data from the buffer.
// The following macros are used to specify the size.
// Calculating size using sizeof() wont work because of padding.
+#ifdef __FreeBSD__
+#define ELFPRSTATUS64_SIZE (48)
+#define ELFPRPSINFO64_SIZE (120)
+#else
#define ELFPRSTATUS64_SIZE (112)
#define ELFPRPSINFO64_SIZE (132)
+#endif
struct ELFPrStatus
{
+#ifdef __FreeBSD__
+ int32_t pr_version;
+ uint64_t pr_statussz;
+ uint64_t pr_gregsetsz;
+ uint64_t pr_fpregsetsz;
+ int32_t pr_osreldate;
+ int32_t pr_cursig;
+ uint32_t pr_pid;
+#else
int32_t si_signo;
int32_t si_code;
int32_t si_errno;
@@ -49,6 +63,7 @@ struct ELFPrStatus
compat_timeval pr_stime;
compat_timeval pr_cutime;
compat_timeval pr_cstime;
+#endif
ELFPrStatus();
@@ -70,6 +85,12 @@ struct ELFPrStatus
struct ELFPrPsInfo
{
+#ifdef __FreeBSD__
+ int32_t pr_version;
+ uint64_t pr_psinfosz;
+ char pr_fname[17];
+ char pr_psargs[81];
+#else
char pr_state;
char pr_sname;
char pr_zomb;
@@ -83,6 +104,7 @@ struct ELFPrPsInfo
int32_t pr_sid;
char pr_fname[16];
char pr_psargs[80];
+#endif
ELFPrPsInfo();
OpenPOWER on IntegriCloud