From 1fae66e4df8cc43b4ec8ab97fff96282ef234f2e Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 22 Sep 2020 13:03:24 +0200 Subject: better nativestacktrace support; refs #15284; backport [1.2] (#15384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * nimStackTraceOverride: enable stack traces in exceptions This is a two-step stack trace collection scheme, because re-raised exceptions will collect multiple stack traces but use them rarely, when printing info about an uncaught exception, so it makes sense to only do the cheap stack unwinding all the time and the relatively expensive debugging information collection on-demand. `asyncfutures` implements its own `$` proc for printing `seq[StackTraceEntry]`, so we have to add the debugging info there, just like we do for the private `$` proc in `system/excpt`. * cleaned up PR #15284 Co-authored-by: Ștefan Talpalaru --- lib/system.nim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/system.nim') diff --git a/lib/system.nim b/lib/system.nim index 362b5b2b9..eefa84565 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1383,6 +1383,12 @@ type # these work for most platforms: culonglong* {.importc: "unsigned long long", nodecl.} = uint64 ## This is the same as the type ``unsigned long long`` in *C*. + # There is a disparity on macOS where Nim's `uint` is `unsigned long long` and + # `uintptr_t` is `unsigned long`. Even though both data types are the same + # size (64 bits), clang++ refuses to do automatic conversion between them. + cuintptr_t* {.importc: "uintptr_t", nodecl.} = uint + ## This is the same as the type ``uintptr_t`` in *C*. + cstringArray* {.importc: "char**", nodecl.} = ptr UncheckedArray[cstring] ## This is binary compatible to the type ``char**`` in *C*. The array's ## high value is large enough to disable bounds checking in practice. -- cgit 1.4.1-2-gfad0