[alt.msdos.programmer] Debugging library routines in with Turbo C/Debugger

mgardi@watdcsu.waterloo.edu (M.Gardi - ICR) (07/14/89)

Hi,

Does anyone know how to debug into a library routine in Turbo Debugger?

I compiled all the routines in the library with debug info ON and added 
them to a library with TLIB.  The size of the library is only a few bytes
larger than the sum of the .objs so I'm assuming that TLIB didn't strip
the info off.

I link with the /v option of TLink and can debug modules that didn't 
come from a library no problem but not modules from the libraries (even
though I have the source and the debug info seems to be there).  I
couldn't find any mention of this in the Turbo Debugger manual even though
I would think this would be a common need.  

Any pointers would be greatly appreciated,
bruce

bruce Wilson                  | "what you don't spend you don't have to earn..."
zeexsun@watshine.waterloo.edu |    from Blake (a film by Bill Mason)

dmurdoch@watstat.waterloo.edu (Duncan Murdoch) (07/14/89)

In article <6094@watdcsu.waterloo.edu> zeexsun@watshine.waterloo.edu (Bruce Wilson) writes:
>
>Does anyone know how to debug into a library routine in Turbo Debugger?
>

I don't know if this will be any help, but there's a bug in TD that means
it will refuse to debug into any segment which follows an empty segment.
Take a look at the .MAP of your program; if you see any segments with
length 0, then the following segment will be inaccessible.  Turbo Pascal
generates empty segments if you reference a unit but don't use any code
from it; I don't know about Turbo C.

Duncan Murdoch

mgardi@watdcsu.waterloo.edu (M.Gardi - ICR) (07/21/89)

Hi,
Thanks to all who responded.  The problem is that there is a bug in
TLIB.EXE (in v2.0).  When adding .objs to a library, it would strip the 
line number info from the .obj.  Borland has a patch for this which I
found on the net a while back (I grabbed it but didn't have time
to look at it closely and thus forgot about it until now).  I have
applied the patch and everything works perfectly.  The arcs can be
found at simtel20:
	pd1:<msdos.turbo-c>tc2pat.arc		/* fix for tlib */
	pd1:<msdos.borland>td1pat.arc		/* fix for td386 */

They need a program called patch.com which I also had but I don't know
where I got it (I doesn't seem to be at simtel20).  The format of the
patch files is easy so you could probably use debug.

thanks,
bruce

bruce Wilson                  | "what you don't spend you don't have to earn..."
zeexsun@watshine.waterloo.edu |    from Blake (a film by Bill Mason)