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
38 /************************************************************************/
43 /************************************************************************/
47 /* Toggle a debugging flag. Warning: the interface to this routine
48 /* may change over time.
50 /************************************************************************/
55 gdb_Debug ^= flag; /* toggle the flag */
58 /************************************************************************/
62 /************************************************************************/
65 print_relation(name, relation)
69 FCN_PROPERTY(RELATION_T,FORMAT_PROPERTY)(name, (char *)&(relation));
71 /************************************************************************/
75 /************************************************************************/
78 print_tuple(name, tuple)
82 FCN_PROPERTY(TUPLE_T,FORMAT_PROPERTY)(name, (char *)&(tuple));
85 /************************************************************************/
87 /* print_tuple_descriptor
89 /************************************************************************/
92 print_tuple_descriptor(name, tuple_descriptor)
94 TUPLE_DESCRIPTOR tuple_descriptor;
96 FCN_PROPERTY(TUPLE_DESCRIPTOR_T,FORMAT_PROPERTY)(name,
97 (char *)&(tuple_descriptor));
100 /************************************************************************/
104 /* This is a routine for printing all the available types and
107 /************************************************************************/
114 printf ("\n\nTHE AVAILABLE TYPES WITH THEIR TYPE CODES ARE: \n\n");
116 printf ("typecode name\n");
118 for (i = 0; i < gdb_n_types; i++) {
119 printf ("%2d %s \n", i, STR_PROPERTY(i,NAME_PROPERTY));
123 /************************************************************************/
127 /* This routine will print all the status codes for operations
128 /* This is just a listing of the status numbers located in gdb.h
130 /************************************************************************/
135 /*----------------------------------------------------------*/
137 /* REMEMBER... these need to be fixed when the connection
138 /* status coded in gdb.h are redefined.
140 /*----------------------------------------------------------*/
142 printf ("THE STATUS CODES ARE: \n\n");
143 printf (" CODE STATUS\n");
144 printf (" 1 CON_STOPPED\n");
145 printf (" 2 CON_UP\n");
146 printf (" 3 CON_STARTING\n");
147 printf (" 4 CON_STOPPING\n");
152 /************************************************************************/
154 /* summarize connections (gd_sum_con)
156 /************************************************************************/
161 if ((index > gdb_mcons) || (gdb_cons[index].status<1)) {
162 printf ("gdb_cons[%d] is not a valid connection \n",index);
166 if (gdb_cons[index].status == CON_STOPPED) {
167 printf ("connection gdb_cons[%d] is stopped\n",index);
171 /*----------------------------------------------------------*/
173 /* REMEMBER this also must be changed when the def'n
174 /* of status fields in gdb.h is changed
176 /*----------------------------------------------------------*/
179 printf ("status of connection number %d is %2d \n",index,gdb_cons[index].status);
180 printf ("The information for each half-connexn: \n\n");
182 printf (" the inbound half-connection\n");
183 printf (" status: %2d \n",gdb_cons[index].in.status);
184 printf (" flags : %2d \n",gdb_cons[index].in.status);
185 printf (" file descr: %2d \n",gdb_cons[index].in.fd);
186 printf (" The operation queue is:\n");
187 gd_op_q (&(gdb_cons[index].in));
189 printf (" the outbound half-connection\n");
190 printf (" status: %2d \n",gdb_cons[index].out.status);
191 printf (" flags : %2d \n",gdb_cons[index].out.status);
192 printf (" file descr: %2d \n",gdb_cons[index].out.fd);
193 printf (" The operation queue is:\n");
194 gd_op_q (&(gdb_cons[index].out));
198 /************************************************************************/
202 /************************************************************************/
207 HALF_CONNECTION half_con;
210 int i; /*counter for the ith
214 current = half_con->op_q_first;
218 if (current == NULL) {
219 printf ("no operations in queue yet\n");
224 printf ("OPERATION STATUS\n\n");
226 while (current != (OPERATION)half_con) {
227 printf ("%2d %2d \n", i++ , current->status);
228 current = current ->next;
232 /************************************************************************/
235 /* this is a routine in which all the status codes and their
236 /* translations are printed.
238 /************************************************************************/
243 /*----------------------------------------------------------*/
245 /* REMEMBER these also need to be changed when
246 /* states of an operation in gdb.h is redefined
248 /*----------------------------------------------------------*/
250 printf ("CODE OPERATION STATE\n\n");
251 printf (" 1 OP_NOT_STARTED\n");
252 printf (" 2 OP_QUEUED\n");
253 printf (" 3 OP_RUNNING\n");
254 printf (" 4 OP_COMPLETE\n");
255 printf (" 5 OP_CANCELLING\n");
256 printf (" 6 OP_CANCELLED\n");
257 printf (" 7 OP_MARKED\n");