Cannot run gdb on AIX 6.1

Hello, I am experiencing a problem trying to use the GNU gdb debugger on my AIX 6.1 system, as follows:

$ gdb
exec(): 0509-036 Cannot load program powerpc64-ibm-aix6.1.2.0-gdb because of the following errors:
        0509-130 Symbol resolution failed for powerpc64-ibm-aix6.1.2.0-gdb because:
        0509-136   Symbol XML_StopParser (number 258) is not exported from
                   dependent module /opt/freeware/lib/libexpat.a[libexpat.so.0].
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command.
$ 

Taking the error message's advice, I see:

$ dump -Tv /opt/freeware/lib/libexpat.a | grep StopParser
[32]    0x20004420    .data      EXP     DS SECdef        [noIMid] XML_StopParser
$ 
$ dump -Tv -X64 `which gdb` | grep StopParser
[258]   0x00000000    undef      IMP     DS EXTref /opt/freeware/lib/libexpat.a(libexpat.so.0) XML_StopParser
$

I might understand this better if I had any significant experience developing C/C++ applications and libraries in a Unix environment, but it sure looks to me like 'XML_STopParser' is exported just fine from the .data segment of libexpat.a , and should satisfy the undef reference in the gdb executable. I don't understand what the problem is. The libexpat.a archive looks a little funny:

$ which ar
/opt/freeware/bin/ar
$ ar -tv libexpat.a 
BFD: BFD 2.14 20030612 assertion fail libbfd.c:561
rwxr-xr-x 0/0 211325 Oct 21 10:21 2008 libexpat.so.1
rwxr-xr-x 0/0 251775 Oct 21 10:20 2008 libexpat.so.1
rwxr-xr-x 0/0 520860 Oct 21 10:21 2008 libexpat.so.0
rwxr-xr-x 0/0 337060 Oct 21 10:21 2008 libexpat.so.0
$ /usr/bin/ar -X64 -tv libexpat.a
rwxr-xr-x     0/0     251775 Oct 21 10:20 2008 libexpat.so.1
rwxr-xr-x     0/0     337060 Oct 21 10:21 2008 libexpat.so.0
$ 

I'm guessing that the gnu version of 'ar' has some kind of problem since it's throwing an assert failure, but even the AIX one lists two versions of libexpat.so ('.0' and '.1' ). Is that normal? It looks verschnoggled to me.

When I google about for the " Symbol is not exported from dependent module " error in AIX I see alot of stuff about tuning/activating Asynchronous I/O and how it's changed from 5.3->6.1, but this seems to be related to the particular symbols not being exported and/or the particular library they are in.

I plan to try deleting one of the '.so.' files if I can ever get 'ar' to do it, but any advice/intelligence would be appreciated.

---------- Post updated at 04:53 PM ---------- Previous update was at 04:45 PM ----------

BTW, after gdb dies as above I have to run 'slibclean' to be able to access llibexpat.a.

I notice the -X64 argument which looks like you are looking for the 64-bit (which is probably what you need) and I am guessing that the routine you are seeing is a 32-bit one.

I will have to play with dump -T to understand it better. What I am normally looking at is the output of dump -H .

I expect you also downloaded some extra rpm's to also install gcc - they may have libraries in a different location. The environment variable LIBPATH can be used to modify the defaults (what the application, in this case gdb , expects - use dump -H).

I am not sure, but I believe the AIX debugger ( dbx ) can be used as well/instead.
Install the fileset bos.adt.debug