KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q11877: Debugging Routines That Are in Libraries

Article: Q11877
Product(s): See article
Version(s): 1.00 1.10 2.00 2.10 2.20 2.30 | 2.20 2.30
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | TAR55321 | mspl13_basic
Last Modified: 21-AUG-1989

Question:

When CodeView attempts to debug a function from a library module, it
is unable to find the source even when that module was compiled with
-Zi. It prompts me to "Enter Directory for Program (CR for None)?". I
enter the directory in which PROGRAM.C resides, but CodeView cannot
find it. Is there any solution other than not placing modules I wish
to debug in libraries?

Response:

This is a consequence of the way the LIB utility works. When adding an
object module to a library, LIB records only the source file's base
name, not its extension. Therefore, "c:\c\source\module1.c" becomes
"c:\c\source\module1" (no extension). When you are debugging an
application that calls "module1", CodeView attempts to find
"c:\c\source\module1". However, it does not accept the filename you
give because the file is really named "module1.c".

One way to work around this restriction is to rename your source file
from "c:\c\source\module1.c" to "c:\c\source\module1" (no extension)
after you have compiled it and put it into a library. This way, the
actual name will match the name CodeView is searching for.

Another solution is to use Library Manager Version 3.07 (which came
with MASM 5.00) or later; this solves the problem by not stripping the
file's extension as it is put into a library.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.