Commit 95a3cd8e authored by Peter Schlaile's avatar Peter Schlaile Committed by Alexandre Julliard

winedbg: Adds an rwatch command to winedbg.

parent 1c0982e8
......@@ -415,14 +415,14 @@ static void break_add_watch(const struct dbg_lvalue* lvalue, BOOL is_write)
*
* Adds a watch point from an address (stored in a lvalue)
*/
void break_add_watch_from_lvalue(const struct dbg_lvalue* 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, TRUE);
break_add_watch(&lval, is_write);
}
/***********************************************************************
......@@ -430,14 +430,14 @@ void break_add_watch_from_lvalue(const struct dbg_lvalue* lvalue)
*
* Add a watchpoint from a symbol name
*/
void break_add_watch_from_id(const char *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, 1);
break_add_watch(&lvalue, is_write);
break;
case sglv_unknown:
dbg_printf("Unable to add watchpoint\n");
......
......@@ -52,7 +52,7 @@ static void parser(const char*);
}
%token tCONT tPASS tSTEP tLIST tNEXT tQUIT tHELP tBACKTRACE tALL tINFO tUP tDOWN
%token tENABLE tDISABLE tBREAK tHBREAK tWATCH tDELETE tSET tPRINT tEXAM
%token tENABLE tDISABLE tBREAK tHBREAK tWATCH tRWATCH tDELETE tSET tPRINT tEXAM
%token tABORT tECHO
%token tCLASS tMAPS tSTACK tSEGMENTS tSYMBOL tREGS tALLREGS tWND tLOCAL tEXCEPTION
%token tPROCESS tTHREAD tEOL tEOF
......@@ -250,10 +250,13 @@ break_command:
;
watch_command:
tWATCH '*' expr_lvalue { break_add_watch_from_lvalue(&$3); }
| tWATCH identifier { break_add_watch_from_id($2); }
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); }
;
display_command:
tDISPLAY { display_print(); }
| tDISPLAY expr { display_add($2, 1, 0); }
......
......@@ -203,6 +203,7 @@ STRING \"[^\n"]+\"
<INITIAL,INFO_CMD,BD_CMD>break|brea|bre|br|b { BEGIN(NOCMD); return tBREAK; }
<INITIAL,INFO_CMD,BD_CMD>hbreak|hbrea|hbre|hbr|hb { BEGIN(NOCMD); return tHBREAK; }
<INITIAL>watch|watc|wat { BEGIN(NOCMD); return tWATCH; }
<INITIAL>rwatch|rwatc|rwat { BEGIN(NOCMD); return tRWATCH; }
<INITIAL>whatis|whati|what { BEGIN(NOCMD); return tWHATIS; }
<INITIAL,NOPROCESS>run|ru|r { BEGIN(ASTRING_EXPECTED); return tRUN;}
<INITIAL>detach|detac|deta|det { BEGIN(NOCMD); return tDETACH; }
......
......@@ -294,8 +294,8 @@ 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(int lineno, BOOL swbp);
extern void break_add_watch_from_lvalue(const struct dbg_lvalue* lvalue);
extern void break_add_watch_from_id(const char* name);
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_check_delayed_bp(void);
extern void break_delete_xpoint(int num);
extern void break_delete_xpoints_from_module(DWORD64 base);
......
......@@ -49,7 +49,7 @@ void print_help(void)
"subset of the commands that gdb accepts.",
"The commands currently are:",
" help quit",
" break [*<addr>] watch *<addr>",
" break [*<addr>] watch | rwatch *<addr>",
" delete break bpnum disable bpnum",
" enable bpnum condition <bpnum> [<expr>]",
" finish cont [N]",
......
......@@ -185,6 +185,11 @@ Adds a watch command (on write) at address \fBN\fR (on 4 bytes).
.IP \fBwatch\ <id>\fR
Adds a watch command (on write) at the address of symbol
\fB<id>\fR. Size depends on size of \fB<id>\fR.
.IP \fBrwatch\ *\ N\fR
Adds a watch command (on read) at address \fBN\fR (on 4 bytes).
.IP \fBrwatch\ <id>\fR
Adds a watch command (on read) at the address of symbol
\fB<id>\fR. Size depends on size of \fB<id>\fR.
.IP \fBinfo\ break\fR
Lists all (break|watch)-points (with their state).
.PP
......
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