Imported Upstream version 2.9.0
[debian/cc1111] / debugger / mcs51 / break.h
1 /*-------------------------------------------------------------------------
2   break.h - Header file for break point management
3         Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
4
5    This program is free software; you can redistribute it and/or modify it
6    under the terms of the GNU General Public License as published by the
7    Free Software Foundation; either version 2, or (at your option) any
8    later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19    In other words, you are welcome to use, share and improve this program.
20    You are forbidden to forbid anyone else to use, share and improve
21    what you give them.   Help stamp out software-hoarding!
22 -------------------------------------------------------------------------*/
23
24 #ifndef SDCDB_BREAK_H
25 #define SDCDB_BREAK_H
26
27 #include "simi.h"
28
29 /* break point type */
30 enum {
31     DATA = 1,
32     CODE    ,
33     A_CODE  ,
34     USER    ,
35     STEP    ,
36     NEXT    ,
37     FENTRY  ,
38     FEXIT,
39     TMPUSER };
40
41 typedef struct breakp
42 {
43     unsigned addr;           /* address of break point */
44     int      bpnum ;         /* break point number */
45     char     addrType;       /* data or code */
46     char     bpType  ;       /* bp type USER/ LOGICAL */
47     char     *filename;      /* file name */
48     int      lineno  ;       /* lineno */
49     int (*callBack)
50           (unsigned,struct breakp *,context *);/* address of call back
51                                          * function */
52     char *commands;
53     int  ignoreCnt;
54     int  hitCnt;
55     char *condition;
56 } breakp;
57
58
59 #define BP_CALLBACK(func) \
60     int func (unsigned addr, \
61              breakp *bp, \
62              context *ctxt)
63
64 #define EXTERN_BP_CALLBACK(func) \
65     extern int func (unsigned addr, \
66              breakp *bp, \
67              context *ctxt)
68
69 extern char userBpPresent;
70 extern char doingSteps;
71 extern hTab *bptable;
72
73
74
75 int setBreakPoint (unsigned , char , char,
76                     int (*callBack)(unsigned,breakp *bp,context *),char *, int);
77
78 long getLastBreakptNumber(void);
79 void resetHitCount(void);
80 void setUserbpCommand   (int , char *);
81 void setUserbpCondition (int , char *);
82 void setUserbpIgnCount  (int , int   );
83
84 void  clearUSERbp ( unsigned int  );
85 void  deleteSTEPbp();
86 void  deleteNEXTbp();
87 void  deleteUSERbp(int);
88 int   dispatchCB (unsigned, context *);
89 void  listUSERbp ();
90
91 /* call back functions */
92 EXTERN_BP_CALLBACK(fexitCB);
93 EXTERN_BP_CALLBACK(fentryCB);
94 EXTERN_BP_CALLBACK(userBpCB);
95 EXTERN_BP_CALLBACK(stepBpCB);
96 EXTERN_BP_CALLBACK(nextBpCB);
97
98 #endif