Commit 5f23b94a authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winedbg: Allow using 8-byte long hardware assisted breakpoints on x86_64 CPUs.

parent 23671868
......@@ -355,6 +355,7 @@ extern void be_x86_64_disasm_one_insn(ADDRESS64* addr, int display);
#define DR7_LEN_1 (0x0)
#define DR7_LEN_2 (0x4)
#define DR7_LEN_4 (0xC)
#define DR7_LEN_8 (0x8)
#define DR7_LOCAL_ENABLE_SHIFT 0
#define DR7_GLOBAL_ENABLE_SHIFT 1
......@@ -429,10 +430,11 @@ static unsigned be_x86_64_insert_Xpoint(HANDLE hProcess, const struct be_process
*pr = (DWORD64)addr;
if (type != be_xpoint_watch_exec) switch (size)
{
case 8: bits |= DR7_LEN_8; break;
case 4: bits |= DR7_LEN_4; break;
case 2: bits |= DR7_LEN_2; break;
case 1: bits |= DR7_LEN_1; break;
default: return 0;
default: WINE_FIXME("Unsupported xpoint_watch of size %d\n", size); return 0;
}
*val = reg;
/* clear old values */
......
......@@ -137,7 +137,7 @@ static int init_xpoint(int type, const ADDRESS64* addr)
*
* Returns the value watched by watch point 'num'.
*/
static BOOL get_watched_value(int num, LPDWORD val)
static BOOL get_watched_value(int num, DWORD64* val)
{
BYTE buf[4];
......@@ -147,6 +147,7 @@ static BOOL get_watched_value(int num, LPDWORD val)
switch (dbg_curr_process->bp[num].w.len + 1)
{
case 8: *val = *(DWORD64*)buf; break;
case 4: *val = *(DWORD*)buf; break;
case 2: *val = *(WORD*)buf; break;
case 1: *val = *(BYTE*)buf; break;
......@@ -554,7 +555,7 @@ static int find_triggered_watch(void)
*/
for (i = 0; i < dbg_curr_process->next_bp; i++)
{
DWORD val = 0;
DWORD64 val = 0;
if (bp[i].refcount && bp[i].enabled && !is_xpoint_break(i) &&
(be_cpu->is_watchpoint_set(&dbg_context, bp[i].info)))
......@@ -577,7 +578,7 @@ static int find_triggered_watch(void)
*/
for (i = 0; i < dbg_curr_process->next_bp; i++)
{
DWORD val = 0;
DWORD64 val = 0;
if (bp[i].refcount && bp[i].enabled && !is_xpoint_break(i) &&
get_watched_value(i, &val))
......@@ -740,8 +741,8 @@ BOOL break_should_continue(ADDRESS64* addr, DWORD code)
case be_xpoint_watch_write:
dbg_printf("Stopped on watchpoint %d at ", dbg_curr_thread->stopped_xpoint);
print_address(addr, TRUE);
dbg_printf(" new value %u\n",
dbg_curr_process->bp[dbg_curr_thread->stopped_xpoint].w.oldval);
dbg_printf(" new value %s\n",
wine_dbgstr_longlong(dbg_curr_process->bp[dbg_curr_thread->stopped_xpoint].w.oldval));
}
return FALSE;
}
......
......@@ -139,7 +139,7 @@ struct dbg_breakpoint
struct /* only used for watchpoints */
{
BYTE len : 2;
DWORD oldval;
DWORD64 oldval;
} w;
struct expr* condition;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment