Skip to content

Debugger : Step In / Step Out on nested function call #2760

@jbdoderlein

Description

@jbdoderlein

In the current debugger implementation, all Expression are only breakable if they are Statement. In the case of nested function call, the step out function skip all other nested function.

For instance :

void a() {
    int x = foo(bar1(), bar2());
    println("<x>");
}

int bar1() {
    return 1;
}

int bar2() {
    return 2;
}

int foo(int x, int y) {
    return x + y;
}

Here is a video of current interaction with step in on the first line of a and step out from bar1 :

currentstepinout.mp4

The code of bar2 and foo is skipped.

Here is the behavior of Java (or Python) debugger :

javastepinout.mp4

Making all expression breakable would make the step-in request unusable, but making some Expression breakable (like CallOrTree) partially solve the problem.
Here is the behavior with org.rascalmpl.ast.Expression.CallOrTree breakable :

withbreakcallortree.mp4

The step out from bar2 still does not allow to step in foo. One other downside is that since Expression that are Statement are breakable, step in on a function call trigger one additional suspension before entering the function.
Is it ok or is there other expression that could benefit to be breakable ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions