Annotation of OpenXM/src/asir-doc/parts/debug.texi, Revision 1.1.1.1
1.1 noro 1: @node $B%G%P%C%,(B,,, Top
2: @chapter $B%G%P%C%,(B
3:
4: @menu
5: * $B%G%P%C%,$H$O(B::
6: * $B%3%^%s%I$N2r@b(B::
7: * $B%G%P%C%,$N;HMQNc(B::
8: * $B%G%P%C%,$N=i4|2=%U%!%$%k$NNc(B::
9: @end menu
10:
11: @node $B%G%P%C%,$H$O(B,,, $B%G%P%C%,(B
12: @section $B%G%P%C%,$H$O(B
13:
14: @noindent
15: C $B8@8l$G=q$+$l$?%W%m%0%i%`$N$?$a$N%G%P%C%,(B @code{dbx}
16: $B$O(B, $B%=!<%9%l%Y%k$G$N%V%l!<%/%]%$%s%H$N@_Dj(B, $B%9%F%C(B
17: $B%W<B9T(B, $BJQ?t$N;2>H$J$I$,2DG=$J6/NO$J%G%P%C%,$G$"$k(B. @b{Asir} $B$G$O(B,
18: @code{dbx} $BIw$N%G%P%C%,$rMQ0U$7$F$$$k(B. $B%G%P%C%0%b!<%I$KF~$k$K$O(B, $B%H%C(B
19: $B%W%l%Y%k$G(B @code{debug;} $B$HF~NO$9$k(B.
20: @example
21: [10] debug;
22: (debug)
23: @end example
24:
25: @noindent
26: $B$=$NB>(B, $B<!$NJ}K!(B, $B$"$k$$$O>u67$G%G%P%C%0%b!<%I$KF~$k(B.
27:
28: @itemize @bullet
29: @item
30: $B<B9TCf%V%l!<%/%]%$%s%H$KC#$7$?>l9g(B
31:
32: @item
33: $B3d$j9~$_$G(B @samp{d} $B$rA*Br$7$?>l9g(B
34:
35: @item
36: $B<B9TCf%(%i!<$r5/$3$7$?>l9g(B
37:
38: $B$3$N>l9g(B, $B<B9T$N7QB3$OIT2DG=$G$"$k$,(B, $BD>@\$N%(%i!<$N860x$H$J$C$?(B
39: $B%f!<%6Dj5AH!?t$NJ8$rI=<($7$F%G%P%C%0%b!<%I$KF~$k$?$a(B, $B%(%i!<;~(B
40: $B$K$*$1$kJQ?t$NCM$r;2>H$G$-(B, $B%G%P%C%0$KLrN)$?$;$k$3$H$,$G$-$k(B.
41:
42: @item
43: @code{error()} $B$,8F$S=P$5$l$?>l9g(B
44: @end itemize
45:
46: @node $B%3%^%s%I$N2r@b(B,,, $B%G%P%C%,(B
47: @section $B%3%^%s%I$N2r@b(B
48:
49: @noindent
50: $B%3%^%s%I$O(B @code{dbx} $B$N%3%^%s%I$NFbI,MW:G>.8B$N$b$N$r:NMQ$7$?(B.
51: $B99$K(B, @code{gdb} $B$N%3%^%s%I$+$i$b$$$/$D$+JXMx$J$b$N$r:NMQ$7$?(B.
52: $B<B:]$N5!G=$O(B @code{dbx} $B$H$[$\F1MM$G$"$k$,(B, @code{step}, @code{next} $B$O(B,
53: $B<!$N9T$G$O$J$/<!$NJ8$r<B9T$9$k(B.
54: $B=>$C$F(B, 1$B9T$KJ#?t$NJ8$,$"$k>l9g$O(B, $B$=$NJ8$N?t$@$1(B @code{next}
55: $B$r<B9T$7$J$1$l$P<!$N9T$K?J$a$J$$(B. $B$^$?(B, @code{dbx} $B$HF1MM(B
56: @file{.dbxinit} $B$rFI$_9~$`$N$G(B, @code{dbx} $B$HF1$8(B alias $B$r;H$&$3$H$,$G(B
57: $B$-$k(B.
58:
59: @table @code
60: @item step
61: $B<!$NJ8$r<B9T$9$k(B. $B<!$NJ8$,H!?t$r4^$`$H$-(B, $B$=$NH!?t$KF~$k(B.
62: @item next
63: $B<!$NJ8$r<B9T$9$k(B.
64: @item finish
65: $B8=:_<B9TCf$NH!?t$N<B9T$,=*N;$7$?;~E@$G:F$S%G%P%C%0%b!<%I$KF~$k(B.
66: $B8m$C$F(B @code{step} $B$r<B9T$7$?>l9g$KM-8z$G$"$k(B.
67: @item cont
68: @itemx quit
69: $B%G%P%C%0%b!<%I$+$iH4$1(B, $B<B9T$r7QB3$9$k(B.
70: @item up [@var{n}]
71: $B%9%?%C%/%U%l!<%`$r(B 1 $BCJ(B ($B0z?t(B @var{n} $B$,$"$k;~$O(B @var{n} $BCJ(B) $B>e$,$k(B.
72: $B$3$l$K$h$j(B, $B$=$N%9%?%C%/%U%l!<%`$KB0$9$kJQ?t$NCM$N;2>H(B, $BJQ99$,$G$-$k(B.
73: @item down [@var{n}]
74: $B%9%?%C%/%U%l!<%`$r(B 1 $BCJ(B ($B0z?t(B @var{n} $B$,$"$k;~$O(B @var{n} $BCJ(B) $B2<$,$k(B.
75: @item frame [@var{n}]
76: $B0z?t$,$J$$$H$-(B, $B8=:_<B9TCf$NH!?t$rI=<($9$k(B.
77: $B0z?t$,$"$k$H$-(B, $B%9%?%C%/%U%l!<%`$rHV9f(B @var{n} $B$N$b$N$K@_Dj$9$k(B. $B$3$3$G(B
78: $B%9%?%C%/%U%l!<%`$NHV9f$H$O(B
79: @code{where} $B$K$h$jI=<($5$l$k8F$S=P$7Ns$K$*$$$F(B, $B@hF,$KI=<($5$l$kHV9f$N(B
80: $B$3$H$G$"$k(B.
81: @item list [@var{startline}]
82: @itemx list @var{function}
83: $B8=:_9T(B, $B$^$?$O(B @var{startline}, $B$^$?$O(B @var{function}$B$N@hF,$+$i(B 10 $B9T%=!<(B
84: $B%9%U%!%$%k$rI=<($9$k(B.
85: @item print @var{expr}
86: @var{expr} $B$rI=<($9$k(B.
87: @item func @var{function}
88: $BBP>]H!?t$r(B @var{function} $B$K@_Dj$9$k(B.
89: @item stop at @var{sourceline} [if @var{cond}]
90: @itemx stop in @var{function}
91: @var{sourceline}$B9TL\(B, $B$^$?$O(B @var{function} $B$N@hF,$K%V%l!<%/%]%$%s%H$r(B
92: $B@_Dj$9$k(B. $B%V%l!<%/%]%$%s%H$O(B, $BH!?t$,:FDj5A$5$l$?>l9g<+F0E*$K<h$j>C$5$l(B
93: $B$k(B. @code{if} $B$,B3$/>l9g(B, @var{cond} $B$,I>2A$5$l(B, $B$=$l$,(B 0 $B$G$J$$>l9g$K(B
94: $B<B9T$,CfCG$7(B, $B%G%P%C%0%b!<%I$KF~$k(B.
95: @item trace @var{expr} at @var{sourceline} [if @var{cond}]
96: @item trace @var{expr} in @var{function}
97: @code{stop} $B$HF1MM$G$"$k$,(B, @code{trace} $B$G$OC1$K(B @var{expr} $B$rI=<($9$k(B
98: $B$N$_$G(B, $B%G%P%C%0%b!<%I$K$OF~$i$J$$(B.
99: @item delete @var{n}
100: $B%V%l!<%/%]%$%s%H(B @var{n} $B$r<h$j>C$9(B.
101: @item status
102: $B%V%l!<%/%]%$%s%H$N0lMw$rI=<($9$k(B.
103: @item where
104: $B8=:_$NDd;_E@$^$G$N8F$S=P$7Ns$rI=<($9$k(B.
105: @item alias @var{alias} @var{command}
106: @var{command} $B$K(B @var{alias} $B$NJLL>$rM?$($k(B.
107: @end table
108:
109: @noindent
110: @code{print} $B$N0z?t$H$7$F(B, $B%H%C%W%l%Y%k$K$*$1$k$[$H$s$I$9$Y$F$N<0(B
111: $B$,$H$l$k(B. $BDL>o$O(B, $BJQ?t$NFbMF$NI=<($,<g$G$"$k$,(B, $BI,MW$K1~$8$F<!$N(B
112: $B$h$&$J;H$$J}$,$G$-$k(B.
113:
114: @itemize @bullet
115: @item
116: @b{$BJQ?t$N=q$-49$((B}
117:
118: $B<B9TCf$N%V%l!<%/%]%$%s%H$K$*$$$F(B, $BJQ?t$NCM$rJQ99$7$F<B9T$r7QB3$5$;$?$$(B
119: $B>l9g(B, $B<!$N$h$&$JA`:n$r9T$($P$h$$(B.
120:
121: @example
122: (debug) print A
123: A = 2
124: (debug) print A=1
125: A=1 = 1
126: (debug) print A
127: A = 1
128: @end example
129:
130:
131: @item
132: @b{$BH!?t$N8F$S=P$7(B}
133:
134: $BH!?t8F$S=P$7$b<0$G$"$k$+$i(B, @code{print} $B$N0z?t$H$7$F$H$l$k(B.
135:
136: @example
137: (debug) print length(List)
138: length(List) = 14
139: @end example
140:
141: $B$3$NNc$G$O(B, $BJQ?t(B @code{List} $B$K3JG<$5$l$F$$$k%j%9%H$ND9$5$r(B @code{length()}
142: $B$K$h$jD4$Y$F$$$k(B.
143:
144: @example
145: (debug) print ctrl("cputime",1)
146: ctrl("cputime",1) = 1
147: @end example
148:
149: $B$3$NNc$O(B, $B7W;;3+;O;~$K(B CPU $B;~4V$NI=<($N;XDj$r$7K:$l$?>l9g$J$I$K(B, $B7W;;(B
150: $BESCf$G%G%P%C%0%b!<%I$+$i;XDj$r9T$($k$3$H$r<($7$F$$$k(B.
151:
152: $B$^$?(B, $B;_$`$rF@$:7W;;$rCfCG$7$J$1$l$P$J$i$J$$>l9g(B, $B%G%P%C%0%b!<%I$+$i(B
153: @code{bsave()} $B$J$I$N%3%^%s%I$K$h$jESCf7k2L$r%U%!%$%k$KJ]B8$9$k$3$H$b(B
154: $B$G$-$k(B.
155:
156: @example
157: (debug) print bsave(A,"savefile")
158: bsave(A,"savefile") = 1
159: @end example
160:
161: $B%G%P%C%0%b!<%I$+$i$NH!?t8F$S=P$7$GCm0U$9$Y$-$3$H$O(B,
162: @code{print} $B$N0z?t$,%f!<%6Dj5AH!?t$N8F$S=P$7$r4^$`>l9g(B,
163: $B$=$NH!?t8F$S=P$7$G%(%i!<$,5/$3$C$?>l9g$K85$NH!?t$N<B9T7QB3$,IT2DG=(B
164: $B$K$J$k>l9g$,$"$k$H$$$&$3$H$G$"$k(B.
165: @end itemize
166:
167: @node $B%G%P%C%,$N;HMQNc(B,,, $B%G%P%C%,(B
168: @section $B%G%P%C%,$N;HMQNc(B
169:
170: @noindent
171: $B$3$3$G$O(B, $B3,>h$r:F5"E*$K7W;;$5$;$k%f!<%6Dj5AH!?t$rNc$H$7$F(B, $B%G%P%C%,$N(B
172: $B<B:]$N;HMQK!$r<($9(B.
173:
174: @example
175: % asir
176: [0] load("fac")$
177: [3] debug$
178: (debug) list factorial
179: 1 def factorial(X) @{
180: 2 if ( !X )
181: 3 return 1;
182: 4 else
183: 5 return X * factorial(X - 1);
184: 6 @}
185: 7 end$
186: (debug) stop at 5 <-- $B%V%l!<%/%]%$%s%H$N@_Dj(B
187: (0) stop at "./fac":5
188: (debug) quit <-- $B%G%P%C%0%b!<%I$rH4$1$k(B
189: [4] factorial(6); <-- factorial(6) $B$N8F$S=P$7(B
190: stopped in factorial at line 5 in file "./fac"
191: 5 return X * factorial(X - 1);
192: (debug) where <-- $B%V%l!<%/%]%$%s%H$^$G$N8F$S=P$7Ns$NI=<((B
193: factorial(), line 5 in "./fac"
194: (debug) print X <-- X $B$NCM$NI=<((B
195: X = 6
196: (debug) step <-- $B%9%F%C%W<B9T(B ($BH!?t$KF~$k(B)
197: stopped in factorial at line 2 in file "./fac"
198: 2 if ( !X )
199: (debug) where
200: factorial(), line 2 in "./fac"
201: factorial(), line 5 in "./fac"
202: (debug) print X
203: X = 5
204: (debug) delete 0 <-- $B%V%l!<%/%]%$%s%H(B 0 $B$N>C5n(B
205: (debug) cont <-- $B<B9T7QB3(B
206: 720 <-- $B7k2L(B = 6!
207: [5] quit;
208: @end example
209:
210: @node $B%G%P%C%,$N=i4|2=%U%!%$%k$NNc(B,,, $B%G%P%C%,(B
211: @section $B%G%P%C%,$N=i4|2=%U%!%$%k$NNc(B
212:
213: @noindent
214: $BA0$K=R$Y$?DL$j(B, @b{Asir} $B$O(B, $B5/F0;~$K(B @samp{$HOME/.dbxinit} $B$rFI$_9~$`(B.
215: $B$3$N%U%!%$%k$O(B, @code{dbx} $B$N$5$^$6$^$J=i4|@_DjMQ$N%3%^%s%I$r5-=R$7$F$*$/(B
216: $B%U%!%$%k$G$"$k$,(B, @b{Asir} $B$O(B, @code{alias} $B9T$N$_$rG'<1$9$k(B. $BNc$($P(B,
217:
218: @example
219: % cat ~/.dbxinit
220: alias n next
221: alias c cont
222: alias p print
223: alias s step
224: alias d delete
225: alias r run
226: alias l list
227: alias q quit
228: @end example
229:
230: @noindent
231: $B$J$k@_Dj$K$h$j(B, @code{print}, @code{cont} $B$J$I(B, $B%G%P%C%0%b!<%I$K$*$$$F(B
232: $BIQHK$KMQ$$$i$l$k%3%^%s%I$,(B, $B$=$l$>$l(B @code{p}, @code{c} $B$J$I(B, $BC;$$(B
233: $BJ8;zNs$GBeMQ$G$-$k(B. $B$^$?(B, $B%G%P%C%0%b!<%I$K$*$$$F(B, @code{alias} $B%3%^%s%I(B
234: $B$K$h$j(B alias $B$NDI2C$,$G$-$k(B.
235:
236: @example
237: lex_hensel(La,[a,b,c],0,[a,b,c],0);
238: stopped in gennf at line 226 in file "/home/usr3/noro/asir/gr"
239: 226 N = length(V); Len = length(G); dp_ord(O); PS = newvect(Len);
240: (debug) p V
241: V = [a,b,c]
242: (debug) c
243: ...
244: @end example
245:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>