|
|
1.1 root 1: .TH SDB 1
2: .CT 1 debug_tune
3: .SH NAME
4: sdb \- symbolic debugger
5: .SH SYNOPSIS
6: .B sdb
7: [
8: .I objfil
9: [
10: .I corfil
11: [
12: .I directory
13: ]
14: ]
15: ]
16: .SH DESCRIPTION
17: .I Sdb
18: is a symbolic debugger.
19: It may examine source files, object files, and running or stopped
20: core images.
21: .PP
22: .I Objfil
23: is an executable program (default
24: .BR a.out )
25: compiled with option
26: .B -g
27: of
28: .I cc
29: or
30: .IR f77 (1).
31: .I Corfil
32: is a core image (default
33: .BR core )
34: resulting from the execution of
35: .I objfil .
36: .I Directory
37: is the home of source files,
38: .L .
39: by default.
40: .PP
41: .I Sdb
42: maintains a `current line' and a `current file', initially
43: the line number and source file name where
44: .I corfil
45: stopped executing, or the first line in function
46: .LR main
47: if there is no core image.
48: .PP
49: Variables are referred to by name, by structure or array
50: reference, or by a combination thereof.
51: Variables not in scope at the current line
52: are referred to as
53: .IB procedure : variable
54: .RI ( procedure
55: may be a Fortran common block).
56: In the syntax below, a `variable' may also be an integer constant
57: designating a storage location, or a variable plus a constant
58: designating a storage offset.
59: .PP
60: Line numbers in the source program are referred to as
61: .IB filename : number,
62: .IB procedure : number,
63: or
64: .I number
65: (in the current file).
66: The number is always relative to the beginning of the file.
67: A missing number is taken as
68: the first line of the procedure or file.
69: .PP
70: The commands for examining data are:
71: .nr xx \w'control-D\ '
72: .TP \n(xxu
73: .B t
74: Print a stack trace of the terminated or stopped program.
75: .TP
76: .B T
77: Print the top line of the stack trace.
78: .TP
79: .IB variable / lm
80: .PD
81: .TP
82: .IB variable ? lm
83: Print the value of the variable according to (an optional)
84: length
85: .I l
86: and format
87: .I m.
88: By default
89: .I l
90: and
91: .I m
92: are taken from the variable's declaration.
93: The length specifier for formats
94: .B duox
95: is
96: .BR b
97: (1 byte),
98: .BR h
99: (2 bytes),
100: or
101: .BR l
102: (4 bytes, default).
103: For formats
104: .B s
105: and
106: .BR a
107: it is an integer string length.
108: Punctuation
109: .B /
110: designates variables in data segments,
111: .B ?
112: in the text segment.
113: Legal values for format
114: .I m
115: are:
116: .PD
117: .RS
118: .TP
119: .B c
120: character
121: .PD0
122: .TP
123: .B d
124: decimal
125: .TP
126: .B u
127: decimal, unsigned
128: .TP
129: .B o
130: octal
131: .TP
132: .B x
133: hexadecimal
134: .TP
135: .B f
136: 32 bit single precision floating point
137: .TP
138: .B g
139: 64 bit double precision floating point
140: .TP
141: .B s
142: Assume variable is a string pointer and print characters until a null is
143: reached.
144: .TP
145: .B a
146: Print characters starting at the variable's address until a null
147: is reached.
148: .TP
149: .B p
150: pointer to procedure
151: .TP
152: .B i
153: machine instruction
154: .PD
155: .RE
156: .TP \n(xxu
157: \fIvariable\f5=\fP\fIlm\fR
158: .br
159: .ns
160: .TP
161: \fIlinenumber\f5=\fP\fIlm\fR
162: .br
163: .ns
164: .TP
165: \fInumber\f5=\fP\fIlm\fR
166: Print the address of the variable or line number or the value of the number
167: in the specified format,
168: .B lx
169: by default.
170: The last variant may be used to convert
171: number bases.
172: .TP
173: .IB variable ! value
174: Set the variable to the given value.
175: The value may be an integer or character constant, a variable, or
176: a floating-point constant
177: (if
178: .I variable
179: is float or double).
180: .PP
181: The commands for examining source files are
182: .TP \n(xxu
183: .BI e " procedure"
184: .br
185: .ns
186: .TP
187: .BI e " filename" .c
188: Set the current line and file.
189: If no name is given, report the current procedure and file.
190: .TP
191: .BI / "regular expression" /
192: Search forward as in
193: .IR ed (1).
194: .TP
195: .BI ? "regular expression" ?
196: Search backward.
197: .TP
198: .B p
199: Print the current line.
200: .TP
201: .B z
202: Print the current line and 9 more;
203: set the current line to the last one printed.
204: .TP
205: control-D
206: Print the next 10 lines;
207: set the current line to the last one printed.
208: .TP
209: .B w
210: Window.
211: Print the 10 lines around the current line.
212: .TP
213: .I number
214: Set the current line and print it.
215: .TP
216: .IB count " +"
217: Advance the current line by \fIcount\fP lines.
218: Print the new current line.
219: .TP
220: .IB count " -"
221: Retreat the current line by
222: .I count
223: lines.
224: Print the new current line.
225: .PP
226: The commands for controlling the execution of the source program are:
227: .TP \n(xxu
228: .IB count " r " args
229: .br
230: .ns
231: .TP
232: .IB count " R"
233: Run the program with the given arguments.
234: The
235: .B r
236: command with no arguments reuses the previous arguments
237: to the program while the
238: .B R
239: command
240: runs the program with no arguments.
241: An argument beginning with
242: .L <
243: or
244: .L >
245: causes redirection for the
246: standard input or output respectively.
247: .I Count,
248: if given,
249: specifies a number of breakpoints to be ignored.
250: .TP
251: .IB linenumber " c " count
252: .br
253: .ns
254: .TP
255: .IB linenumber " C " count
256: Continue after a breakpoint or interrupt.
257: .I Count
258: is as for
259: .LR r .
260: .B C
261: continues with the signal which caused the program to stop and
262: .B c
263: ignores it.
264: If a
265: .I linenumber
266: is given, a temporary breakpoint is placed there and is
267: deleted when the command finishes.
268: .TP
269: .IB count " s"
270: Single step.
271: Run the program through
272: .I count
273: lines, one line by default.
274: .TP
275: .IB count " S"
276: Single step, but step through subroutine calls.
277: .TP
278: .B k
279: Kill the debugged program.
280: .TP
281: .IB procedure ( arg1,arg2,... )/ m
282: Execute the named procedure with the given arguments.
283: Arguments can be variables in scope or integer,
284: character or string constants.
285: If a format,
286: .BI / m,
287: is given, print the result in that form, otherwise
288: .LR d .
289: .TP
290: .I linenumber " b " commands
291: Set a breakpoint at the given line.
292: If a procedure name without a line number is given (e.g.
293: .LR proc: ),
294: a breakpoint is placed at the first line in the procedure.
295: If no
296: .I linenumber
297: is given,
298: a breakpoint is placed at the current line.
299: .IP
300: If no
301: .I commands
302: are given, stop execution just before the breakpoint.
303: Otherwise, when the breakpoint is encountered perform
304: the semicolon-separated
305: .I commands
306: and then continue execution.
307: .TP
308: .IB linenumber " d"
309: Delete a breakpoint at the given line.
310: If no
311: .I linenumber
312: is given,
313: each breakpoint location is printed and a line is read from the standard input.
314: Answer
315: .L y
316: or
317: .L d
318: to delete it.
319: .TP
320: .B B
321: Print a list of the currently active breakpoints.
322: .TP
323: .B D
324: Delete all breakpoints.
325: .TP
326: .B l
327: Print the last executed line.
328: .TP
329: .IB linenumber " a
330: Announce.
331: If
332: .I linenumber
333: is of the form
334: .IB proc : number
335: the command does
336: .LR "linenumber b\ l"
337: (print the line each time it's reached).
338: If
339: .I linenumber
340: is of the form
341: .LR proc: ,
342: the command does
343: .L "proc: b T"
344: (print the stack frame).
345: .PP
346: Miscellaneous commands.
347: .TP
348: .BI ! " command"
349: The command is interpreted by
350: .IR sh (1).
351: .TP
352: newline
353: Advance to the next storage location or source line,
354: depending on which was last printed, and display it.
355: .TP
356: \f5"\fI string\fR
357: Print the given string.
358: .TP
359: .B q
360: Exit the debugger.
361: .PP
362: The following commands are intended for
363: debugging the debugger.
364: .TP \n(xxu
365: .B V
366: Print the version number.
367: .PD0
368: .TP
369: .B X
370: Print a list of procedures and files being debugged.
371: .TP
372: .B Y
373: Toggle debug output.
374: .PD
375: .SH FILES
376: .F a.out
377: .br
378: .F core
379: .SH SEE ALSO
380: .IR adb (1),
381: .IR pi (9.1),
382: .IR cin (1),
383: .IR nm (1),
384: .IR a.out (5),
385: .IR bigcore (1),
386: .IR cc (1),
387: .IR f77 (1)
388: .SH BUGS
389: .I Sdb
390: is old and unmaintained.
391: .br
392: If a procedure is called when the program is not
393: stopped at a breakpoint, a fresh core image results.
394: Thus a procedure can't be used to extract data from a dump.
395: .br
396: .I Sdb
397: doesn't know Fortran: arrays are singly dimensioned
398: and 0-indexed; scalar arguments are reported as pointers.
399: .br
400: The default type for printing Fortran parameters is incorrect:
401: address instead of value.
402: .br
403: Tracebacks containing Fortran subprograms with multiple entry points
404: may print too many arguments in the wrong order, but their values
405: are correct.
406: .br
407: The meaning of control-D is nonstandard.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.