This revision was automatically updated to reflect the committed changes. Closed by commit rGa8bfee2a356a: [lldb] [Process/Utility] Fix DR offsets for FreeBSD (authored by mgorny). Herald added a project: LLDB.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91254/new/ https://reviews.llvm.org/D91254 Files: lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp Index: lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp +++ lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp @@ -59,7 +59,9 @@ DBG dbg; }; -#define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(DBG, dr[reg_index])) +#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: lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp +++ lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp @@ -35,7 +35,7 @@ uint32_t gs; }; -struct dbreg { +struct DBG { uint32_t dr[8]; /* debug registers */ /* Index 0-3: debug address registers */ /* Index 4-5: reserved */ @@ -48,10 +48,13 @@ struct UserArea { GPR gpr; FPR_i386 i387; + DBG dbg; }; #define DR_SIZE sizeof(uint32_t) -#define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(dbreg, dr[reg_index])) +#define DR_OFFSET(reg_index) \ + (LLVM_EXTENSION offsetof(UserArea, dbg) + \ + LLVM_EXTENSION offsetof(DBG, dr[reg_index])) // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure. #define DECLARE_REGISTER_INFOS_I386_STRUCT
Index: lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp +++ lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp @@ -59,7 +59,9 @@ DBG dbg; }; -#define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(DBG, dr[reg_index])) +#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: lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp +++ lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp @@ -35,7 +35,7 @@ uint32_t gs; }; -struct dbreg { +struct DBG { uint32_t dr[8]; /* debug registers */ /* Index 0-3: debug address registers */ /* Index 4-5: reserved */ @@ -48,10 +48,13 @@ struct UserArea { GPR gpr; FPR_i386 i387; + DBG dbg; }; #define DR_SIZE sizeof(uint32_t) -#define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(dbreg, dr[reg_index])) +#define DR_OFFSET(reg_index) \ + (LLVM_EXTENSION offsetof(UserArea, dbg) + \ + LLVM_EXTENSION offsetof(DBG, dr[reg_index])) // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure. #define DECLARE_REGISTER_INFOS_I386_STRUCT
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits