dbx.1

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 1,322 行 · 第 1/3 页

1
1,322
字号
.ns.TP 15\fBfunc \fR[\fIprocedure/function\fR]Changes the current procedure or function to the one you specify. If you omit\fIexpression\fR and \fIprocedure/function\fR, the debugger displays the name of the current procedure or function..IPChanging the current function implicitly changes the current source fileto the one that contains the procedure or function; it also changes the currentscope used for name resolution..TP 15\fBlist \fR[\fIsource-line-number\fR[:\fIinteger\fR]] .ns.TP 15\fBlist \fR[\fIsource-line-number\fR[\fB,\fI source-line-number\fR]].ns.TP 15\fBlist \fR[\fIprocedure/function\fR]Lists the lines in the current source file..IPIf you specify a source line number and an integer, .PN dbx lists beginning from\fIsource-line-number\fP and continuing for \fIinteger\fP number oflines. If you omit \fIinteger\fP, the debugger displays 10 lines, bydefault..IPIf you specify two source line numbers separated by a comma, the debugger begins the display at the first source line numberand continues through the second source line number. If you omit thesecond source line number, the debugger displays 10 lines, by default..IPIf you specify a procedure or function name, the debugger displays linesin that procedure or function. The debugger displays 10 lines bedefault..IPIf you omit all arguments, the debugger begins the display at thecurrent line and displays 10 lines, by default..IPThe .B $listwindow debugger variable controls how many lines the debuggerdisplays. The default value for .B $listwindow is 10..TP 15\fBtag \fItagname\fRSets the current source file or source line to the location specified by\fItagname\fR..IPYou create tags using the.PN ctagscommand. See the.MS ctags 1reference page for more information. The debugger uses the tag filenamed in the .B $tagfile debugger variable to resolve references to tags..TP 15\fBuse \fR[\fIdirectory\fR...]Displays or sets the list of directories that .PN dbxuses when searching for source files. If you issue the \fBuse\fP commandwithout arguments, the debugger displays the list of directories itsearches for source files. To change the directory list, specify thenames of the directories you want on the list as arguments to the.B usecommand. The directories you specify replace any existing directorylist..TP 15\fBwhatis \fIvariable\fRDisplays the type declaration for \fIvariable\fP..TP 15\fBwhereis \fIvariable\fRDisplays the fully qualified name of each occurrence of \fIvariable\fP.The order in which the debugger displays the qualified names is notmeaningful..TP 15\fBwhich \fIvariable\fRDisplays the fully qualified name of \fIvariable\fP..SS Preparing for Program ExecutionBefore you execute your program under .PN dbxcontrol, you might want to perform setup tasks, such as changing the value of program variables, specifying what signals your program should recognize or ignore, and settingbreakpoints.The following list describes the commands you useto perform these tasks:.TP 15.B "assign \fIvariable = expression\fR"Assigns the value of the specified expression to the specified program variable.(Use the .B setcommand to set the value of debugger variables.).TP 15.B "catch \fR[\fIsignal\fR]"Lists all signals that .PN dbxcatches, or, if you supply an argument, causes .PN dbxto catch that signal. The signal you specify is added to the list ofsignals .PN dbxcatches, so the debugger continues to catch any signals that werealready on its list. Some signals cannot be caught by any process. For alist of signals and information on which signals can be caught,see the .MS signal 3reference page..TP 15\fBignore \fR[\fIsignal\fR]Lists all signals that .PN dbxignores.  If you specify a signal,this command adds the signal to the list of signals the debuggerignores. Some signals cannot be ignored by any process. For a list ofsignals and information on which signals can be ignored, see the.MS signal 3reference page..TP 15\fBstop \fIvariable\fR.ns.TP 15\fBstop \fR[\fIvariable\fR] \fBat \fIsource-line\fR [\fBif \fIcondition\fR].ns.TP 15\fBstop \fR[\fIvariable\fR] \fBin \fIprocedure/function\fR \fR[\fBif \fIcondition\fR].ns.TP 15\fBstop \fR[\fIvariable\fR] \fBif \fIcondition\fR Stops execution when the specified variable changes value, the specifiedsource line is reached, the specified procedure or function is called, or thespecified condition is true. The condition must be a Boolean expression..IPIf you specify \fIvariable\fP with a source line number, the debuggerstops execution when the source line number is reached and the variablechanges value.  If you specify \fIvariable\fP with \fBin \fIprocedure/function\fR,the debugger stops execution when it is executing in the named procedureor functionand the named variable changes value.  With \fBif \fIcondition\fR, thedebugger stops execution when the condition is met and the variablechanges value..IPIf you specify a condition with \fBat \fIsource-line\fR or \fBin \fIprocedure/function\fR,the debugger stops only if the condition is true..IPThe debugger associates an event number with each.B stopcommand you issue.  You use the event number to remove the breakpoint,as described with the.B delete command..TP 15\fBtrace\fR [\fBat\fR] \fIsource-line\fR.ns.TP 15\fBtrace\fR \fIprocedure/function\fR.ns.TP 15\fBtrace \fIvariable \fR[\fBat \fIsource-line\fR] [\fBif \fIcondition\fR].ns.TP 15\fBtrace \fIvariable \fR[\fBin \fIprocedure/function\fR] [\fBif \fIcondition\fR]Displays tracing information during program execution.  The .PN dbxdebugger associates an event number with each .B tracecommand you issue. You use the event number to turn off tracing, as described with the.B deletecommand..IPThe first argument to the .B tracecommand specifies what the debugger traces.  You can specify a sourceline number, a procedure name, or a variable name..IPIf you specify a source line number, .PN dbxdisplays the source line immediately prior to executing it. You canspecify 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 namein quotation marks (" ") followed by a colon (:), as shown in the following example:.EX(dbx) \f(CBtrace at "source_file.c":17\fP.EEThe example specifiestracing line 17 in.PN source_file.c ..IPSpecifying a procedure or function name causes .PN dbxto display the name of the calling routine, the source line thatcontains the call, and the parameters that are passed to the calledroutine. In addition, .PN dbxnotes the return of the named procedure or function and displays thereturn value, if any.  The debugger displays this information each timethe procedure or function is called..IPSpecifying a variable name causes.PN dbxto display the name and value of the variable each time it changes.Program execution is substantially slower during this form of tracing..IPIf you specify the \fBin\fI procedure/function\fR clause, .PN dbxdisplays tracing information only while executing the specifiedprocedure or function..IPThe \fIcondition\fP is a Boolean expression that.PN dbxevaluates prior to displaying any tracing information. The debuggerdisplays tracing information only if the condition is true..TP 15\fBwhen \fR[\fIvariable\fR] [\fBat\fI line\fR] \fB{\fIcommand_list\fB}.ns.TP 15\fBwhen \fR[\fIvariable\fR] [\fBin \fIprocedure/function\fR] \fB{\fIcommand_list\fB}Executes the specified .PN dbxcommand list. You can separate the commands by commas (,) orsemi-colons (;)..IPIf you specify \fIvariable\fP, the debugger executes the command listwhen the value of the variable changes. Specify \fBat \fIline\fR or\fBin \fIprocedure\fR to control which occurrence of the variable causesthe debugger to execute the command list..SS Initiating Program ExecutionThe following .PN dbxcommands allow you to control program execution:.TP 15\fBcall \fIprocedure/function \fB(\fR[\fIparameters\fR]\fB)Executes the object code associated with the named procedure or function.This command passes the specified parameters to the procedure or function..TP 15\fR[\fIn\fR] \fBcont \fR[\fIsignal\fR].ns.TP 15\fBcont \fR[\fIsignal\fR] \fBto \fIsource-line\fR.ns.TP 15\fBcont \fR[\fIsignal\fR] \fBin \fIprocedure/function\fRContinues execution from where it stopped.  If you specify an integer \fIn\fP, thedebugger ignores that number of stops after it resumes programexecution.If you specify \fIsignal\fR, the process continues as though it receivedthe signal.  .IPIf you specify \fBto \fIsource-line\fR, the debugger continues execution untilit reaches the specified source line..IPIf you specify \fBin \fIprocedure/function\fR, the debugger resumes execution inthe named procedure or function../".TP 15./".B debug \fR[\fIobject \fR[\fIcore\fR]]./"Terminates the current debugging session and begins debugging./"\fIobject\fP or displays the name of the current program. If you specify./"\fIcore\fR, you can use the core file to determine the state of your./"program../"When you use ./".B debug./"to begin a new debugging session, any options that you specified when you invoked ./".PN dbx./"remain in effect.  Similarly, any aliases,./".PN dbx ./"variables, or environment variables that were defined during the first./"session remain unchanged../".IP./"If you omit arguments for this command, the debugger displays the name./"of the program you are currently debugging and that program's./"arguments..TP 15\fBgoto \fIsource-line\fRBegins execution at the specified source line..TP 15\fBnext \fR[\fIinteger\fR]Executes up to the next source line. If the source line that is executedcontains a call to a procedure or function, the.B nextcommand executes the entire procedure or function. Program executionstops following the return from the procedure or function; that is, execution stopsprior to the source line that follows the call..IPIf you specify \fIinteger\fP, the debugger performs the specified numberof .B nextcommands..TP 15\fBrerun \fR[\fIarg1, arg2,...\fR] [\fB<\fIfile1\fR][\fB>\fIfile2\fR].ns.TP 15\fBrerun \fR[\fIarg1, arg2,...\fR] [\fB<\fIfile1][\fB>&\fIfile2\fR]Reruns the program, using the same arguments that were specified with the \fBrun\fR command.  If you specify new arguments, \fBrerun\fR uses those arguments..IPYou can use angle brackets (< or >) to redirect input or output in theusual manner..TP 15\fBrun \fR[\fIarg1,arg2,...\fR] [\fB<\fIfile1\fR] [\fB>\fIfile2\fR].ns.TP 15\fBrun \fR[\fIarg1,arg2,...\fR] [\fB<\fIfile1\fR] [\fB>&\fIfile2\fR]Runs the program, passing it the specified arguments..IPYou can use angle brackets (< or >) to redirect input or output in theusual manner..TP 15\fBreturn \fR[\fIprocedure/function\fR]Executes until a return to \fIprocedure/function\fP is executed or until thecurrent procedure or function returns if you omit\fIprocedure/function\fR..TP 15\fBstep \fR[\fIinteger\fR]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. (Thedebugger does not stop at the first line of a procedure or function ifyou compiled your program without using the.B \-goption.).IPIf you specify \fIinteger\fP, the debugger performs the specified numberof.B stepcommands..SS Examining Program StateThe following commands help you determine the state of your program:.TP 15\fBdump \fR[\fIprocedure/function\fR] [\fI\&.\fR]Displays variable information about the named procedure or function, or the current procedure or function if you do not specify one.  If youspecify dot (.),the debugger displays information on all procedures or functions in the stack and their variables. .TP 15\fBdown \fR[\fIexpression\fR]Moves the current function down \fIcount\fP activation levels in the stack.  Thedefault is one level..TP 15\fBup \fR[\fIexpression\fR]Moves the current function up \fIcount\fP activation levels on the stack.  The defaultis one level..TP 15\fBprint \fIexpression1,expression2,\&.\&.\&.\fRDisplays the value of the specified expression..TP 15\fBprintf \fI"format", arg1,arg2,...\fRFormats a complex structure for display as specified. You use the sameformat specifiers for this command as for the.PN printfsubroutine. For information on specifying the format, see.MS printf 3s .(The .PN %sconversion specification is not supported.).TP 15\fBprintregs\fRDisplays all register values..TP 15\fBwhere\fR [\fIn\fR]Displays a list of the active procedures and functions. If you specify\fIn\fR, the debugger displays only procedures and functions in the top \fIn\fP levels of the stack..SS Debugging at the Machine LevelYou can use machine level commands to debug any program, regardless ofwhether the program object file contains extended symbol tableinformation..PPYou can specify symbolic addresses by preceding the name with anampersand (&). You denote registers by \fB$r\fIN\fR, where \fIN\fR is the number of theregister. Addresses may be expressions made up of other addresses and theoperators plus (+), minus (-), and indirection (unary asterisk, *)..PPThe following describes the.PN dbxmachine level commands:.TP 15\fIaddress\fB/\fIcount\fR \fImode\fR.ns.TP\fIaddress\fB?\fIcount\fR \fImode\fRSearches forward (or backward, if you specify \fB?\fR) and displaysthe contents of \fIaddress\fR or disassembles the code for the instruction \fIaddress\fR.The \fIcount\fR argument specifies the number of items that the debugger displays at thespecified address.  The \fImode\fR determines how.PN dbxdisplays memory; if you omit it, the debugger uses the previous mode.The initial mode is X. You can specify the following modes:.sp 0b	Displays a byte in octal..sp 0c	Displays a byte as a character..sp 0d	Displays a short word in decimal..sp 0D	Displays a long word in decimal..sp 0f	Displays a single precision real number..sp 0g	Displays a double precision real number..sp 0i	Displays machine instructions..sp 0n	Displays data in typed format..sp 0o	Displays a short word in octal..sp 0O	Displays a long word in octal..sp 0s	Displays a string of characters that ends in a null..sp 0x	Displays a short word in hexadecimal..sp 0X	Displays a long word in hexadecimal..IPThe debugger maintains the next address to be displayed in dot (.). To display the next address, you can use thefollowing command:.EX(dbx) \f(CB./\fP.EEThe debugger will display the next \fIcount\fP locations in the\fImode\fP specified in the previous command..TP 15\fIaddress\fB/\fIcountL value mask\fRSearches for a 32-bit word that satisfies the mask. The debugger startssearching at the specified \fIaddress\fR.The \fIcount\fR argument specifies the number of words the debuggerprocesses during the search..IPThe debugger masks the word stored at \fIaddress\fR using the value specified in \fImask\fR. If the masked value equals \fIvalue\fR, the debugger displaysthe address of the masked value. Otherwise, the debugger increments\fIaddress\fR and continues to search..TP 15

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?