From a6b80313a21590ea5568ce7f3883d99d5f10286c Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 14 Jun 2023 19:20:53 +0100 Subject: [PATCH] Extra "maint set show-debug-dregs" debug output (submit separately) Change-Id: Iba98597f1ed858ce6ec40a449c520088e9c54031 --- gdb/nat/x86-dregs.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/gdb/nat/x86-dregs.c b/gdb/nat/x86-dregs.c index 4119214056a..70901948118 100644 --- a/gdb/nat/x86-dregs.c +++ b/gdb/nat/x86-dregs.c @@ -663,7 +663,16 @@ x86_dr_stopped_data_address (struct x86_debug_reg_state *state, addr = x86_dr_low_get_addr (i); rc = 1; if (show_debug_regs) - x86_show_dr (state, "watchpoint_hit", addr, -1, hw_write); + { + x86_show_dr (state, "watchpoint_hit, mirror", addr, -1, hw_write); + + struct x86_debug_reg_state real_state {}; + for (int r = 0; r < DR_NADDR; r++) + real_state.dr_mirror[r] = x86_dr_low_get_addr (r); + real_state.dr_status_mirror = status; + real_state.dr_control_mirror = control; + x86_show_dr (&real_state, "watchpoint_hit, real", addr, -1, hw_write); + } } } @@ -723,7 +732,16 @@ x86_dr_stopped_by_hw_breakpoint (struct x86_debug_reg_state *state) addr = x86_dr_low_get_addr (i); rc = 1; if (show_debug_regs) - x86_show_dr (state, "watchpoint_hit", addr, -1, hw_execute); + { + x86_show_dr (state, "watchpoint_hit", addr, -1, hw_execute); + + struct x86_debug_reg_state real_state {}; + for (int r = 0; r < DR_NADDR; r++) + real_state.dr_mirror[r] = x86_dr_low_get_addr (r); + real_state.dr_status_mirror = status; + real_state.dr_control_mirror = control; + x86_show_dr (&real_state, "watchpoint_hit, real", addr, -1, hw_execute); + } } } -- 2.47.2