dbx.1
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 1,043 行 · 第 1/3 页
1
1,043 行
.\" SCCSID: @(#)dbx.1 8.7 4/9/91.TH dbx 1 VAX.SH Namedbx \- debugger.SH Syntax.B dbx[\fB\-r\fR] [\fB\-i\fR] [\fB\-k\fR] [\fB\-I\fI dir\fR\|] [\fB\-c\fI file\fR] [\fIobjfile\fR\|[\fIcoredump\fR\|]\|].SH Description.NXR "dbx debugger".NX R "program" "debugging".NX RS "symbolic debugger" "dbx debugger".NX RS "debugger" "dbx debugger".NX RA "adb debugger" "dbx debugger"The.PN dbxdebugger is a tool for source level debugging and executionof programs running under the ULTRIX operating system. Once you invoke .PN dbx ,you can issue .PN dbxcommands that control and trace program execution, print variable andexpression values, and display and edit source files..PPYou can use command options to modify some steps that.PN dbxperforms during startup. (For information on the available options, seeOptions.) Unless you specify the.B \-roption, .PN dbxprompts you for a command before it begins executing your program. The .PN dbxprompt appears as follows:.EX(dbx).EETo leave .PN dbxissue the .B quit command..SS Arguments.PP On the command line, the \fIobjfile\fPargument names the object file that you want.PN dbxto read as input. For complete.PN dbxsupport, the object file must contain extended symbol tableinformation. The supported compilers each have an option,.B \-g ,that produces the symbol table information in the object file..PP The extended symbol table contains information that makes your debuggingsession more convenient.For example, the extended symbol table contains the names of allthe source files translated by the compiler to create the object file.This information allows you to look at all the source code that wentinto creating an object file during your debugging session..PP If your object file does not contain the extended symbol table, use the commands described in Machine Level Commandsto debug your program..PP If you omit the .I objfileargument, .PN dbxprompts you for the name of an object file. If you press the Return key,.PN dbxattempts to read a file named .PN a.outfrom the current directory. If no.PN a.outfile exists, .PN dbxissues another prompt to allow you to enter a file name. If you pressthe Return key, .PN dbx exits..PPThe.I coredump argument names a core dump file. You can examine the core dump file to determinethe state of your program. If you omit.I coredumpand a core file exists in the current directory,.PN dbxreads in a file named.PN core ..SS Initialization File.PPDuring its startup, .PN dbxreads and executes the commands in an initialization file, if one ispresent. By default, .PN dbxsearches for the file.PN \&.dbxinitin the current directory. If no.PN \&.dbxinitfile exists in the current directory,.PN dbxsearches your home directory for the file. You can use theinitialization file to automatically issue setup commands whenyou begin a.PN dbxsession..PPYou can rename the.PN dbxdebugger. If you rename the debugger, you must also rename itsinitialization file. The debugger expects the initialization file's nameto be a period (\.), followed by the first eight characters in thedebugger's name, followed by the string.PN init .For example, if you rename.PN dbxto.PN srcdebugger ,the debugger searches for an initialization file named.PN .srcdebuginit ..SH Options.TP .BI \-c fileExecutes the .PN dbxcommands in the specified file beforereading from standard input..TP.B \-iForces.PN dbxto act as though standard input is a terminal..TP.BI \-I dirAdds the specified directory to the list of directoriesthat .PN dbxsearches for source files.Normally,.PN dbxsearches for source files in the current directoryand in the directory where \fIobjfile\fP is located.You can also issue the.PN usecommand to set the directory search path..TP .B \-kMaps memory addresses. This option is useful for kernel debugging..TP.B \-rExecutes \fIobjfile\fP immediately.If the program executes successfully,.PN dbxexits. If program execution terminates with an error, .PN dbxdisplays the message that describes the error. You can then either invoke the debugger or let the programcontinue exiting.The.PN dbxdebuggerreads from .PN /dev/tty when you specify the \fB\-r\fP option and standard input is not a terminal..SS Execution and Tracing CommandsUsing.PN dbxcommands, you can execute your program under control of the debugger.You can trace its execution and control whether your program trapscertain signals. The following list describes the commands that allowyou to execute and trace your program:.IP "\fBcall\fP \fIprocedure\fR[\fB(\fIparameters\fB)\fR]".NXR "call command (dbx)"Executes the object code associated with the named procedure or functionand passes any parameters you specify to the procedure..IP "\fBcatch\fP \fIinteger\fP".ns.IP "\fBcatch\fP \fIsignal-name\fP".ns.IP "\fBignore\fP \fIinteger\fP".ns.IP "\fBignore\fP \fIsignal-name\fP"Starts or stops trapping a signal before it is sentto the program..NXR "catch command (dbx)" .NXR "ignore command (dbx)"These commands are useful when you are debugging a program that handles signals, such as interrupts..sp 1You can specify a signal by number or by a name(for example, SIGINT).Signal names are case insensitive and the SIG prefix is optional.By default, .PN dbxtraps all signals except SIGCONT, SIGCHILD,SIGALRM, and SIGKILL..IP "\fBcont\fP \fR[\fIinteger\fR]".ns.IP "\fBcont\fP \fR[\fIsignal-name\fR]"Continues execution from where it stopped. If you specify a signal name or number, the process continues as though.NXR "cont command (dbx)"it received the signal.If you omit the signal name or number, program execution continues as if a signal hadnot been encountered. For information about signal names and numbers,see.MS signal 3 ..IP ""Execution cannot be continued if the process has called the standard exit procedure.The.PN dbxdebugger does not allow the process to exit, so you can examinethe program state..IP "\fBdelete\fP \fIcommand-number\fP \&.\&.\&.".ns.IP "\fBdelete all\fP".NXR "delete command (dbx)"Removes the trace or stop event that corresponds to the specified number orremoves all traces and stops.Trace and stop event numbers are assigned by.PN dbx .You can display them using the.B status command..IP The command \fBdelete all\fP removesall existing traces and stops at once. The command \fBdelete *\fP hasthe same effect..IP "\fBnext\fP".NXR "next command (dbx)"Executes to the next source line. If the source line that is executedcontains a call to a procedure or function, the.B next command executes the entire procedure or function. Program executionstops following the return from the procedure; that is, execution stops prior to the source line that follows the call..IP "\fBreread\fP"Reads the object file before beginning program execution. Thedebugger reads the object file directly before executing the program inresponse to a.B runor .B rerun command. Reading the object file directly before executing the programensures that the execution is unaffected by any corruption that might haveoccurred during a previous run..IP "\fBreturn\fP [\fIprocedure\fP]".NXR "return command (dbx)"Executes until a return to \fIprocedure\fP is executed oruntil the current procedure returns if none is specified..IP "\fBrun\fP [\fIargs\fP] [\fB<\fP \fIfilename\fP] [\fB>\fP \fIfilename\fP]".NXR "run command (dbx)".NXR "rerun command (dbx)".ns.IP "\fBrerun\fP [\fIargs\fP] [\fB<\fP \fIfilename\fP] [\fB>\fP \fIfilename\fP]"Starts executing \fIobjfile\fP, passing \fIargs\fP as command line arguments.You can use angle brackets (\fB<\fP or \fB>\fP) to redirect inputor output in the usual manner.If you issue the \fBrerun\fP command without any arguments, .PN dbxpasses the previous argument list to the program. Otherwise,the.B reruncommand is identical to \fBrun\fP.If you recompiled your program since the last time .PN dbxread symbolic information, it reads in the new information..IP "\fBstatus\fP [\fB>\fP \fIfilename\fP]".NXR "status command (dbx)"Displays the currently active trace and stop events..IP \fBstep\fP.NXR "step command (dbx)"Executes one source line. If the source line contains a call to aprocedure or function, the.B stepcommand stops at the first line of the procedure or function..IP "\fBstop if\fP \fIcondition\fP".ns.IP "\fBstop\fP \fBat\fP \fIsource-line-number\fP [\fBif\fP \fIcondition\fP]".ns.IP "\fBstop\fP \fBin\fP \fIprocedure/function\fP [\fBif\fP \fIcondition\fP]".ns.IP "\fBstop\fP \fIvariable\fP [\fBif\fP \fIcondition\fP]".NXR "stop command (dbx)"Stops execution when the specified condition is true, the specified linenumber is reached, the specified procedure or function is called, or thespecified variable changes value..IPIf you specify a condition with the \fIsource-line-number\fP,\fIprocedure/function\fP, or \fIvariable\fP argument, executionstops only when the condition is true. For example, suppose you specifiedthat execution should stop at line 14 if variable \fIa\fP is greater in value thanvariable \fIb\fP. The debugger continues execution if variable \fIa\fP equals variable \fIb\fP when it reaches line 14..IP "\fBtrace\fP [\fBin\fP \fIprocedure/function\fP] [\fBif\fP \fIcondition\fP]".ns.IP "\fBtrace\fP \fIsource-line-number\fP [\fBif\fP \fIcondition\fP]".ns.IP "\fBtrace\fP \fIprocedure/function\fP [\fBin\fP \fIprocedure/function\fP] [\fBif\fP \fIcondition\fP]".ns.IP "\fBtrace\fP \fIexpression\fP \fBat\fP \fIsource-line-number\fP [\fBif\fP \fIcondition\fP]".ns.IP "\fBtrace\fP \fIvariable\fP [\fBin\fP \fIprocedure/function\fP] [\fBif\fP \fIcondition\fP]".NXR "trace command (dbx)"Displays tracing information during program execution. The.PN dbxdebugger associates a number with the source line that contains thetrace. You use the number to turn off tracing, as described with the.B deletecommand..IPThe first argument to the.B tracecommand describes what is to be traced. You can specify a procedure orfunction name, a source line number, an expression, or a variable name..IP Specifying a procedure or function name causes .PN dbxto display the name of the calling routine, thesource line that contains the call, and the parametersthat are passed to the called routine. In addition, .PN dbx notes the return of the named procedure or function and displays the return value,if any.The debugger displays this information each timethe procedure or function is called..IPIf you specify the \fBin\fP \fIprocedure/function\fP clause,.PN dbxdisplays tracing information only while executing the specified procedure or function..IP If you specify \fIsource-line-number\fP, .PN dbxdisplays the source line immediately prior to executing it.You can specify a source line number in a source file that is not the currentone. To do so, precede the source line number with the source file name in
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?