mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
finish the stacktraces.nim implementation [backport:1.2] (#15393)
This commit is contained in:
@@ -120,3 +120,4 @@ proc initDefines*(symbols: StringTableRef) =
|
||||
defineSymbol("nimDoesntTrackDefects")
|
||||
defineSymbol("nimHasLentIterators")
|
||||
defineSymbol("nimHasDeclaredMagic")
|
||||
defineSymbol("nimHasStacktracesModule")
|
||||
|
||||
@@ -22,26 +22,26 @@ when defined(nimStackTraceOverride):
|
||||
## This is the same as the type ``uintptr_t`` in C.
|
||||
|
||||
StackTraceOverrideGetTracebackProc* = proc (): string {.
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [].}
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.}
|
||||
StackTraceOverrideGetProgramCountersProc* = proc (maxLength: cint): seq[cuintptr_t] {.
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [].}
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.}
|
||||
StackTraceOverrideGetDebuggingInfoProc* =
|
||||
proc (programCounters: seq[cuintptr_t], maxLength: cint): seq[StackTraceEntry] {.
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [].}
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.}
|
||||
|
||||
# Default procedures (not normally used, because people opting in on this
|
||||
# override are supposed to register their own versions).
|
||||
var
|
||||
stackTraceOverrideGetTraceback: StackTraceOverrideGetTracebackProc =
|
||||
proc (): string {.nimcall, gcsafe, locks: 0, raises: [], tags: [].} =
|
||||
proc (): string {.nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.} =
|
||||
discard
|
||||
#result = "Stack trace override procedure not registered.\n"
|
||||
stackTraceOverrideGetProgramCounters: StackTraceOverrideGetProgramCountersProc =
|
||||
proc (maxLength: cint): seq[cuintptr_t] {.nimcall, gcsafe, locks: 0, raises: [], tags: [].} =
|
||||
proc (maxLength: cint): seq[cuintptr_t] {.nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.} =
|
||||
discard
|
||||
stackTraceOverrideGetDebuggingInfo: StackTraceOverrideGetDebuggingInfoProc =
|
||||
proc (programCounters: seq[cuintptr_t], maxLength: cint): seq[StackTraceEntry] {.
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [].} =
|
||||
nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.} =
|
||||
discard
|
||||
|
||||
# Custom procedure registration.
|
||||
|
||||
Reference in New Issue
Block a user