Skip to content

Commit 6ed9413

Browse files
committed
print debuginfo for IR fully
1 parent c26954e commit 6ed9413

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

base/reflection.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,8 @@ end
940940
Returns an array of type-inferred lowered form (IR) for the methods matching the given
941941
generic function and type signature. The keyword argument `optimize` controls whether
942942
additional optimizations, such as inlining, are also applied.
943-
The keyword debuginfo controls the amount of code metadata present in the output.
943+
The keyword `debuginfo` controls the amount of code metadata present in the output,
944+
possible options are `:source` or `:none`.
944945
"""
945946
function code_typed(@nospecialize(f), @nospecialize(types=Tuple);
946947
optimize=true, debuginfo::Symbol=:default,

base/show.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,8 @@ module IRShow
15721572
# :oneliner => src -> Base.IRShow.PartialLineInfoPrinter(src.linetable),
15731573
:none => src -> Base.IRShow.lineinfo_disabled,
15741574
)
1575-
debuginfo[:default] = debuginfo[:none]
1575+
# setting debuginfo[:default] = debuginfo[:none] will disable debuginfo printing globally
1576+
debuginfo[:default] = debuginfo[:source]
15761577
end
15771578

15781579
function show(io::IO, src::CodeInfo; debuginfo::Symbol=:default)

src/disasm.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ static void jl_dump_asm_internal(
859859
DILineInfoTable::iterator di_lineIter = di_lineinfo.begin();
860860
DILineInfoTable::iterator di_lineEnd = di_lineinfo.end();
861861
DILineInfoPrinter dbgctx{"; ", true};
862+
dbgctx.SetVerbosity(debuginfo);
862863
if (pass != 0) {
863864
if (di_ctx && di_lineIter != di_lineEnd) {
864865
// Set up the line info

0 commit comments

Comments
 (0)