ideas icon indicating copy to clipboard operation
ideas copied to clipboard

A convenient tracer and post-mortem debugger for code

Open KOLANICH opened this issue 1 year ago • 1 comments

Project description

Imagine an axis of time, where in the left is past and in the right is future.

A programmer runs a program under an instrumentation. On each control point the instrumenting code saves the state of the software. I mean the state of each variable that is needed to be traced. It'd require compiler/runtime assistance.

Only the needed modules and functions are instrumented.

The trace is delta-compressed and saved.

Then the programmer opens a trace in a plugin for a text editor/IDE (Kate, Qt Creator, Notepad++, VisualStudio). The IDE draws execution of code as a wire with markers on it.

For each marker a programmed can click on it and inspect program state as if he is debugging it.

There are sets of markers. Each set is either composed manually, or via a predicate. To add markers into a set programmatically the programmer writes a predicate in Python, that is evaluated by the plugin against each marker. The sets can be memoized into the on-disk file.

The IDE plugin has GUI to deal with sets. Each set must have a name and a few feature checkboxss.

  • visible - if the checkbox is not set, all markers within the set are hidden and the wire connecting them is "simplified" making it less detailed, and so creating less visual garbage
  • important - IDE GUI gets a pair of back-forward buttons for this set. Clicking the button allows to go to the next/previous node of that set quickly

The predicate API should allow introspecting the state, at least the following features should be available:

  • source file, line, column
  • currently executed expression path
  • currently execeted functiin name
  • mapping of variables within the scope to their types
  • changed variables relative to the previous state

The core dealing wuth the file formats, delta-compression and providing the framework to deal with the sets should be contained within a shared lib. Bindings to programming languages to write predicates should be contained within own shared libs. A yet another shared lib for GUI framework core. And a bunch of shared libs for editors used as plugins.

For instrumenting a plugin for a compiler or a library for interpreted language is needed. It uses the core library to collect traces.

Relevant Technology

Complexity and required time

Complexity

  • [x] Advanced - The project requires the user to have a good understanding of all components of the project to contribute

Required time (ETA)

  • [x] Much work - The project will take more than a couple of weeks and serious planning is required

Categories

  • [x] Developer Tooling
  • [x] Extension/Plugin/Add-On

KOLANICH avatar Dec 06 '22 15:12 KOLANICH