[csw-maintainers] Debugging with Sun Studio and mGAR

Maciej (Matchek) Blizinski maciej at opencsw.org
Wed Jul 8 18:55:21 CEST 2009


On Wed, Jun 24, 2009 at 8:36 PM, Sebastian Kayser<skayser at opencsw.org> wrote:
> I guess it doesn't fully cover your answer, but regarding GAR, you can set
> GARFLAVOR to DBG if you want your binaries built with debugging symbols.
> This will also skip the step where GAR strips all the binaries. See [1].

cups makefiles do honor CFLAGS, so GARFLAVOR = DBG, I can see that the
flag -g is present in compiler invocations.

Using ALL_CFLAGS=-I.. -D_CUPS_SOURCE -I/usr/include/kerberosv5
-I/export/home/blizinski/build.5.10-i386/opt/csw/include
-I/opt/csw/include -I/usr/include/kerberosv5 -g
-I/export/home/blizinski/build.5.10-i386/opt/csw/include
-I/opt/csw/include  -DOPENSSL_DISABLE_OLD_DES_SUPPORT
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
Using ALL_CXXFLAGS=-I.. -D_CUPS_SOURCE -I/usr/include/kerberosv5
-I/export/home/blizinski/build.5.10-i386/opt/csw/include
-I/opt/csw/include -g
-I/export/home/blizinski/build.5.10-i386/opt/csw/include
-I/opt/csw/include -DOPENSSL_DISABLE_OLD_DES_SUPPORT
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
Using LDFLAGS=-L../cups -L../filter
-L/export/home/blizinski/build.5.10-i386/opt/csw/lib -L/opt/csw/lib
-R/opt/csw/lib   -w -KPIC -xO2
Using LIBS=-lcups -lssl -lcrypto -lpthread -lresolv -lnsl -lsocket -lm

The binary is in fact not stripped:

$ file cups-polld
cups-polld:     ELF 32-bit LSB executable 80386 Version 1 [FPU],
dynamically linked, not stripped

However, it doesn't seem to be compiled without optimization: when I
run it under the Sun Studio debugger, and display the call stack, I
see:

main(argc = ???, argv = ???) (optimized)

Is there a way to check whether the binary is actually optimized
during compilation?

Maciej



More information about the maintainers mailing list