added system.getStackTrace; docgen refactoring (incomplete)

This commit is contained in:
Araq 2012-05-06 01:16:36 +02:00
commit c323ec0155
13 changed files with 744 additions and 509 deletions

View file

@ -1897,6 +1897,9 @@ when not defined(EcmaScript) and not defined(NimrodVM):
proc writeStackTrace*()
## writes the current stack trace to ``stderr``. This is only works
## for debug builds.
proc getStackTrace*(): string
## gets the current stack trace. This is only works for debug builds.
{.push stack_trace: off.}
when hostCPU == "avr":

View file

@ -246,6 +246,13 @@ proc WriteStackTrace() =
else:
writeToStdErr("No stack traceback available\n")
proc getStackTrace(): string =
when hasSomeStackTrace:
result = ""
rawWriteStackTrace(result)
else:
result = "No stack traceback available\n"
when defined(endb):
var
dbgAborting: bool # whether the debugger wants to abort