2 * Simulator of microcontrollers (sim.src/brkcl.h)
4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
10 /* This file is part of microcontroller simulator: ucsim.
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING. If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
28 #ifndef SIM_BRKCL_HEADER
29 #define SIM_BRKCL_HEADER
42 * Base object of breakpoints
45 class cl_brk: public cl_base
50 enum brk_perm perm; // permanency (FIX,DYNAMIC)
54 cl_brk(int inr, t_addr iaddr, enum brk_perm iperm, int ihit);
57 virtual enum brk_type type(void)= 0;
58 virtual bool do_hit(void);
63 * FETCH type of breakpoints
66 class cl_fetch_brk: public cl_brk
71 cl_fetch_brk(int inr, t_addr iaddr, enum brk_perm iperm, int ihit);
73 virtual enum brk_type type(void);
78 * Base of EVENT type of breakpoints
81 class cl_ev_brk: public cl_brk
84 cl_ev_brk(int inr, t_addr iaddr, enum brk_perm iperm, int ihit,
85 enum brk_event ievent, const char *iid);
90 virtual enum brk_type type(void);
91 virtual bool match(struct event_rec *ev);
99 class cl_wi_brk: public cl_ev_brk
102 cl_wi_brk(int inr, t_addr iaddr, enum brk_perm iperm, int ihit);
104 virtual bool match(struct event_rec *ev);
112 class cl_ri_brk: public cl_ev_brk
115 cl_ri_brk(int inr, t_addr iaddr, enum brk_perm iperm, int ihit);
117 virtual bool match(struct event_rec *ev);
125 class cl_wx_brk: public cl_ev_brk
128 cl_wx_brk(int inr, t_addr iaddr, enum brk_perm iperm, int ihit);
130 virtual bool match(struct event_rec *ev);
138 class cl_rx_brk: public cl_ev_brk
141 cl_rx_brk(int inr, t_addr iaddr, enum brk_perm iperm, int ihit);
143 virtual bool match(struct event_rec *ev);
151 class cl_ws_brk: public cl_ev_brk
154 cl_ws_brk(int inr, t_addr iaddr, enum brk_perm iperm, int ihit);
156 virtual bool match(struct event_rec *ev);
164 class cl_rs_brk: public cl_ev_brk
167 cl_rs_brk(int inr, t_addr iaddr, enum brk_perm iperm, int ihit);
169 virtual bool match(struct event_rec *ev);
177 class cl_rc_brk: public cl_ev_brk
180 cl_rc_brk(int inr, t_addr iaddr, enum brk_perm iperm, int ihit);
182 virtual bool match(struct event_rec *ev);
187 * Collection of breakpoint sorted by address
190 class brk_coll: public cl_sorted_list
195 brk_coll(t_index alimit, t_index adelta, class cl_rom *arom);
196 virtual void *key_of(void *item);
197 virtual int compare(void *key1, void *key2);
199 virtual bool there_is_event(enum brk_event ev);
200 //virtual int make_new_nr(void);
202 virtual void add_bp(class cl_brk *bp);
203 virtual void del_bp(t_addr addr);
204 virtual class cl_brk *get_bp(t_addr addr, int *idx);
205 virtual class cl_brk *get_bp(int nr);
206 virtual bool bp_at(t_addr addr);