NetBSD/usr.bin/vi/docs/internals/gdb.script

77 lines
1.9 KiB
Plaintext
Raw Normal View History

1996-05-20 06:01:36 +04:00
# @(#)gdb.script 8.5 (Berkeley) 5/4/96
1994-03-28 06:52:06 +04:00
1996-05-20 06:01:36 +04:00
# display the VI screen map
1994-03-28 06:52:06 +04:00
# usage dmap(sp)
define dmap
1996-05-20 06:01:36 +04:00
set $h = ((VI_PRIVATE *)$arg0->vi_private)->h_smap
set $t = ((VI_PRIVATE *)$arg0->vi_private)->t_smap
1994-03-28 06:52:06 +04:00
while ($h <= $t)
1996-05-20 06:01:36 +04:00
printf "lno: %2d; soff %d coff %d ", \
(int)$h->lno, (int)$h->soff, (int)$h->coff
1994-03-28 06:52:06 +04:00
if ($h->c_ecsize == 0)
printf "flushed\n"
else
printf "\n\tsboff %d; scoff %d\n", \
(int)$h->c_sboff, (int)$h->c_scoff
printf "\teboff %d; eclen %d; ecsize %d\n", \
(int)$h->c_eboff, (int)$h->c_eclen, \
(int)$h->c_ecsize
end
set $h = $h + 1
end
end
1996-05-20 06:01:36 +04:00
# display the tail of the VI screen map
1994-03-28 06:52:06 +04:00
define tmap
1996-05-20 06:01:36 +04:00
set $h = ((VI_PRIVATE *)$arg0->vi_private)->h_smap
set $t = ((VI_PRIVATE *)$arg0->vi_private)->t_smap
1994-03-28 06:52:06 +04:00
while ($t >= $h)
1996-05-20 06:01:36 +04:00
printf "lno: %2d; soff %d coff %d ", \
(int)$t->lno, (int)$t->soff, (int)$t->coff
1994-03-28 06:52:06 +04:00
if ($t->c_ecsize == 0)
printf "flushed\n"
else
printf "\n\tsboff %d; scoff %d\n", \
(int)$t->c_sboff, (int)$t->c_scoff
printf "\teboff %d; eclen %d; ecsize %d\n", \
(int)$t->c_eboff, (int)$t->c_eclen, \
(int)$t->c_ecsize
end
set $t = $t - 1
end
end
1994-08-17 20:17:19 +04:00
# display the private structures
1996-05-20 06:01:36 +04:00
define clp
print *((CL_PRIVATE *)sp->gp->cl_private)
end
1994-08-17 20:17:19 +04:00
define vip
print *((VI_PRIVATE *)sp->vi_private)
end
define exp
print *((EX_PRIVATE *)sp->ex_private)
end
1994-03-28 06:52:06 +04:00
# display the marks
define markp
set $h = sp->ep->marks.next
set $t = &sp->ep->marks
while ($h != 0 && $h != $t)
printf "key %c lno: %d cno: %d flags: %x\n", \
((MARK *)$h)->name, ((MARK *)$h)->lno, \
((MARK *)$h)->cno, ((MARK *)$h)->flags
set $h = ((MARK *)$h)->next
end
end
# display the tags
define tagp
set $h = sp->taghdr.next
set $t = &sp->taghdr
while ($h != 0 && $h != $t)
printf "tag: %s lno %d cno %d\n", ((TAG *)$h)->frp->fname, \
((TAG *)$h)->lno, ((TAG *)$h)->cno
set $h= ((TAG *)$h)->next
end
end