Attaching the Debugger to a Process as It Starts
See Also
You can capture a program as it starts executing and attach
dbxtool to begin debugging it immediately, rather than attaching
dbxtool after the process is running. You might want to do so for
two reasons:
-
To debug the executable in the exact environment and with the
exact arguments it was run with. It is often difficult to
reproduce the execution environment when attaching to a running
process, and capturing long argument strings can be awkward.
-
To attach to the executable at its very beginning. If the
application runs for a very short time or the bug being sought
manifests itself soon after starting, attaching to the process
after it is running might be too late for debugging.
To attach the Debugger to a process as the process starts:
- In the IDE, choose Debug > Allow ss_attach requests to
enable this type of attach. If you have defined remote hosts,
select the host on which you want to enable this type of attach.
-
At the shell prompt in a console window, type the following:
ss_attach program_name [ arguments ]
For detailed information on the ss_attach command, see
the ss_attach(1) man page.
-
A dialog box opens in the IDE displaying the name of the
program and
asking if you want to attach to it.
-
By default, the Project text field displays <no project>
or the name of an existing project that exactly matches the name of the
executable. If you want a different project associated with this executable,
select a project from the Project drop-down list. If you do not want
the executable associated with a project, select <no project> If you want a new project
created for the executable, select <create new project>.
-
Click Yes to attach the program and start debugging it
-
A new debugging session is created for the program, and the
program runs to the first instruction in main().
Legal Notices