Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make DebugInfo edges per-call rather than per-callee #56305

Closed

Commits on Oct 23, 2024

  1. Make DebugInfo edges per-call rather than per-callee

    This is useful for when you need to, e.g., trim the "common prefix" of
    two stacktraces that were both taken from inside an inlined function
    call.
    
    I'm hoping to use this property to provide a way to get only the
    "popped" frames inside a `catch` handler, but that requires us to
    understand when an inlined frame was popped, as in:
    ```julia
    @inline function foo()
        try
            error("foo")
        catch err
            Base.showerror(stderr, err, Base.catch_backtrace())
        end
    end
    bar() = foo()
    ```
    
    The popped frames would be:
    ```julia
    Stacktrace:
     [1] error(s::String)
       @ Base ./error.jl:44
     [2] foo
       @ ./REPL[1]:3 [inlined]
    ```
    
    To know to trim off `bar()` (since it hasn't been popped yet), I want
    to record the ip at catch entry and then have our stacktrace expansion
    logic remove any frames common with the catch entry.
    
    In order to trim that common prefix correctly, we need to distinguish
    this case from:
    ```
    try foo() catch foo() end
    ```
    which has the same line number and callee, but is a different call.
    topolarity committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    dcdf135 View commit details
    Browse the repository at this point in the history