The Wayback Machine - https://web.archive.org/web/20220326213105/https://github.com/JuliaDebug/Debugger.jl/pull/147
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

WIP: show a nice stacktrace when breaking on error #147

Merged
merged 1 commit into from Mar 29, 2019

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Mar 25, 2019

Need to figure out how to deal with the absolute paths in the stacktrace when breaking on error. There isn't really a nice way to change this.

Fixes #145

@KristofferC
Copy link
Member Author

@KristofferC KristofferC commented Mar 25, 2019

With JuliaDebug/JuliaInterpreter.jl#214 (the point is the stacktraces):

julia> f() = "αβ"[2]
f (generic function with 1 method)

julia> @enter f()
In f() at REPL[8]:1
>1  f() = "αβ"[2]

About to run: (getindex)("αβ", 2)
1|debug> c
ERROR: StringIndexError("αβ", 2)
Stacktrace:
 [1] string_index_err(::String, ::Int64) at strings/string.jl:12
 [2] getindex_continued(::String, ::Int64, ::UInt32) at strings/string.jl:218
 [3] getindex(::String, ::Int64) at strings/string.jl:211
 [4] f() at REPL[8]:1

julia> @run f()
ERROR: StringIndexError("αβ", 2)
Stacktrace:
 [1] string_index_err(::String, ::Int64) at strings/string.jl:12
 [2] getindex_continued(::String, ::Int64, ::UInt32) at strings/string.jl:218
 [3] getindex(::String, ::Int64) at strings/string.jl:211
 [4] f() at REPL[8]:1

julia> break_on(:error)

julia> @enter f()
In f() at REPL[8]:1
>1  f() = "αβ"[2]

About to run: (getindex)("αβ", 2)
1|debug> c
Breaking for error:
ERROR: StringIndexError("αβ", 2)
Stacktrace:
 [1] string_index_err(::String, ::Int64) at strings/string.jl:12
 [2] getindex_continued(::String, ::Int64, ::UInt32) at strings/string.jl:218
 [3] getindex(::String, ::Int64) at strings/string.jl:211
 [4] f() at REPL[8]:1

In string_index_err(s, i) at strings/string.jl:12
>12  @noinline string_index_err(s::AbstractString, i::Integer) =

About to run: (throw)(StringIndexError("αβ", 2))
1|debug> 
@codecov-io
Copy link

@codecov-io codecov-io commented Mar 28, 2019 •

Codecov Report

Merging #147 into master will decrease coverage by 33.61%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #147       +/-   ##
===========================================
- Coverage   80.59%   46.97%   -33.62%     
===========================================
  Files           7        7               
  Lines         474      447       -27     
===========================================
- Hits          382      210      -172     
- Misses         92      237      +145
Impacted Files Coverage Δ
src/repl.jl 13% <0%> (-64.05%) ⬇️
src/commands.jl 32% <0%> (-35.65%) ⬇️
src/printing.jl 66.92% <0%> (-22.27%) ⬇️
src/Debugger.jl 80% <0%> (-10.91%) ⬇️
src/watch.jl 75% <0%> (-7.15%) ⬇️
src/locationinfo.jl 78.94% <0%> (-3.98%) ⬇️
src/LineNumbers.jl 100% <0%> (+9.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8720a9...c97677c. Read the comment docs.

@KristofferC KristofferC merged commit d9b2922 into master Mar 29, 2019
1 check passed
@KristofferC KristofferC deleted the kc/backtrace_error branch Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants