Skip to content

Exfiltrate deepcopy? #90

@jw3126

Description

@jw3126

Is it possible to exfiltrate a deep copy of locals? For instance, suppose I have the following function and I suspect that its state is
murky at iteration 1:

using Infiltrator

function f(x)
    out = []
    for i in x
        push!(out, 2i)
        if i == 1 
            @exfiltrate
        end
    end
end
f(1:10)
# Safehouse with 3 stored variables:
# - out::Vector{Any} = Any[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
# - i::Int64 = 1
# - x::UnitRange{Int64} = 1:10

Now out does not capture the state at iteration 1.

I am not proposing to change the default. I am just asking if there is/could be an option for deep copy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions