What Can Be Debugged

The debug component sees a process as the unit that will be debugged. Debugging is managed on the basis of a connection between a debugger and a process that was started to run the program that is to be debugged. The debugging tool will usually issue either a DosExecPgm or a DosStartSession call to start the program. When starting the program, flags must be set in the call to request that the program be started for debugging. Whether the program is started as a child process in the same session as the debugger or as a process in a child session, the connection between the debugger and the program is process to process.

The debug component can be used to debug programs running in:

  • The same screen group (foreground session)
  • Another screen group
  • Detached mode (background session).

    A debugger may debug more than one process simultaneously, but any process can only be connected to one debugger at any one time. All threads within a process are accessible to the debugger.

    The debugging services allow access to code and data in both a primary executable module and in DLLs. Resources such as DLLs are not associated directly with threads, but are accessed and manipulated by threads. The debug component, therefore, supports debugging of the DLLs by permitting the debugger to observe the memory of the DLL and the registers of a thread while it uses the DLL.

    The debug component notifies the debugging tool when a DLL is loaded, and provides the debugging tool with the handle of the module table entry (MTE) of the DLL. From this the debugging tool is able to determine the name of the DLL by issuing a DosQueryModuleName call.

    The debug component provides control and information at a hardware level. It provides access to a process's registers and memory. It can be used to start a process executing and provide feedback when the process stops executing, usually because a breakpoint has been encountered. It provides a notification when a new thread is created in a process and when the contents of designated memory location change. It does not trace the passage of system API calls through the system. It does not understand resources implemented by the operating system. The debug component provides no information about:

  • Semaphores
  • Pipes
  • Queues
  • Files.

    The debugging tool, therefore, cannot give feedback on the status of semaphores or the contents of pipes and queues. It is up to the debugging tool to provide facilities that the application programmer would find useful. One way of providing these facilities is for the debugging tool to include additional routines in an executable module that is being prepared for debugging. The execution of these routines could be controlled in the same way that the debugging tool controls execution of the program being debugged.

    The debug component cannot be used to debug processes running in virtual 8086 mode (that is, applications executing within a virtual DOS machine).


    [Back: Functional Description]
    [Next: DosDebug() Function]