diff options
author | Tristan Gingold <gingold@adacore.com> | 2015-11-22 19:02:05 +0100 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2015-11-22 19:02:05 +0100 |
commit | 27a4852201a41e7d6f8098cc05b7b0949ebc6af4 (patch) | |
tree | 91e6effe2be75fedb2e39e2eb374975c5666f206 /src/grt/grt-backtraces.adb | |
parent | 92b0b82ea32982b94eb8bf19a0b498d92053fffe (diff) | |
download | ghdl-27a4852201a41e7d6f8098cc05b7b0949ebc6af4.tar.gz ghdl-27a4852201a41e7d6f8098cc05b7b0949ebc6af4.tar.bz2 ghdl-27a4852201a41e7d6f8098cc05b7b0949ebc6af4.zip |
backtrace: add support for windows and for llvm (via libbacktrace).
Diffstat (limited to 'src/grt/grt-backtraces.adb')
-rw-r--r-- | src/grt/grt-backtraces.adb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/grt/grt-backtraces.adb b/src/grt/grt-backtraces.adb index 8b779a7d8..d365adacb 100644 --- a/src/grt/grt-backtraces.adb +++ b/src/grt/grt-backtraces.adb @@ -26,6 +26,7 @@ with System; with Grt.Types; use Grt.Types; with Grt.Hooks; use Grt.Hooks; +with Grt.Backtraces.Impl; package body Grt.Backtraces is -- If true, disp address in backtraces. @@ -162,7 +163,6 @@ package body Grt.Backtraces is begin if Bt.Size = 0 or else Bt.Skip >= Bt.Size - or else Symbolizer = null then -- No backtrace or no symbolizer. return; @@ -170,15 +170,21 @@ package body Grt.Backtraces is Unknown := False; for I in Bt.Skip .. Bt.Size loop - Symbolizer.all (To_Address (Bt.Addrs (I)), - Filename, Lineno, Subprg); + Backtraces.Impl.Symbolizer (To_Address (Bt.Addrs (I)), + Filename, Lineno, Subprg); if Subprg = Null_Address and (Filename = Null_Address or Lineno = 0) then Unknown := True; + elsif Subprg /= Null_Address + and then To_Ghdl_C_String (Subprg) (1 .. 5) = "grt__" + then + -- In the runtime. Stop now. + exit; else if Unknown then Put_Err (" from: [unknown caller]"); + Newline_Err; Unknown := False; end if; Put_Err (" from:"); |