fcc
fcc copied to clipboard
Implement SEE
> see .
Decompiling .
Segmentation fault (core dumped)
$ ./forth
ok
> : t 1 . ;
ok
> see t
Decompiling t
Segmentation fault (core dumped)
Reproduced for 088d089104c08ee1f4d52d2716512f98d2394fc6 commit on Linux 64, fcc build with GCC 11.1.
I can reproduce. It "works" for native words, by saying you can't SEE
them. But it coredumps on Forth words.
There's a telling comment in the original C code:
// TODO: This is broken in the new style, but I'm ignoring it.
I'm no longer sure what I meant by that. Still investigating.
I think this is a change in the header format that wasn't properly reflected in see
; it's crashing trying to print the name of something nameless, I think.
I started on rewriting this in Forth rather than assembly.
The sticky part is teaching SEE
how to unpack "superinstructions". There are some hundred of these, and they all need unpacking for SEE
. Even in my trivial test example word : see-test 1 + ;
this came up. That word is actually compiled to
docol
super_dolit_plus_exit
1
so while this is possible in principle, it's a lot of effort.
I'm inclined to just drop SEE
support. Sorry :(
Feel free to reopen if that's not acceptable.