jcs's openbsd hax
openbsd
1# $OpenBSD: gdb.script,v 1.3 2001/01/29 01:58:38 niklas Exp $
2
3# @(#)gdb.script 8.5 (Berkeley) 5/4/96
4
5# display the VI screen map
6# usage dmap(sp)
7define dmap
8 set $h = ((VI_PRIVATE *)$arg0->vi_private)->h_smap
9 set $t = ((VI_PRIVATE *)$arg0->vi_private)->t_smap
10 while ($h <= $t)
11 printf "lno: %2d; soff %d coff %d ", \
12 (int)$h->lno, (int)$h->soff, (int)$h->coff
13 if ($h->c_ecsize == 0)
14 printf "flushed\n"
15 else
16 printf "\n\tsboff %d; scoff %d\n", \
17 (int)$h->c_sboff, (int)$h->c_scoff
18 printf "\teboff %d; eclen %d; ecsize %d\n", \
19 (int)$h->c_eboff, (int)$h->c_eclen, \
20 (int)$h->c_ecsize
21 end
22 set $h = $h + 1
23 end
24end
25
26# display the tail of the VI screen map
27define tmap
28 set $h = ((VI_PRIVATE *)$arg0->vi_private)->h_smap
29 set $t = ((VI_PRIVATE *)$arg0->vi_private)->t_smap
30 while ($t >= $h)
31 printf "lno: %2d; soff %d coff %d ", \
32 (int)$t->lno, (int)$t->soff, (int)$t->coff
33 if ($t->c_ecsize == 0)
34 printf "flushed\n"
35 else
36 printf "\n\tsboff %d; scoff %d\n", \
37 (int)$t->c_sboff, (int)$t->c_scoff
38 printf "\teboff %d; eclen %d; ecsize %d\n", \
39 (int)$t->c_eboff, (int)$t->c_eclen, \
40 (int)$t->c_ecsize
41 end
42 set $t = $t - 1
43 end
44end
45
46# display the private structures
47define clp
48 print *((CL_PRIVATE *)sp->gp->cl_private)
49end
50define vip
51 print *((VI_PRIVATE *)sp->vi_private)
52end
53define exp
54 print *((EX_PRIVATE *)sp->ex_private)
55end
56
57# display the marks
58define markp
59 set $h = sp->ep->marks.next
60 set $t = &sp->ep->marks
61 while ($h != 0 && $h != $t)
62 printf "key %c lno: %d cno: %d flags: %x\n", \
63 ((MARK *)$h)->name, ((MARK *)$h)->lno, \
64 ((MARK *)$h)->cno, ((MARK *)$h)->flags
65 set $h = ((MARK *)$h)->next
66 end
67end
68
69# display the tags
70define tagp
71 set $h = sp->taghdr.next
72 set $t = &sp->taghdr
73 while ($h != 0 && $h != $t)
74 printf "tag: %s lno %d cno %d\n", ((TAG *)$h)->frp->fname, \
75 ((TAG *)$h)->lno, ((TAG *)$h)->cno
76 set $h= ((TAG *)$h)->next
77 end
78end