Home Tutorial Win32 API Reference Projects

Stony Brook Modula-2Stony Brook Modula-2 archive

Preparing for debugging

The debugger can operate on any executable file, but to get themost out of your debugger, you should prepare for debugging by creating an executable file with symbolic debug information.

Note: Due to operating system limitations Win16 applications may not be debugged with the debugger on Windows 95/98/Me. Win16 applications may be debugged under the Windows NT operating system. Win32 applications canbe debugged under both operating systems.

The Modula-2 and Ada95 compilers can provide any or all of thefollowing information to the debugger:

  • The location of the code generated for each source line in your program.
  • The name and definition of each type name declared in your program.
  • The name and location of each variable and typed constant in your program.
  • The name and location of each procedure and function in your program.
  • The name and location of each public variable and public procedure in your program. In Modula-2, public procedures and variables are those declared in a Definition module, or those declared with the external keyword. In Ada95, public procedures and variables are those declared in a library package specification, or those declared with the external keyword.

Source versus machine level debugging

The debugger is designed to operate at two different levels.

When debugging at machine level, you do not need any debugging information. You cannot see the source code of your program, and cannot refer to variables and procedures by name. You can view the machine code of the program and step through the program and perform all debugger functions using absolute addresses. But this is the only level at which you can operate if you have an executable file with no sources and no symbolic debug information.

When debugging at source level, you must include symbolic debug information in your executable. With symbolic debug information, you can stepthrough your program by source lines, and refer to variables, types, and procedures from your program by name. This is by far the preferred method when you havethe sources to the program.

Including symbolic debug information

The help for the development environment provides full information about generating debuggable programs.

Debug information from other languages

The debugger can use information output from object modules produced by an assembler or another compiler that supports the CodeView style debugging information.

Refer to the documentation of your assembler or compiler to determinewhether it can produce CodeView debug information, and follow the instructions onhow to enable that information.


© Norman Black, Stony Brook Software. Reproduced with permission.