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