@@ -43,6 +43,8 @@ using StyledStrings: @styled_str
43
43
44
44
const nmeta = 4 # number of metadata fields per block (threadid, taskid, cpu_cycle_clock, thread_sleeping)
45
45
46
+ const slash = Sys. iswindows () ? " \\ " : " /"
47
+
46
48
# deprecated functions: use `getdict` instead
47
49
lookup (ip:: UInt ) = lookup (convert (Ptr{Cvoid}, ip))
48
50
@@ -537,7 +539,7 @@ function flatten(data::Vector, lidict::LineInfoDict)
537
539
end
538
540
539
541
const SRC_DIR = normpath (joinpath (Sys. BUILD_ROOT_PATH, " src" ))
540
- const COMPILER_DIR = " ././. ./usr/share/julia/Compiler/"
542
+ const COMPILER_DIR = " ../usr/share/julia/Compiler/"
541
543
542
544
# Take a file-system path and try to form a concise representation of it
543
545
# based on the package ecosystem
@@ -554,8 +556,8 @@ function short_path(spath::Symbol, filenamecache::Dict{Symbol, Tuple{String,Stri
554
556
elseif startswith (path_norm, lib_dir)
555
557
remainder = only (split (path_norm, lib_dir, keepempty= false ))
556
558
return (isfile (path_norm) ? path_norm : " " ), " @julialib" , remainder
557
- elseif startswith (path, COMPILER_DIR)
558
- remainder = only ( split (path, COMPILER_DIR, keepempty= false ))
559
+ elseif contains (path, COMPILER_DIR)
560
+ remainder = split (path, COMPILER_DIR, keepempty= false )[ end ]
559
561
possible_compiler_path = normpath (joinpath (Sys. BINDIR, Base. DATAROOTDIR, " julia" , " Compiler" , remainder))
560
562
return (isfile (possible_compiler_path) ? possible_compiler_path : " " ), " @Compiler" , remainder
561
563
elseif isabspath (path)
@@ -572,7 +574,7 @@ function short_path(spath::Symbol, filenamecache::Dict{Symbol, Tuple{String,Stri
572
574
project_file = joinpath (root, proj)
573
575
if Base. isfile_casesensitive (project_file)
574
576
pkgid = Base. project_file_name_uuid (project_file, " " )
575
- isempty (pkgid. name) && return path # bad Project file
577
+ isempty (pkgid. name) && return path, " " , path # bad Project file
576
578
# return the joined the module name prefix and path suffix
577
579
_short_path = path[nextind (path, sizeof (root)): end ]
578
580
return path, string (" @" , pkgid. name), _short_path
@@ -944,8 +946,8 @@ function print_flat(io::IO, lilist::Vector{StackFrame},
944
946
Base. printstyled (io, pkgname, color= pkgcolor)
945
947
file_trunc = ltruncate (file, max (1 , wfile))
946
948
wpad = wfile - textwidth (pkgname)
947
- if ! isempty (pkgname) && ! startswith (file_trunc, " / " )
948
- Base. print (io, " / " )
949
+ if ! isempty (pkgname) && ! startswith (file_trunc, slash )
950
+ Base. print (io, slash )
949
951
wpad -= 1
950
952
end
951
953
if isempty (path)
@@ -1048,8 +1050,8 @@ function tree_format(frames::Vector{<:StackFrameTree}, level::Int, cols::Int, ma
1048
1050
pkgcolor = get! (() -> popfirst! (Base. STACKTRACE_MODULECOLORS), PACKAGE_FIXEDCOLORS, pkgname)
1049
1051
remaining_path = ltruncate (filename, max (1 , widthfile - textwidth (pkgname) - 1 ))
1050
1052
linenum = li. line == - 1 ? " ?" : string (li. line)
1051
- slash = (! isempty (pkgname) && ! startswith (remaining_path, " / " )) ? " / " : " "
1052
- styled_path = styled " {$pkgcolor:$pkgname}$slash $remaining_path:$linenum"
1053
+ _slash = (! isempty (pkgname) && ! startswith (remaining_path, slash )) ? slash : " "
1054
+ styled_path = styled " {$pkgcolor:$pkgname}$(_slash) $remaining_path:$linenum"
1053
1055
rich_file = if isempty (path)
1054
1056
styled_path
1055
1057
else
0 commit comments