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

Exfiltrate deepcopy? #90

Open
jw3126 opened this issue Oct 20, 2022 · 1 comment
Open

Exfiltrate deepcopy? #90

jw3126 opened this issue Oct 20, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@jw3126
Copy link

jw3126 commented Oct 20, 2022

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.

@pfitzseb
Copy link
Member

@exfiltrate deep=true or something similar seems like a good idea to me. Presumably this isn't particularly useful in the infil> REPL because you can just manually deepcopy whatever you want to exfiltrate.

@pfitzseb pfitzseb added the enhancement New feature or request label Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants