Remove no longer needed record-locs.fs

parent 4f678891
Pipeline #794 passed with stage
in 8 minutes and 4 seconds
......@@ -91,12 +91,6 @@ is defer-default
\ print backtrace location
: addr>view ( addr -- view / 0 )
dup cell- locs-start here within locs-start and ?dup-IF
over cell- swap - cell/ locs[] $[] @
?dup-IF nip EXIT THEN
THEN drop 0 ;
: .sourceview-width ( view -- u )
\ prints sourceview, returns width of printed string
['] .sourceview $tmp 2dup type x-width ;
......
......@@ -274,11 +274,14 @@ variable dict-execute-dp \ the special dp for DICT-EXECUTE
\ execute xt with HERE set to addr1 and USABLE-DICTIONARY-END set to addr2
dict-execute-dp @ dp 2>r
dict-execute-ude ['] usable-dictionary-end defer@ 2>r
['] xt-location defer@ >r
swap to dict-execute-ude
['] dict-execute-ude is usable-dictionary-end
swap dict-execute-dp !
dict-execute-dp dpp !
['] noop is xt-location
catch
r> is xt-location
2r> is usable-dictionary-end to dict-execute-ude
2r> dpp ! dict-execute-dp !
throw ;
......
......@@ -153,7 +153,8 @@ Defer check-shadow ( addr u wid -- )
view,
dup here + dup maxaligned >align
nlstring,
r> 1 or A, 0 A, here last ! \ link field; before revealing, it contains the
r> 1 or A, here xt-location drop 0 A, here last !
\ link field; before revealing, it contains the
\ tagged reveal-into wordlist
\ alias-mask lastflags cset
[ [IFDEF] prelude-mask ]
......@@ -279,10 +280,18 @@ is basic-block-end
0 AValue locs-start
$variable locs[]
: xt-location ( addr -- addr )
Defer xt-location
: xt-location1 ( addr -- addr )
\ note that an xt was compiled at addr, for backtrace-locate functionality
dup locs-start - cell/ >r
current-sourceview dup r> 1+ locs[] $[] cell- 2! ;
' xt-location1 is xt-location
: addr>view ( addr -- view / 0 )
dup cell- locs-start here within locs-start and ?dup-IF
over cell- swap - cell/ locs[] $[] @
?dup-IF nip EXIT THEN
THEN drop 0 ;
has? primcentric [IF]
has? peephole [IF]
......
\ locate position in backtrace
\ Copyright (C) 2017 Free Software Foundation, Inc.
\ This file is part of Gforth.
\ Gforth is free software; you can redistribute it and/or
\ modify it under the terms of the GNU General Public License
\ as published by the Free Software Foundation, either version 3
\ of the License, or (at your option) any later version.
\ This program is distributed in the hope that it will be useful,
\ but WITHOUT ANY WARRANTY; without even the implied warranty of
\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\ GNU General Public License for more details.
\ You should have received a copy of the GNU General Public License
\ along with this program. If not, see http://www.gnu.org/licenses/.
require string.fs
: record-locs ( -- )
\G record locations to annotate backtraces with source locations
here to locs-start locs[] $free
['] xt-location1 is xt-location ;
locs[] $saved
record-locs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment