Sun Studio 12: Debugging a Program With dbx

ProcedureCreating a Separate Debug File

  1. Create a separate debug file named a.out.debug containing the debugging information.

  2. Strip the debugging information from a.out.

  3. Establish the link between the two files. On Solaris platforms, use the gobjcopy command. On Linux platforms, use the objcopy command.

    On a Linux platform, you can use the command objcopy -help to find out whether or not the -add-gnu-debuglink option is supported on the platform. You can replace the -only-keep-debug option of the objcopy command with the command cp a.out a.out.debug to make a.out.debug a fully executable file.