Table of Contents
Fetching ...

Moldable Exceptions

Andrei Chiş, Tudor Gîrba, Oscar Nierstrasz

TL;DR

The paper tackles the challenge of debugging in complex, domain-specific contexts by introducing moldable exceptions, a lightweight mechanism that lets a debugger adapt its UI and interactions based on the exception raised. Through the moldable inspector and annotated exception methods, developers can define domain-specific views, actions, and even automated fixes with minimal code, enabling tailored debugging experiences such as diff views and scripted-UI previews. A concrete case study in an insurance-policies workflow demonstrates integrating diff views and an Accept action to streamline repair workflows, while broader implementation details show how eight debugger specifications and 26 views can be realized with an average of under 12 lines of code per view. The work argues for a portable, annotation-driven extension model that can generalize beyond GT, potentially transforming how debuggers support domain-specific reasoning and automated remediation.

Abstract

Debugging is hard. Interactive debuggers are mostly the same. They show you a stack, a way to sample the state of the stack, and, if the debugger is live, a way to step through execution. The standard interactive debugger for a general-purpose programming language provided by a mainstream IDE mostly offers a low-level interface in terms of generic language constructs to track down and fix bugs. A custom debugger, such as those developed for specific application domains, offers alternative interfaces more suitable to the specific execution context of the program being debugged. Custom debuggers offering contextual debugging views and actions can greatly improve our ability to reason about the current problem. Implementing such custom debuggers, however, is non-trivial, and poses a barrier to improving the debugging experience. In this paper we introduce "moldable exceptions", a lightweight mechanism to adapt a debugger's interface based on contextual information provided by a raised exception. We present, through a series of examples, how moldable exceptions can enhance a live programming environment.

Moldable Exceptions

TL;DR

The paper tackles the challenge of debugging in complex, domain-specific contexts by introducing moldable exceptions, a lightweight mechanism that lets a debugger adapt its UI and interactions based on the exception raised. Through the moldable inspector and annotated exception methods, developers can define domain-specific views, actions, and even automated fixes with minimal code, enabling tailored debugging experiences such as diff views and scripted-UI previews. A concrete case study in an insurance-policies workflow demonstrates integrating diff views and an Accept action to streamline repair workflows, while broader implementation details show how eight debugger specifications and 26 views can be realized with an average of under 12 lines of code per view. The work argues for a portable, annotation-driven extension model that can generalize beyond GT, potentially transforming how debuggers support domain-specific reasoning and automated remediation.

Abstract

Debugging is hard. Interactive debuggers are mostly the same. They show you a stack, a way to sample the state of the stack, and, if the debugger is live, a way to step through execution. The standard interactive debugger for a general-purpose programming language provided by a mainstream IDE mostly offers a low-level interface in terms of generic language constructs to track down and fix bugs. A custom debugger, such as those developed for specific application domains, offers alternative interfaces more suitable to the specific execution context of the program being debugged. Custom debuggers offering contextual debugging views and actions can greatly improve our ability to reason about the current problem. Implementing such custom debuggers, however, is non-trivial, and poses a barrier to improving the debugging experience. In this paper we introduce "moldable exceptions", a lightweight mechanism to adapt a debugger's interface based on contextual information provided by a raised exception. We present, through a series of examples, how moldable exceptions can enhance a live programming environment.
Paper Structure (12 sections, 21 figures)

This paper contains 12 sections, 21 figures.

Figures (21)

  • Figure 1: A failing string comparison assertion.
  • Figure 2: A generic debugger view.
  • Figure 3: A string diff debugger view.
  • Figure 4: A classical "raw" view of a Ludo game.
  • Figure 5: An interactive GUI view of a Ludo game.
  • ...and 16 more figures