Compartilhar via


Debugger Extension Development (Windows CE 5.0)

Send Feedback

When you develop a DLL for a debugger extension, you must adhere to the following guidelines.

  • The name of each command should be an entry point to the DLL. The name of each command must consist entirely of lower-case letters.

  • You must export a WinDbgExtensionDllInit function. When the debugger loads the extension DLL, the debugger first calls the WinDbgExtensionDllInit function.

    The following table shows the parameters the debugger passes to the WinDbgExtensionDllInit function.

    Parameter Description
    Pointer to a structure This structure contains callbacks to functions for standard operations. You should save this pointer in a global variable named ExtensionApis.

    The functions for standard operations are defined in the WDbgExts_CE.h file. Include WDbgExts_CE.h in the source code for your debugger extension and use the function definitions from this file.

    For information about the functions in the WDbgExts_CE.h file, see Debugger Extension Functions.

    Major version This value specifies the major version of the Windows CE OS.
    Minor version This value specifies the build number of the Windows CE OS.
  • You must export an ExtensionApiVersion function.

    When the debugger calls the ExtensionApiVersion function, the function should return a pointer to API_VERSION.

    The version number of the debugger extension DLL must match the version number of the debugger. If the versions numbers do not match, the debugger does not load the DLL.

    You can optionally export a CheckVersion function. The debugger calls the CheckVersion function every time you use your DLL. The CheckVersion function verifies that the version of your DLL matches that of the target device.

    To disable version checking, issue a .noversion command at the command prompt for the debugger.

  • Use the DECLARE_API macro that is defined in the WDbgExts_CE.h file to declare the functions for your extension commands.

    The following code example shows the syntax for the DECLARE_API macro.

    DECLARE_API( XXX )
    {
      code for XXX
    }
    
  • The debugger places a try-except statement around each call to an extension DLL. A problem in your code might cause the extension to malfunction. To resolve the problem, stop and restart the debugger.

See Also

Debugger Extension | Debugger Extension Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.