* Copyright (c) 1980 The Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)trcond.c 5.2 (Berkeley) %G%";
* trace condition list -- a list of conditions that are to be
* checked before printing out the current source line or stopping.
typedef struct tr_cond_list
{
struct tr_cond_list
*next_condition
;
LOCAL TR_COND_LIST
*cond_list
;
* add a condition to be checked before giving single stepping information
register TR_COND_LIST
*c
;
c
= alloc(1, TR_COND_LIST
);
c
->next_condition
= cond_list
;
* delete a condition from the list
register TR_COND_LIST
*c
, *last
;
for (c
= cond_list
; c
!= NIL
; c
= c
->next_condition
) {
if (c
->trtype
== trtype
&& c
->trace_condition
== p
) {
panic("tried to delete non-existent condition");
cond_list
= c
->next_condition
;
last
->next_condition
= c
->next_condition
;
* Determine if any trace condition on the list is true.
* If the list is empty, return TRUE.
register TR_COND_LIST
*c
;
for (c
= cond_list
; c
!= NIL
; c
= c
->next_condition
) {
if (c
->trtype
== TRPRINT
) {
if (cond(c
->trace_condition
)) {
* Determine if any stop condition on the list is true.
* If the list is empty, return FALSE.
register TR_COND_LIST
*c
;
for (c
= cond_list
; c
!= NIL
; c
= c
->next_condition
) {
if (c
->trtype
== TRSTOP
&& cond(c
->trace_condition
)) {
* Free all existing breakpoints.
* Trace conditions have been freed elsewhere.
for (c
= cond_list
; c
!= NIL
; c
= next
) {
next
= c
->next_condition
;