Hi emaste,
As per emaste's comment here: http://reviews.llvm.org/D8685.
http://reviews.llvm.org/D8806
Files:
source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
source/Plugins/Process/Utility/RegisterInfos_x86_64.h
Index: source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
===================================================================
--- source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
+++ source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
@@ -47,21 +47,24 @@
} GPR;
struct DBG {
- uint64_t dr[16]; /* debug registers */
- /* Index 0-3: debug address registers */
- /* Index 4-5: reserved */
- /* Index 6: debug status */
- /* Index 7: debug control */
- /* Index 8-15: reserved */
+ uint64_t dr[16]; /* debug registers */
+ /* Index 0-3: debug address registers */
+ /* Index 4-5: reserved */
+ /* Index 6: debug status */
+ /* Index 7: debug control */
+ /* Index 8-15: reserved */
};
struct UserArea
{
GPR gpr;
FPR fpr;
- DBG dbg;
};
+// Debug register implementation on FreeBSD is different from Linux.
+#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.
//---------------------------------------------------------------------------
Index: source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
===================================================================
--- source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
+++ source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
@@ -73,6 +73,10 @@
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.
//---------------------------------------------------------------------------
Index: source/Plugins/Process/Utility/RegisterInfos_x86_64.h
===================================================================
--- source/Plugins/Process/Utility/RegisterInfos_x86_64.h
+++ 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.
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
Index: source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
===================================================================
--- source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
+++ source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
@@ -47,21 +47,24 @@
} GPR;
struct DBG {
- uint64_t dr[16]; /* debug registers */
- /* Index 0-3: debug address registers */
- /* Index 4-5: reserved */
- /* Index 6: debug status */
- /* Index 7: debug control */
- /* Index 8-15: reserved */
+ uint64_t dr[16]; /* debug registers */
+ /* Index 0-3: debug address registers */
+ /* Index 4-5: reserved */
+ /* Index 6: debug status */
+ /* Index 7: debug control */
+ /* Index 8-15: reserved */
};
struct UserArea
{
GPR gpr;
FPR fpr;
- DBG dbg;
};
+// Debug register implementation on FreeBSD is different from Linux.
+#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.
//---------------------------------------------------------------------------
Index: source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
===================================================================
--- source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
+++ source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
@@ -73,6 +73,10 @@
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.
//---------------------------------------------------------------------------
Index: source/Plugins/Process/Utility/RegisterInfos_x86_64.h
===================================================================
--- source/Plugins/Process/Utility/RegisterInfos_x86_64.h
+++ 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.
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits