Commit adde76fa authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winedbg: Simplify watch command implementation.

This also correctly initialize some lvalue. Context of the bug has changed, but the underlying issue remained the same. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39495Signed-off-by: 's avatarEric Pouech <eric.pouech@codeweavers.com>
parent 812b4b1c
......@@ -395,7 +395,7 @@ void break_check_delayed_bp(void)
*
* Add a watchpoint.
*/
static void break_add_watch(const struct dbg_lvalue* lvalue, BOOL is_write)
void break_add_watch(const struct dbg_lvalue* lvalue, BOOL is_write)
{
int num;
DWORD64 l = 4;
......@@ -436,43 +436,6 @@ static void break_add_watch(const struct dbg_lvalue* lvalue, BOOL is_write)
dbg_printf("\n");
}
/******************************************************************
* break_add_watch_from_lvalue
*
* Adds a watch point from an address (stored in a lvalue)
*/
void break_add_watch_from_lvalue(const struct dbg_lvalue* lvalue,BOOL is_write)
{
struct dbg_lvalue lval;
types_extract_as_address(lvalue, &lval.addr);
lval.type.id = dbg_itype_none;
break_add_watch(&lval, is_write);
}
/***********************************************************************
* break_add_watch_from_id
*
* Add a watchpoint from a symbol name
*/
void break_add_watch_from_id(const char *name, BOOL is_write)
{
struct dbg_lvalue lvalue;
switch (symbol_get_lvalue(name, -1, &lvalue, TRUE))
{
case sglv_found:
break_add_watch(&lvalue, is_write);
break;
case sglv_unknown:
dbg_printf("Unable to add watchpoint\n");
break;
case sglv_aborted: /* user aborted symbol lookup */
break;
}
}
/***********************************************************************
* break_delete_xpoint
*
......
......@@ -248,10 +248,8 @@ break_command:
;
watch_command:
tWATCH '*' expr_lvalue { break_add_watch_from_lvalue(&$3, TRUE); }
| tWATCH identifier { break_add_watch_from_id($2, TRUE); }
| tRWATCH '*' expr_lvalue { break_add_watch_from_lvalue(&$3, FALSE); }
| tRWATCH identifier { break_add_watch_from_id($2, FALSE); }
tWATCH expr_lvalue { break_add_watch(&$2, TRUE); }
| tRWATCH expr_lvalue { break_add_watch(&$2, FALSE); }
;
......
......@@ -331,8 +331,7 @@ extern BOOL break_add_break(const ADDRESS64* addr, BOOL verbose, BOO
extern BOOL break_add_break_from_lvalue(const struct dbg_lvalue* value, BOOL swbp);
extern void break_add_break_from_id(const char* name, int lineno, BOOL swbp);
extern void break_add_break_from_lineno(const char *filename, int lineno, BOOL swbp);
extern void break_add_watch_from_lvalue(const struct dbg_lvalue* lvalue, BOOL is_write);
extern void break_add_watch_from_id(const char* name, BOOL is_write);
extern void break_add_watch(const struct dbg_lvalue* value, BOOL is_write);
extern void break_check_delayed_bp(void);
extern void break_delete_xpoint(int num);
extern void break_delete_xpoints_from_module(DWORD64 base);
......
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