ChorusOS 5.0 Debugging Guide

Application Debugging Commands

The following application debugging commands are available. Unless otherwise stated, the commands can be used for the standard application debug or for analyzing a process dump. In most cases the arguments are optional and default to the current process number or to the current thread number, depending on the command. For some commands, if you do not pass an argument, the current state is displayed.

target chorusrdb remote_host

Connects to the ChorusOS target for application debug. The compulsory remote_host argument is the name of the target, as visible on the TCP/IP network. GDB registers itself with the debug server and establishes a default pathname translation from host to target, using the NFS mount point information from the target.

rdbloadmode string

Defines the process loading mode. The default mode is synchronous (sync) and potentially causes RPC timeouts if the binary file is very large or if the communication medium between the target and the filesystem is slow (for example, PPP/SLIP over a serial line). This problem does not occur in asynchronous mode (async) . In asynchronous mode it might, however, be necessary to provide the privilege of the process when the debugging tool is running on ChorusOS versions prior to 5.0. By default, the determination is automatic (auto), but the loading can be forced to user mode (user) or to supervisor mode (sup).

rdbpathtranslate hostpath targetpath

Sets the translation scheme of host pathnames into target pathnames for starting applications on the target. If the host pathname begins with hostpath, this portion of the pathname is replaced with targetpath. The default target path is /. rdbpathtranslate and is implicitly set when connecting to a target using target chorusrdb.

rdbport portnumber

Defines the port of the ChorusOS RDB server before performing the target chorusrdb command. The port number can be either a predefined string or a numerical value. Predefined strings may be rdbc, indicating the process default debug port (value is 2072), or rdbd, indicating the process core dump default debug port (value is 0). If you run the debug servers on non-default ports, values above 25 indicate a UDP port and should be used with RDBC, while values from 0 to 25 are slot numbers, or offsets from a certain predefined RPC program number, and should be used with RDBD.

rdbsetenv NAME=value

Defines an environment variable to be passed to the application when it is run. This command is especially useful for setting the value of the LD_LIBRARY_ PATH variable.

rdbtabort thread-id

Performs the threadAbort(2K) system call over the specified thread in the current process. This enables the thread to be unblocked from most blocking system calls.

Use the following control commands to maintain the target and the debug server.

rdbdebug 0|1

Remotely enables or disables the debug traces on the RDB debug server. The server must have been compiled in debug mode.

rdbdetach pid

Detach and free an arbitrary process from the control of the debug server. By default, the process currently being debugged is detached. You should, however, use the standard GDB detach command for this purpose.

rdbkill pid

Kill an arbitrary process on the target. By default, the process currently being debugged is killed. You should, however, use the standard GDB kill command for this purpose.

rdbselftest

Run a self-test of the RDB server. This involves starting ls(1CC) in debug mode and single-stepping it until the end. Traces are issued at every function call and return. The results are displayed on RDB server's standard output.

rdbtraceoptions

Set the tracing options for the RDB client code in GDB.

The following commands show resource lists defined by the RDB server. All threads are identified using ChorusOS thread IDs rather than GDB thread numbers.

info rdbdebugged

Shows the list of processes or core dumps being debugged by the debug server.

info rdbmounted

Lists the filesystems mounted on the target.

info rdbprocesses

Lists the processes running on the target or core dumps known to the debug server. If a process or core dump is attached to the debug server, it is shown at the top of the list.

info rdbthreads pid

Shows the list of threads in a process or core file debugged by the debug server.

The following commands provide various system resources. All threads are identified using ChorusOS thread IDs rather than GDB thread numbers.

info dactor pid

Provides microkernel information about the process identified by pid. This command cannot be used in process dump analysis.

info dactors

Lists all the actors running on the target. This command cannot be used in process dump analysis.

info dallports

Lists all the ChorusOS IPC ports defined on the target. This command cannot be used in process dump analysis.

info dallregs thread-id

Displays all known thread registers inside the current process, by default the current thread. This command is only useful on platforms like the i386, where GDB does not handle all thread registers.

info dallthreads

Displays all threads running on the system. This command cannot be used in process dump analysis.

info dclients

Displays all the clients of the RDB debug server.

info denv

Displays the environment variables of the RDB server, which are passed to newly created processes.

info dlog count

Shows the last count entries of the system log. This command cannot be used in process dump analysis.

info dport port-li

Provides information about the ChorusOS IPC port identified by the local identifier port-li. If port-li is negative, information about the default port of the actor identified by port-li is displayed. This command cannot be used in process dump analysis.

info dports pid

Displays information about the ChorusOS IPC ports in the process pid. This command cannot be used in process dump analysis.

info dprocess pid

Displays information about the process pid. This command cannot be used in process dump analysis.

info dpstat pid

Displays all information maintained for the process pid by the debug server. This is an RDB server debugging command.

info dptd thread-id

Provides per-thread-data (private data) information for a thread. This information notably includes the current error number value. This command cannot be used in process dump analysis.

info dregions pid

Displays information about memory regions in the process pid. This command cannot be used in process dump analysis.

info dsched

Displays scheduler information for the system. This information includes the currently running thread and all other threads in the run queue. This command cannot be used in process dump analysis.

info dthread thread-id

Displays microkernel information about any thread in the system. This command cannot be used in process dump analysis.

info dthreads pid

Displays thread information for the process pid. This command cannot be used in process dump analysis.

set rdbasync

Sets async as the operation mode for the chorusrdb target. This command should be issued only when the chorusrdb target is not active. The command should not be used until the core GDB code actually supports async operations.

The following commands extend the thread management facilities of GDB. All threads are identified using ChorusOS thread IDs rather than GDB thread numbers. It is also possible to pass the thread name.

rdbthread thread-id

Changes the current thread. This command is similar to thread thread-id but uses ChorusOS thread numbers. It does not accept the apply keyword.

thread name thread-id name

Set a name for thread thread-id. This changes the thread name in the system itself, as if threadName(2K) was called. This command cannot be used in process dump analysis.

thread resume [all|allbut] thread-ids

Resumes one or more threads in the process. This command cannot be used in process dump analysis.

thread suspend [all|allbut] thread-ids

Suspends one or more threads in the process. This command cannot be used in process dump analysis.