diff options
author | Araq <rumpf_a@web.de> | 2011-01-18 02:22:01 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-01-18 02:22:01 +0100 |
commit | 66cfc851a1aeb9eb8d011a8e0c53b0f8ee83f770 (patch) | |
tree | 197c0b859516210ab9d32e8da958ed05a03bbe3f /lib/system/excpt.nim | |
parent | 0f743e01833290e2995756fbd459728b12d833be (diff) | |
download | Nim-66cfc851a1aeb9eb8d011a8e0c53b0f8ee83f770.tar.gz |
basic thread support; still broken on Windows; untested on Mac OS X
Diffstat (limited to 'lib/system/excpt.nim')
-rwxr-xr-x | lib/system/excpt.nim | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 9beeb659e..4e8982691 100755 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -1,7 +1,7 @@ # # # Nimrod's Runtime Library -# (c) Copyright 2010 Andreas Rumpf +# (c) Copyright 2011 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -40,10 +40,10 @@ type context: C_JmpBuf var - excHandler {.compilerproc.}: PSafePoint = nil + excHandler {.threadvar, compilerproc.}: PSafePoint = nil # list of exception handlers # a global variable for the root of all try blocks - currException: ref E_Base + currException {.threadvar.}: ref E_Base proc pushSafePoint(s: PSafePoint) {.compilerRtl, inl.} = s.prev = excHandler @@ -107,23 +107,11 @@ when nativeStacktrace: # interested in enabled = true -type - PFrame = ptr TFrame - TFrame {.importc, nodecl, final.} = object - prev: PFrame - procname: CString - line: int # current line number - filename: CString - len: int # length of slots (when not debugging always zero) - var buf: string # cannot be allocated on the stack! assertBuf: string # we need a different buffer for # assert, as it raises an exception and # exception handler needs the buffer too - - framePtr {.exportc.}: PFrame - tempFrames: array [0..127, PFrame] # cannot be allocated on the stack! proc auxWriteStackTrace(f: PFrame, s: var string) = |