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
48 class cl_address_space *mem;
52 enum brk_perm perm; // permanency (FIX,DYNAMIC)
56 cl_brk(class cl_address_space *imem, int inr, t_addr iaddr,
57 enum brk_perm iperm, int ihit);
58 virtual ~cl_brk(void);
60 class cl_address_space *get_mem(void) { return(mem); }
62 virtual void activate(void);
63 virtual void inactivate(void);
64 virtual enum brk_type type(void)= 0;
65 virtual enum brk_event get_event(void)= 0;
66 virtual bool do_hit(void);
71 * FETCH type of breakpoints
74 class cl_fetch_brk: public cl_brk
79 cl_fetch_brk(class cl_address_space *imem, int inr, t_addr iaddr,
80 enum brk_perm iperm, int ihit);
82 virtual enum brk_type type(void);
83 virtual enum brk_event get_event(void) { return(brkNONE); }
88 * Base of EVENT type of breakpoints
91 class cl_ev_brk: public cl_brk
94 cl_ev_brk(class cl_address_space *imem, int inr, t_addr iaddr,
96 int ihit, enum brk_event ievent, const char *iid);
97 cl_ev_brk(class cl_address_space *imem, int inr, t_addr iaddr,
100 enum brk_event event;
103 virtual enum brk_type type(void);
104 virtual enum brk_event get_event(void) { return(event); }
105 virtual bool match(struct event_rec *ev);
110 * Collection of breakpoint sorted by address
113 class brk_coll: public cl_sorted_list
116 class cl_address_space/*rom*/ *rom;
118 brk_coll(t_index alimit, t_index adelta, class cl_address_space/*rom*/*arom);
119 virtual const void *key_of(void *item);
120 virtual int compare(const void *key1, const void *key2);
122 virtual bool there_is_event(enum brk_event ev);
123 //virtual int make_new_nr(void);
125 virtual void add_bp(class cl_brk *bp);
126 virtual void del_bp(t_addr addr);
127 virtual void del_bp(t_index idx, int /*dummy*/);
128 virtual class cl_brk *get_bp(t_addr addr, int *idx);
129 virtual class cl_brk *get_bp(int nr);
130 virtual bool bp_at(t_addr addr);