7 static char *rcsid_gdb_debug_c = "$Header$";
10 /************************************************************************/
14 /* Debugging interfaces for gdb. Some of these are
15 /* designed to be called from dbx.
17 /* routines included are:
19 /* gdb_debug set the debugging status flags
21 /* gd_types_print prints all the available types currently in
24 /* gd_con_status prints all the status codes for connections
26 /* gd_sum_cons summarizes all current connections detailing
27 /* for each flags, half connections with their
28 /* respective operation queues.
30 /* gd_op_q (halfcon) prints the queue associated with a
31 /* specified half connection (not directly callable)
33 /* gd_op_status a listing of the available states of an
36 /* Copyright 1986 MIT Project Athena
37 /* For copying and distribution information, please see
38 /* the file <mit-copyright.h>.
40 /************************************************************************/
42 #include <mit-copyright.h>
46 /************************************************************************/
50 /* Toggle a debugging flag. Warning: the interface to this routine
51 /* may change over time.
53 /************************************************************************/
58 gdb_Debug ^= flag; /* toggle the flag */
61 /************************************************************************/
65 /************************************************************************/
68 print_relation(name, relation)
72 FCN_PROPERTY(RELATION_T,FORMAT_PROPERTY)(name, (char *)&(relation));
74 /************************************************************************/
78 /************************************************************************/
81 print_tuple(name, tuple)
85 FCN_PROPERTY(TUPLE_T,FORMAT_PROPERTY)(name, (char *)&(tuple));
88 /************************************************************************/
90 /* print_tuple_descriptor
92 /************************************************************************/
95 print_tuple_descriptor(name, tuple_descriptor)
97 TUPLE_DESCRIPTOR tuple_descriptor;
99 FCN_PROPERTY(TUPLE_DESCRIPTOR_T,FORMAT_PROPERTY)(name,
100 (char *)&(tuple_descriptor));
103 /************************************************************************/
107 /* This is a routine for printing all the available types and
110 /************************************************************************/
117 printf ("\n\nTHE AVAILABLE TYPES WITH THEIR TYPE CODES ARE: \n\n");
119 printf ("typecode name\n");
121 for (i = 0; i < gdb_n_types; i++) {
122 printf ("%2d %s \n", i, STR_PROPERTY(i,NAME_PROPERTY));
126 /************************************************************************/
130 /* This routine will print all the status codes for operations
131 /* This is just a listing of the status numbers located in gdb.h
133 /************************************************************************/
138 /*----------------------------------------------------------*/
140 /* REMEMBER... these need to be fixed when the connection
141 /* status coded in gdb.h are redefined.
143 /*----------------------------------------------------------*/
145 printf ("THE STATUS CODES ARE: \n\n");
146 printf (" CODE STATUS\n");
147 printf (" 1 CON_STOPPED\n");
148 printf (" 2 CON_UP\n");
149 printf (" 3 CON_STARTING\n");
150 printf (" 4 CON_STOPPING\n");
155 /************************************************************************/
157 /* summarize connections (gd_sum_con)
159 /************************************************************************/
164 if ((index > gdb_mcons) || (gdb_cons[index].status<1)) {
165 printf ("gdb_cons[%d] is not a valid connection \n",index);
169 if (gdb_cons[index].status == CON_STOPPED) {
170 printf ("connection gdb_cons[%d] is stopped\n",index);
174 /*----------------------------------------------------------*/
176 /* REMEMBER this also must be changed when the def'n
177 /* of status fields in gdb.h is changed
179 /*----------------------------------------------------------*/
182 printf ("status of connection number %d is %2d \n",index,gdb_cons[index].status);
183 printf ("The information for each half-connexn: \n\n");
185 printf (" the inbound half-connection\n");
186 printf (" status: %2d \n",gdb_cons[index].in.status);
187 printf (" flags : %2d \n",gdb_cons[index].in.status);
188 printf (" file descr: %2d \n",gdb_cons[index].in.fd);
189 printf (" The operation queue is:\n");
190 gd_op_q (&(gdb_cons[index].in));
192 printf (" the outbound half-connection\n");
193 printf (" status: %2d \n",gdb_cons[index].out.status);
194 printf (" flags : %2d \n",gdb_cons[index].out.status);
195 printf (" file descr: %2d \n",gdb_cons[index].out.fd);
196 printf (" The operation queue is:\n");
197 gd_op_q (&(gdb_cons[index].out));
201 /************************************************************************/
205 /************************************************************************/
210 HALF_CONNECTION half_con;
213 int i; /*counter for the ith
217 current = half_con->op_q_first;
221 if (current == NULL) {
222 printf ("no operations in queue yet\n");
227 printf ("OPERATION STATUS\n\n");
229 while (current != (OPERATION)half_con) {
230 printf ("%2d %2d \n", i++ , current->status);
231 current = current ->next;
235 /************************************************************************/
238 /* this is a routine in which all the status codes and their
239 /* translations are printed.
241 /************************************************************************/
246 /*----------------------------------------------------------*/
248 /* REMEMBER these also need to be changed when
249 /* states of an operation in gdb.h is redefined
251 /*----------------------------------------------------------*/
253 printf ("CODE OPERATION STATE\n\n");
254 printf (" 1 OP_NOT_STARTED\n");
255 printf (" 2 OP_QUEUED\n");
256 printf (" 3 OP_RUNNING\n");
257 printf (" 4 OP_COMPLETE\n");
258 printf (" 5 OP_CANCELLING\n");
259 printf (" 6 OP_CANCELLED\n");
260 printf (" 7 OP_MARKED\n");