windbg Debugger - D Programming Language

Menu

- Learn
- Documentation
  - Language Reference
  - Library Reference
  - Command-line Reference
  - Feature Overview
  - Articles
- Downloads
- Packages
- Community
  - Blog
  - Orgs using D
  - Twitter
  - Calendar
  - Forums
  - IRC
  - Wiki
  - GitHub
  - Issues
  - Get involved
  - Contributors
  - Foundation
  - Security Team
  - Donate
  - Sponsors
- Resources
  - Tour
  - Books
  - Tutorials
  - Tools
  - Editors
  - IDEs
  - run.dlang.io
  - Visual D
  - Acknowledgments
  - D Style
  - Glossary
  - Sitemap

Search
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

# windbg Debugger

The Microsoft Windows debugger \dmd2\windows\bin\windbg.exe can be used to symbolically debug D programs, even though it is a C++ debugger. Versions of windbg.exe other than the one supplied may not work with D. (Jascha Wetzel's Ddbg for Windows is also available.)

To prepare a program for symbolic debugging, compile with the -gc switch:

    dmd myprogram -gc

To invoke the debugger on it:

    windbg myprogram args...

where args... are the command line arguments to myprogram.exe.

When the debugger comes up, entering the command in the command window:

    g _Dmain

will execute the program up until the entry into main(). From thence, pressing the F10 key will single step each line of code.

Basic Commands:

F5
  Go until breakpoint, an exception is thrown, or the end of the program.
F7
  Continue until cursor.
F8
  Single step, stepping into function calls.
F10
  Single step, stepping over function calls.

For more comprehensive information on windbg, consult the file \dmd2\windows\bin\windbg.hlp.

Copyright © 1999-2019 by the D Language Foundation | Page generated by Ddoc on Sat Feb 9 23:05:55 2019