Debugging with the idbx tool

Instructions for using the idbx tool to debug a program from the command line.

About this task

The user can run the idbx tool by invoking the "idbx" command on the command prompt. This will allow the user to debug a program without the use of a UI workbench.

$ idbx testProg
Commands List
assign <variable> = <expression>
Assign the value of the expression to the variable.
clear <line-number>
Remove all breakpoints and traces at a given line number.
Note: Also see delete.
cont <signal-number>
cont <signal-name>
Continue execution from where it stopped. If a signal is specified, the process continues as though it received the signal. Otherwise, the process is continued as though it had not been stopped.
delete <status-number>
delete all
delete tskip [ for t<thread number> ]
The traces or stops corresponding to the given numbers or the remaining tskip count for the specified thread are removed. The numbers associated with traces, stops and the remaining thread tskip counts can be printed with the "status" command.
disable <status-number>
disable
The traces or stops corresponding to the given numbers are disabled. The numbers associated with traces and stops can be printed with the "status" command.
down
down <count>
up
up <count>
Move the current function, which is used for resolving names, up or down the stack <count> levels. The default <count> is one.
enable <status-number>
enable all
The traces or stops corresponding to the given numbers are enabled. The numbers associated with traces and stops can be printed with the "status" command.
goto <line-number>
goto "<filename>" : <line-number>
gotoi <address>
Change the program counter to <address> or an address near <line-number>. The variable unsafegoto must be set if a goto out of the current function is desired.
help
help [> <filename> ]
help <command> [> <filename> ]
help <topic> [> <filename> ]
Print information about command or topic. (The string describing a topic may be abbreviated.) Long messages can be paged using the default "pg" alias. For example: "pg" (help set_variables).
Note: "pg" not currently supported.
Note: Redirecting to a file is currently not supported.
list [ <source-line-number> [, <source-line-number> ]]
list <procedure>
List the lines in the current source file from the first line number to the second inclusive. If no lines are specified, the next 10 lines are listed. If the name of a procedure or function is given lines n-k to n+k are listed where n is the first statement in the procedure or function and k is defined by listwindow.
listi
listi [ <address> [ , <address> ]]
listi at <source-line-number>
listi <procedure>
List the instructions from the current program counter location or given address, line number or procedure. The number of instructions printed is controlled by the dbx internal variable listwindow.
move <source-line-number>
Change the next line to be displayed by the list command to source_line_number
next
next <count>
Run to the next line. If a count is supplied run the next count lines. The difference between this and "step" is that if the line contains a call to a procedure or function the "step" command will stop at the beginning of that block, while the "next" command will not.
nexti
nexti <count>
Single step as in "next", but do a single instruction rather than source line. If a count is supplied execute the nexti count instructions.
print <expression> [ , <expression> ]
print <procedure (<parameters>)
Prints the value of specified expression. Values of general purpose registers and floating point registers can also be printed using this command.
"print <procedure> (<parameters>)" executes the object code associated with the procedure and prints the return value.
Names are resolved first using the static scope of the current function, then using the dynamic scope if the name is not defined in the static scope. If static and dynamic searches do not yield a result, an arbitrary symbol is chosen and the message "[using <qualified-name>]" is printed. The name resolution procedure may be overridden by qualifying an identifier with a block name, e.g., "module.variable". For C, source files are treated as modules named by the file name without ".c"
prompt
prompt "string"
Displays the dbx prompt, or changes prompt to "string".
quit
Exit dbx (program terminated).
registers
Print the contents of all general purpose registers, system control registers, floating-point registers, and the current instruction register. To display floating-point registers, use the "unset noflregs" dbx subcommand.
Registers can be individually displayed or assigned by using the following predefined register names: r0 through $r31 for the general purpose registers fr0 through $fr31 for the floating point registers sp, iar, cr, link for, respectively, the stack pointer, the program counter, condition register, and the link register.
run [<arguments>] [< <filename> ] [> <filename> ]
[>> <filename> ] [>! <filename> ]
[2> <filename> ] [2>> <filename> ]
[>& <filename> ] ]>>& <filename> ]
rerun [<arguments>] [< <filename> ] [> <filename> ]
[>> <filename> ] [>! <filename> ]
[2> <filename> ] [2>> <filename> ]
[>& <filename> ] ]>>& <filename> ]
Start executing the object file, passing arguments as command line arguments; < or > can be used to redirect input or output in a shell-like manner. When "rerun" is used without any arguments the previous argument list is passed to the program; otherwise it is identical to run.
Note: Arguments to the run and rerun commands are currently not supported.
return
return <procedure>
Continue until a return to <procedure> is executed, or until the current procedure returns if none is specified.
set <name>
set <name> = <expression>
The set command defines values for dbx variables. The names of these variables cannot conflict with names in the program being debugged, and are expanded to the corresponding expression within other commands. Use "unset" to remove a set variable definition. See also "help set_variables" for definitions of predefined set variables.
skip [<num>]
Resume and ignore the next breakpoint. If "num" is supplied, ignore the next "num" breakpoints.
status [> <filename> ]
status more [> <filename> ]
Display the currently active trace and stop commands with associated dbx subcommands and the remaining thread tskip counts.
step
step <count>
Execute one line. If a count is supplied, execute the next count lines. The difference between this and "next" is that if the line contains a call to a procedure or function the "step" command will enter that procedure or function, while the "next" command will not.
Note: See also: set_variables stepignore.
stepi
stepi <count>
Execute a single instruction. If a count is supplied, execute the next count instructions.
!stop if <condition>
stop at <line-number> ![if <condition>]
stop in <procedure> ![if <condition>]
!stop <variable> [if <condition>]
!stop <variable> at <line-number> [if <condition>]
!stop <variable> in <procedure> [if <condition>]
!stop on load ["<module>"] [if <condition>]
!stop on load ["<module>(<member>)"] [if <condition>]
Stop execution when the given line is reached, procedure or function entered, variable changed, module loaded or unloaded, or condition true.
Note: ! is not currently supported.
unset <name>
Remove the definition for <name>
whatis <name>
Print the declaration of the given name.
where [startframe endframe] [> <filename>]
Print out a stack trace of the active procedures and functions associated with the frame numbers startframe to endframe. Set stack_details for verbose stack trace.
visual <hostname> <port-number>
Attach IDBX debugger to a UI workbench at the specified host and port of the UI daemon.

Feedback