pharo icon indicating copy to clipboard operation
pharo copied to clipboard

integrating Debug Points model into Pharo

Open adri09070 opened this issue 1 year ago • 4 comments

This PR integrates a new tool to Pharo (at least the model) that will replace the existing breakpoints and watchpoints model. The original repository is here: https://github.com/adri09070/PharoDebugPoints (which is a fork of another repository).

This tool allows to install debug points on different type of targets:

  • an AST node, which can be targeted by selecting source code in the Calypso browser
  • a variable, which can be targeted by selecting a variable in the variable view in the Calypso browser
  • an object, in order to install object-centric debug points. In this case, an object target wraps another target (AST or variable)

Debug points are different types of instrumentation that are used to debug. For now, there are two concret types of debug points: breakpoints and watchpoints.

A debug point can have different types of behaviors that will execute before the debug point is actually hit.

Among these behaviors, there are:

  • Once behavior: the debug point becomes disabled after it is hit
  • Count behavior: counts the number of times the debug point is hit
  • Condition behavior: sets a condition that must evaluate to true to hit the debug point
  • Chain Link behavior: combines debug points into a chain. In that case, when a debug point is hit in the chain, it disables itself and enables the next debug point in the chain
  • Script behavior: executes a script each time a debug point is hit
  • Transcript behavior: logs a string to the Transcript each time a debug point is hit

All these behaviors can be set when creating a breakpoint from the Calypso browser in the method editor.

To have more flexibility to configure existing debug points or to create different types of debug points, it is possible to use an API on DebugPoint objects or via the DebugPointManager.

It will be possible to configure debug points via a UI tool, the Debug Point Browser, which will be the object of another PR in NewTools

adri09070 avatar Feb 15 '24 10:02 adri09070

There is a bootstrap error, I need to check

adri09070 avatar Feb 15 '24 15:02 adri09070

This is strange. Let us know if you need help.

Ducasse avatar Feb 15 '24 15:02 Ducasse

There is a bootstrap error, I need to check

Could you point us to the error? Because in the CI I only see Instance of MetacelloMCBaselineOfProjectSpec did not understand #requires:

hernanmd avatar Feb 15 '24 16:02 hernanmd

I learned something :) tx!

Ducasse avatar Feb 15 '24 19:02 Ducasse

This was merged with failing tests (the CI was down, all PRs where green because no tests where run)

MarcusDenker avatar Feb 26 '24 08:02 MarcusDenker