Oct 7, 2009

Debugging on AIX ( 5.3 ) system

Currently I'm porting software to AIX.

As the compiler I'm using GCC.
The linking stage on AIX  is a lot different to other UNIX systems.
AIX likes to resolve the symbols already at link time. So if you are generating
shared objects the should also resovle every symbol at link time. Using the
Option -Wl,-G during GCC linking, the resolving is postponed to runtime.

You can this also do during building of applications, but you do not recognize if
a symbol is not found.

During the runtime, I also haven't recognized that a symbol could not be resovled.

So I go back that everything must be resolved during linking.
The application has everything recored, where the libs should be found,
but this can be changed by setting the environment variable LIBPATH.

For debugging you should set -gxcoff, because AIX uses the COFF format.
Solaris uses ELF.

When you have installed the debugging package there is also a dbx tool .
# lslpp -w `which dbx`
  File                                   Fileset               Type
  -----------------------------------------------------------------------
  /usr/bin/dbx                           bos.adt.debug         Symlink

Install with smitty the bos.adt.debug.

dbx behaves as on Solaris with the SunStudio. It is a command line tool.
You can debug core files.

dbx
To see the source files, you have to set the path to the source:
use /path/to/source
use + /second/path/to/source
stop in works as in SunStudio dbx.