Duel – A Very High-Level Debugging Language

  • David R. Hanson ,
  • Michael Golan

Published by Advanced Computing Systems Association

Publication

Most source-level debuggers accept expressions in the source language, e.g., C, and can print source-language values. This approach is usually justified on grounds that programmers need to know only one language. But the evaluation of source-language expressions or even statements 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 specifically for source-level 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 outline its implementation. Duel is freely available, and it could be interfaced to other debuggers.