Author: wmb
Date: Mon Jan 23 18:56:19 2012
New Revision: 2846
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2846
Log:
x86 - debugger support for relative-addressed version.
Modified:
cpu/x86/debugm.fth
Modified: cpu/x86/debugm.fth
==============================================================================
--- cpu/x86/debugm.fth Mon Jan 23 18:56:16 2012 (r2845)
+++ cpu/x86/debugm.fth Mon Jan 23 18:56:19 2012 (r2846)
@@ -31,13 +31,17 @@
_flush_cache #) call
c;
-\ Change all the next routines in the indicated range to perform the
-\ in-line next routine
+\ Fix the NEXT routine in the user area to use the non-debug code.
code fast-next ( high low -- )
ax pop ax pop
_disable_cache #) call
- h# 9020ffad # ax mov \ ax lods 0 [ax] jmp nop
- ax 0 [up] mov
+
+\+ rel h# 8bf801ad # ax mov ax 0 [up] mov \ ax lods up w add
+\+ rel h# fffb0118 # ax mov ax 4 [up] mov \ 0 [w] bx mov up bx add
+\+ rel h# 909090e3 # ax mov ax 8 [up] mov \ bx jmp nop nop nop
+
+\- rel h# 9020ffad # ax mov ax 0 [up] mov \ ax lods 0 [w] jmp nop
+
_flush_cache #) call
c;
@@ -45,7 +49,8 @@
\ We have to expand the code for NEXT in-line here, because if
\ we let the assembler macro do it, we'll end up with a jump right back
\ to this routine
- ax lods 0 [ax] jmp
+\+ rel ax lods up w add 0 [w] bx mov up bx add bx jmp
+\- rel ax lods 0 [w] jmp
end-code
label debnext
@@ -62,26 +67,32 @@
ax 'user cnt mov
\ normal-next #) ax lea
make-even \ word-align address
- normal-next dup #) ax lea
- -4 allot token, \ relocate address
+\- rel normal-next dup #) ax lea
+\- rel -4 allot token, \ relocate address
+
+\+ rel normal-next origin - # ax mov
+\+ rel up ax add
ax 'user debug-next mov
+
'user 'debug w mov
- 0 [w] jmp
+\+ rel up w add 0 [w] bx mov up bx add bx jmp
+\- rel 0 [w] jmp
then
then
then
\ We have to expand the code for NEXT in-line here, because if
\ we let the assembler macro do it, we'll end up with a jump right back
\ to this routine
- ax lods 0 [ax] jmp \ Next
+\+ rel ax lods up w add 0 [w] bx mov up bx add bx jmp
+\- rel ax lods 0 [w] jmp \ Next
end-code
\ Fix the next routine to use the debug version
-: pnext (s -- ) debnext debug-next a! ;
+: pnext (s -- ) debnext debug-next ! ;
\ Turn off debugging
-: unbug (s -- ) normal-next debug-next a! ;
+: unbug (s -- ) normal-next debug-next ! ;
forth definitions
unbug
Author: wmb
Date: Mon Jan 23 18:56:03 2012
New Revision: 2842
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2842
Log:
Tags - added instructions in forth/lib/toctags for using the Forth tag files with EMACS
Modified:
forth/lib/toctags
Modified: forth/lib/toctags
==============================================================================
--- forth/lib/toctags Mon Jan 23 18:55:59 2012 (r2841)
+++ forth/lib/toctags Mon Jan 23 18:56:03 2012 (r2842)
@@ -16,3 +16,23 @@
sed -e "s,\${BP},${homedir}," $* | LC_ALL=C sort | uniq | cat tags.hdr - >tags
rm tags.hdr
+# To use the tags file from EMACS:
+# a) Get vtags.el per http://www.gnu.org/software/vtags/ and arrange for it to be loaded
+# b) If you use gforth.el, modify it as follows:
+#
+#--- gforth.el.orig 2012-01-18 23:04:28.420686187 -1000
+#+++ gforth.el 2012-01-18 23:05:20.560177102 -1000
+#@@ -1125,6 +1126,4 @@
+# (unless (or regexp-p next-p)
+#- (setq tagname (concat "\\(^\\|\\s-+\\)\\(" (regexp-quote tagname)
+#- "\\)\\s-*\x7f")))
+#- (switch-to-buffer
+#- (find-tag-noselect tagname next-p t)))
+#+ (setq tagname (concat tagname "\t")))
+#+ (find-tag tagname t))
+#
+# To tell EMACS which tags table to use,
+# M-x customize-variable tags-table-list
+# Then, if use gforth.el, you can use M-. from a Forth mode buffer to find a tag.
+# In any case, you can use M-t from anywhere to find a tag, but the matching won't
+# be as precise as with M-. -- you may have to select from a disambiguation list.