Commit 6ab9b235 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winedbg: Hardware breakpoints

- implemented hardware assisted breakpoints (new 'hbreak' command which behaves just as 'break' command) - small improvements to break handling (saving hit xpoint across exception handling) - fixed 'cont N' command for watchpoints
parent 8b0feb25
......@@ -50,7 +50,8 @@ int yyerror(const char*);
}
%token tCONT tPASS tSTEP tLIST tNEXT tQUIT tHELP tBACKTRACE tALL tINFO tUP tDOWN
%token tENABLE tDISABLE tBREAK tWATCH tDELETE tSET tMODE tPRINT tEXAM tABORT tVM86
%token tENABLE tDISABLE tBREAK tHBREAK tWATCH tDELETE tSET tMODE tPRINT tEXAM
%token tABORT tVM86
%token tCLASS tMAPS tSTACK tSEGMENTS tSYMBOL tREGS tWND tQUEUE tLOCAL tEXCEPTION
%token tPROCESS tTHREAD tMODREF tEOL tEOF
%token tFRAME tSHARE tCOND tDISPLAY tUNDISPLAY tDISASSEMBLE
......@@ -215,11 +216,16 @@ print_command:
;
break_command:
tBREAK '*' expr_lvalue { break_add_break_from_lvalue(&$3); }
| tBREAK identifier { break_add_break_from_id($2, -1); }
| tBREAK identifier ':' tNUM { break_add_break_from_id($2, $4); }
| tBREAK tNUM { break_add_break_from_lineno($2); }
| tBREAK { break_add_break_from_lineno(-1); }
tBREAK '*' expr_lvalue { break_add_break_from_lvalue(&$3, TRUE); }
| tBREAK identifier { break_add_break_from_id($2, -1, TRUE); }
| tBREAK identifier ':' tNUM { break_add_break_from_id($2, $4, TRUE); }
| tBREAK tNUM { break_add_break_from_lineno($2, TRUE); }
| tBREAK { break_add_break_from_lineno(-1, TRUE); }
| tHBREAK '*' expr_lvalue { break_add_break_from_lvalue(&$3, FALSE); }
| tHBREAK identifier { break_add_break_from_id($2, -1, FALSE); }
| tHBREAK identifier ':' tNUM { break_add_break_from_id($2, $4, FALSE); }
| tHBREAK tNUM { break_add_break_from_lineno($2, FALSE); }
| tHBREAK { break_add_break_from_lineno(-1, FALSE); }
| tENABLE tNUM { break_enable_xpoint($2, TRUE); }
| tENABLE tBREAK tNUM { break_enable_xpoint($3, TRUE); }
| tDISABLE tNUM { break_enable_xpoint($2, FALSE); }
......
......@@ -173,6 +173,7 @@ STRING \"[^\n"]+\"
<INITIAL>symbolfile|symbols|symbol|sf { BEGIN(PATH_EXPECTED); return tSYMBOLFILE; }
<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>whatis|whati|what { BEGIN(NOCMD); return tWHATIS; }
<INITIAL,NOPROCESS>run|ru|r { BEGIN(ASTRING_EXPECTED); return tRUN;}
......
......@@ -165,6 +165,7 @@ struct dbg_thread
enum dbg_exec_mode exec_mode; /* mode the thread is run (step/run...) */
int exec_count; /* count of mode operations */
ADDRESS_MODE addr_mode; /* mode */
int stopped_xpoint; /* xpoint on which the thread has stopped (-1 if none) */
struct dbg_breakpoint step_over_bp;
char name[9];
struct dbg_thread* next;
......@@ -183,6 +184,7 @@ struct dbg_thread
struct dbg_delayed_bp
{
BOOL is_symbol;
BOOL software_bp;
union
{
struct
......@@ -257,10 +259,10 @@ struct type_expr_t
/* break.c */
extern void break_set_xpoints(BOOL set);
extern BOOL break_add_break(const ADDRESS* addr, BOOL verbose);
extern BOOL break_add_break_from_lvalue(const struct dbg_lvalue* value);
extern void break_add_break_from_id(const char* name, int lineno);
extern void break_add_break_from_lineno(int lineno);
extern BOOL break_add_break(const ADDRESS* addr, BOOL verbose, 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_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_check_delayed_bp(void);
......
......@@ -392,6 +392,7 @@ struct dbg_thread* dbg_add_thread(struct dbg_process* p, DWORD tid,
t->exec_count = 0;
t->step_over_bp.enabled = FALSE;
t->step_over_bp.refcount = 0;
t->stopped_xpoint = -1;
t->in_exception = FALSE;
t->frames = NULL;
t->num_frames = 0;
......@@ -420,7 +421,7 @@ static void dbg_init_current_thread(void* start)
break_set_xpoints(FALSE);
addr.Mode = AddrModeFlat;
addr.Offset = (DWORD)start;
break_add_break(&addr, TRUE);
break_add_break(&addr, TRUE, TRUE);
break_set_xpoints(TRUE);
}
}
......
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