Skip to content

Commit

Permalink
Merge pull request #110 from JuliaDebug/sp/fix-help-printing
Browse files Browse the repository at this point in the history
fix: print help command's last line
  • Loading branch information
pfitzseb authored Feb 12, 2024
2 parents 76a53a2 + ae288ab commit 4fcad5f
Show file tree
Hide file tree
Showing 30 changed files with 3,428 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- '1.7'
- '1.8'
- '1.9'
- '1.10'
os:
- ubuntu-latest
arch:
Expand Down
4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b"

[compat]
Documenter = "1"
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cp(joinpath(@__DIR__, "..", "README.md"), joinpath(@__DIR__, "src", "index.md");

makedocs(;
modules=[Infiltrator],
warnonly = [:missing_docs, :linkcheck],
format=Documenter.HTML(
prettyurls = get(ENV, "CI", nothing) == "true",
assets = ["assets/favicon.ico"],
Expand Down
10 changes: 10 additions & 0 deletions src/Infiltrator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ The following commands are special cased:

function show_help(io)
show(io, MIME("text/plain"), HELP_TEXT)
println(io, '\n')
end

function strlimit(str, limit = 30)
Expand All @@ -359,6 +360,10 @@ function strlimit(str, limit = 30)
end

function show_locals(io, locals, selected::AbstractSet = Set())
if isempty(locals)
println(io, "No local variables in this scope.\n")
return
end
for (var, val) in locals
if isempty(selected) || var in selected
one_line_show(io, var, val)
Expand Down Expand Up @@ -616,6 +621,11 @@ function get_module_names(m::Module, get_names = all_names)
end

function print_verbose_stacktrace(io, st, limit = 100)
if isempty(st)
println(io, "Toplevel scope\n")
return
end

len = length(st)
for (i, sf) in enumerate(st)
if i > limit
Expand Down
42 changes: 42 additions & 0 deletions test/outputs/Julia_anon_1.10.multiout
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>
|
|infil> aasdf
|3
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBCCCCC
|C
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>
|
|infil> aasdf
|3
|
|infil> @exfiltrate aasdf
|Exfiltrating 1 local variable into the safehouse.
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBCCCCC
|C
|
|BBBBBBBCCCCCCCCCCCCCCCCC
|CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBB
42 changes: 42 additions & 0 deletions test/outputs/Julia_compiler_1.10.multiout
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>
|
|infil> x
|:(%3)
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBC
|CCCCC
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>
|
|infil> x
|:(%3)
|
|infil> @exfiltrate
|Exfiltrating 1 local variable into the safehouse.
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBC
|CCCCC
|
|BBBBBBBCCCCCCCCCCC
|CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBB
Loading

0 comments on commit 4fcad5f

Please sign in to comment.