Newsgroups: comp.windows.x
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!retix!jay
From: jay@retix.retix.com (Jay Logue)
Subject: Re: -g libs on System V
Message-ID: <1991Jun25.012006.1281@retix.retix.com>
Keywords: System V, Motif
Organization: Retix, Santa Monica CA
References: <10570@aspect.UUCP>
Date: Tue, 25 Jun 1991 01:20:06 GMT

In article <10570@aspect.UUCP> bobj@aspect.UUCP (Bob Joyce) writes:
>
>
>I recently ported a Motif-based program from a Sun Sparc machine to a Motorola 
>MPC 200 running System V.  In both cases the program contained a "-g" version
>of the Motif library.  
>
>Two things surprised me:
>
>	(1) The executable size was ~6 Meg on the sparc, but ~13 Meg on the
>	    MPC.

Hmm.  Does your system use shared X libraries?  I'll bet sun's does.

>
>	(2) Starting up the executable on the MPC under gdb took about 
>	    20 minutes!.  Reason - the process consumed more than
>	    40 Megabytes of memory, thereby causing intense swapping.
>	    On the sparc, gdb started up in less than a minute and consumed
>	    only about 6 Megs.  The same problem occurs with sdb and on
>	    another System V, Motorola platform.

Sounds like the same problem we encountered: lack of incremental
loading of symbols.  GDB configured for DBX symbol information does
incremental loading (i.e. symbol information is loaded on an as-needed
basis).  However, GDB configured for use with SDB type symbol
information (as it is on most System Vs) does not.  All symbols are
loaded at start-up time, which for large executables means a long wait
and a lot of memory.

>
>Is this problem common to System V architectures?  Is it particular to 
>Motorola?  Have other Motif developers experienced high memory consumption
>when they compile with "-g"?   Do developers have to be very selective
>about their use of "-g"?
>

I would guess that this is a problem for most if not all
implemenations of sdb.  Futhermore, I dont think anyone has produced a
patch to GDB to allow incremental loading of SDB style symbols.

We solved it by using the GCOFF patchs for the gnu tools.  (Okay,
someone help me out!  Who produced these patches?)  They modify GCC
and GAS to produce DBX style symbols inbeded within SDB records.  The
resultant .o's can still be linked with the native linker but must be
debugged with a patched version of GDB.  You get all the benefits of
the DBX environment (such as incremental loading and proper handling
of symbols information that the ATT assembler cant hack) without
having to resort to using the COFF encapsulation stuff.  But you have
to use GCC/GAS.

>					
>					Bob Joyce
>					uunet!aspect!bobj
>					(408) 441-2236
>

Jay Logue

===============================================================================
Retix

USMail: 2644 30th Street, Santa Monica, CA 90405-3009 U.S.A
   Tel:	(213) 399-1611
   Fax:	(213) 458-2685
 Telex: 4944307
E-mail:	jay@retix.retix.com
 X.400:	C=US;ADMD=TELEMAIL;PRMD=RETIX;O=OSI ONE;S=LOGUE;G=JAY
===============================================================================
