EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dbBkpt.h
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * SPDX-License-Identifier: EPICS
7 * EPICS Base is distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 /* dbBkpt.h */
11 /*
12  * Author: Matthew Needes
13  * Date: 8-30-93
14  */
15 
16 #ifndef INCdbBkptsh
17 #define INCdbBkptsh 1
18 
19 #include "ellLib.h"
20 #include "epicsEvent.h"
21 #include "epicsThread.h"
22 #include "epicsTime.h"
23 #include "dbCoreAPI.h"
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /*
29  * Structure containing a list of set breakpoints
30  * in a lockset
31  */
32 
33 struct BP_LIST {
34  ELLNODE *next_list;
35  ELLNODE *prev_list;
36  struct dbCommon *precord;
37 };
38 
39 /*
40  * Structure containing queue of entrypoints
41  * detected for a lockset.
42  */
43 struct EP_LIST {
44  ELLNODE *next_list;
45  ELLNODE *prev_list;
46  struct dbCommon *entrypoint; /* pointer to entry point in lockset */
47  unsigned long count; /* number of times record processed */
48  epicsTimeStamp time; /* time record first logged */
49  char sched; /* schedule record for next dbContTask() pass */
50 };
51 
52 /*
53  * Structure for stack of lock sets that
54  * currently contain breakpoints. (uses ellLib)
55  */
56 struct LS_LIST {
57  ELLNODE *next_list;
58  ELLNODE *prev_list;
59  struct dbCommon *precord;/* points to where execution is currently stopped */
60  struct dbCommon *current_ep; /* current entrypoint */
61  ELLLIST bp_list; /* list of records containing breakpoints in a lockset */
62  ELLLIST ep_queue; /* queue of entrypoints found so far */
63  epicsEventId ex_sem; /* semaphore for execution queue */
64  epicsThreadId taskid; /* saved taskid for the task in stepping mode */
65  int step; /* one if currently "stepping," else zero */
66  unsigned long l_num; /* lockset number */
67 };
68 
69 /* Values for BKPT (breakpoint) field in record */
70 
71 /* 1st bit = 0 if breakpoint is not set, */
72 /* 1 if breakpoint set */
73 /* 2nd bit = 0 if no printing after processing */
74 /* 1 if print after processing set */
75 
76 /* Breakpoint Masks */
77 #define BKPT_ON_MASK 0x001
78 #define BKPT_OFF_MASK 0x0FE
79 #define BKPT_PRINT_MASK 0x002
80 #define BKPT_PRINT_OFF_MASK 0x0FD
81 
82 #define MAX_EP_COUNT 99999
83 
84 DBCORE_API void dbBkptInit(void);
85 DBCORE_API long dbb(const char *recordname);
86 DBCORE_API long dbd(const char *recordname);
87 DBCORE_API long dbc(const char *recordname);
88 DBCORE_API long dbs(const char *recordname);
89 DBCORE_API long dbstat(void);
90 DBCORE_API long dbp(
91  const char *record_name, int interest_level);
92 DBCORE_API long dbap(const char *record_name);
93 DBCORE_API int dbBkpt(struct dbCommon *precord);
94 DBCORE_API void dbPrint(struct dbCommon *precord);
95 DBCORE_API long dbprc(char *record_name);
96 
97 extern long lset_stack_count;
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif
C++ and C descriptions for a thread.
Definition: dbBkpt.h:56
List node type.
Definition: ellLib.h:46
APIs for the epicsEvent binary semaphore.
Declaration of dbCommon.
Definition: dbCommon.h:18
EPICS time stamp, for use from C code.
Definition: epicsTime.h:42
A doubly-linked list library.
List header type.
Definition: ellLib.h:57
Definition: dbBkpt.h:33
struct epicsEventOSD * epicsEventId
An identifier for an epicsEvent for use with the C API.
Definition: epicsEvent.h:47
Definition: dbBkpt.h:43
epicsTimeStamp time
Time.
Definition: dbCommon.h:64
EPICS time-stamps (epicsTimeStamp), epicsTime C++ class and C functions for handling wall-clock times...