Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Backtrace/Backtrace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ typealias CBacktraceFullCallback = @convention(c) (_ data: UnsafeMutableRawPoint
typealias CBacktraceSimpleCallback = @convention(c) (_ data: UnsafeMutableRawPointer?, _ pc: UInt) -> CInt
typealias CBacktraceSyminfoCallback = @convention(c) (_ data: UnsafeMutableRawPointer?, _ pc: UInt, _ filename: UnsafePointer<CChar>?, _ symval: UInt, _ symsize: UInt) -> Void

private let state = backtrace_create_state(CommandLine.arguments[0], /* BACKTRACE_SUPPORTS_THREADS */ 1, nil, nil)
private let state = backtrace_create_state(nil, /* BACKTRACE_SUPPORTS_THREADS */ 1, nil, nil)

private let fullCallback: CBacktraceFullCallback? = {
_, pc, filename, lineno, function in
Expand Down
6 changes: 3 additions & 3 deletions Sources/CBacktrace/fileline.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ fileline_initialize (struct backtrace_state *state,
filename = state->filename;
break;
case 1:
filename = getexecname ();
filename = "/proc/self/exe";
break;
case 2:
filename = "/proc/self/exe";
filename = "/proc/curproc/file";
break;
case 3:
filename = "/proc/curproc/file";
filename = getexecname ();
break;
case 4:
snprintf (buf, sizeof (buf), "/proc/%ld/object/a.out",
Expand Down