delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/05/17:17:15

From: Thomas Demmer <demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Debugging version of C library
Date: Mon, 30 Jun 1997 15:45:26 +0100
Organization: Lehrstuhl fuer Stroemungsmechanik
Lines: 43
Message-ID: <33B7C686.2781@LSTM.Ruhr-UNI-Bochum.De>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 970630085908 DOT 21945B-100000 AT is>
NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Eli Zaretskii wrote:
> 
> On 26 Jun 1997, Michael Krause wrote:
> 
> > How do I make a debugging version of the standard C library?
> 
> A straightforward way is to recompile the library with -g.  However,
> since rebuilding the library is not easy, I suggest to extract from
> djlsr201.zip only the functions that you need to debug, compile them
> with -g, put them into the library and relink your program:
> 
>         unzip djlsr201.zip src/libc/foo/bar.c
>         gcc -O3 -g src/libc/foo/bar.c
>         ar rvs lib/libc.a src/libc/foo/bar.o
>         make yourprog
>         gdb yourprog
> 
> After you have finished debugging, recompile the functions without -g
> and put them into the library again (or make a backup copy of libc.a
> before you begin debugging).

I think it will suffice to copy bar.c to the working directory and link
it into the executable:
gcc -o foo.exe -g foo.c bar.c 
bar.o will be seen by the linker _before_ bar.o inside libc and
used (just because ld is a one pass linker. This time
it turns out to be an advantage). So there is no need to fiddle 
around with libc, and probably forgetting to switch back...

-- 
Ciao
Tom

*************************************************************
* Thomas Demmer                                             *
* Lehrstuhl fuer Stroemungsmechanik                         *
* Ruhr-Uni-Bochum                                           *
* Universitaetsstr. 150                                     *
* D-44780  Bochum                                           *
* Tel: +49 234 700 6434                                     *
* Fax: +49 234 709 4162                                     *
* http://www.lstm.ruhr-uni-bochum.de/~demmer                *
*************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019