Event query-based debugging
Yoshito Yamane · 1997
Repairing a bug in a large program can be difficult and time consuming. The debugging programmer must locate the defect by tracing the causal chain from the fault to the defect based on available information. It is particularly difficult to trace the causal chain in a non-local bug, in which the defect is far from the observed fault in a large and complex program. The difficulty is particularly acute in programming-in-the-large, where a programmer must locate a defect in a program that he only partially understands. Attempting to locate the defect under these circumstances, a programmer relies heavily on inspecting the execution of a target program through such means as the insertion of probe statements and the use of break-and-inspect debuggers. When inspecting an execution of a large and complex program in this way, it is difficult for a programmer: (1) to specify all necessary parameters that uniquely identify a piece of data and/or instance of repeatedly executed code (referential problem), and (2) to group the collected information according to the dependency relevant to his inspection (grouping problem). In this dissertation, we developed a style of debugging, called Event Query Based Debugging (EQBD), in which a program execution is modeled as a process generating a sequence of control and data flow events. The search for a defect is achieved by the repeated application of queries to the generated sequence. The language used to specify the queried pattern is based on regular expressions; it incorporates matching and grouping controlled by the values extracted from the events and bound to query variables. In debugging with EQBD, a programmer issues a query to extract events of interest from the program's execution, grouping them according to the dependencies he has in mind. By automating this process of information extraction and grouping, EQBD addresses the challenges posed by the referential and grouping problems. It also effectively aids programmers in identifying faults involving dependencies hidden in the richer abstractions commonly found in large programs. A prototype EQBD processor and user interface have been designed and implemented. Their effectiveness in locating a defect has been verified by applying them to repair non-local bugs in non-trivial programs. Also, an architecture for these tools to achieve a performance level necessary for practical use is proposed.