DUEL - A Very High-Level Debugging Language

Most source-level debuggers accept expressions in the source language, e.g., C, and can print sourcelanguage values. This approach is usually justied on grounds that programmers need to know only one language. But the evaluation of source-language expressions or even statemetns is poorly suited for making non-trivial queries about the program state, e.g., \which elements of array x[100] are positive?" Duel departs from the conventional wisdom: It is a very high-level language designed specically for sourcelevel debugging of C programs. Duel expressions are a superset of C’s and include \generators," which are expressions that can produce zero or more values and are inspired by Icon, APL, and LISP. For example, x[..100] >? 0 displays the positive elements of x and their indices. Duel is implemented on top of gdb and adds one new command to evaluate Duel expressions and display their results. This paper describes Duel’s semantics and syntax, gives examples of its use, and outlines its implementation. Duel is freely available, and it could be interfaced to other debuggers.