summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Maste <emaste@freebsd.org>2015-04-03 20:49:08 +0000
committerEd Maste <emaste@freebsd.org>2015-04-03 20:49:08 +0000
commit4b1063c76cb3960d898bd0595cb66de7830bb69f (patch)
tree5d90efc9e809915534457dd137f977750349464b
parent72553767d5995943ff266ef7e574e61bab5eb153 (diff)
downloadbcm5719-llvm-4b1063c76cb3960d898bd0595cb66de7830bb69f.tar.gz
bcm5719-llvm-4b1063c76cb3960d898bd0595cb66de7830bb69f.zip
Fix FreeBSD crash after r233837
The FreeBSD debug register access is a little usual, but in any case different from Linux. As it stands it's not possible to share an implementation of DR_OFFSET, so revert that part of r233837 and provide a separate FreeBSD and Linux implementation. We'll still want a better fix, but this should restore basic functionality (and the buildbot). llvm-svn: 234048
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp3
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp5
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h4
3 files changed, 8 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
index 257e929b13a..34f2d185da8 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
@@ -62,6 +62,9 @@ struct UserArea
DBG dbg;
};
+#define DR_OFFSET(reg_index) \
+ (LLVM_EXTENSION offsetof(DBG, dr[reg_index]))
+
//---------------------------------------------------------------------------
// Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 structure.
//---------------------------------------------------------------------------
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
index 49346899b9c..c0993b47a12 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
@@ -73,6 +73,11 @@ struct UserArea
uint64_t fault_address; // Control register CR3.
};
+
+#define DR_OFFSET(reg_index) \
+ (LLVM_EXTENSION offsetof(UserArea, dbg) + \
+ LLVM_EXTENSION offsetof(DBG, dr[reg_index]))
+
//---------------------------------------------------------------------------
// Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 structure.
//---------------------------------------------------------------------------
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h b/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
index f3fd78c818c..f7e329233c8 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
@@ -27,10 +27,6 @@
LLVM_EXTENSION offsetof(XSAVE, ymmh[reg_index]) + \
(32 * reg_index))
-#define DR_OFFSET(reg_index) \
- (LLVM_EXTENSION offsetof(UserArea, dbg) + \
- LLVM_EXTENSION offsetof(DBG, dr[reg_index]))
-
#ifdef DECLARE_REGISTER_INFOS_X86_64_STRUCT
// Number of bytes needed to represent a FPR.
OpenPOWER on IntegriCloud