sunstudio fortran dbx "no symbolic info for main compile with -g"

First time using sunstudio, I compile my fortran with g77 & -g option but sunstudio debugger says:"no symbolic info for main compile with -g"
[152 byte] By [santana719] at [2007-11-26 8:35:50]
# 1
Try setting a breakpoint in a function called MAIN (upper case) andthen run the program.
ChrisQuenelle at 2007-7-6 22:05:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

Also, here's some info on how to find out whether your app has debug info and how to deal with it: http://developers.sun.com/prodtech/cc/articles/dbxerr.html

Under certain circumstances, GNU compilers generate proprietory debug info that cannot be read by dbx. There should be no such problem with Sun compilers.

MaximKartashev at 2007-7-6 22:05:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
dbx replied: "no symbol MAIN in main"
santana719 at 2007-7-6 22:05:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4

/opt/sun/sunstudio11/bin/dwarfdump GNU-i386-Linux/testtoth

/opt/sun/sunstudio11/bin/dwarfdump: error while loading shared libraries: libelf.so.0: cannot open shared object file: No such file or directory

I looked for the required .so and my system has a simillar one named /usr/lib64/libelf.so.1

santana719 at 2007-7-6 22:05:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5

I will file a bug for the dwarfdump/libelf problem. I can reproduce it here.

As a workaround you can use readelf to show debug information.

I think g77 doesn't create "main" or "MAIN". If your program name is "PROG"

(in the fortran 'program' statement) then try setting a breakpoint in PROG.

--chris

ChrisQuenelle at 2007-7-6 22:05:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6

The dwarfdump problem is fixed in the latest development release.

You can download the Linux Compilers Technology Preview if you want.

Or wait for Sun Studio Express 2 which will also include the Linux products.

As a workaround you can try making a symlink from libelf.so.0 to libelf.so.1

in /usr/lib and see if it works.

--chris

ChrisQuenelle at 2007-7-6 22:05:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 7

I realized right after posting that it might *not* be fixed.

It goes like this:

1. We had a dependency on libelf.so.0 which get dropped from

some releases of Linux.

2. We started shipping our own bundled libelf

3. but somehow the latest dev build doesn't have RPATH set

so it still fails.

I should be able to get this fixed for the next FCS release. Use the workarounds for now.

ChrisQuenelle at 2007-7-6 22:05:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...