This example runs a container named test using the debian:latest image. The -it instructs Docker to allocate a pseudo-TTY connected to the container’s stdin; creating an interactive bash shell in the container. In the example, the bash shell is quit by entering exit 13.This exit code is passed on to the caller of docker run, and is recorded in the test container’s metadata.
-->This article covers how to get started with Windows Debugging. If your goal is to use the debugger to analyze a crash dump, see Analyze crash dump files by using WinDbg.
To get started with Windows Debugging, complete the tasks that are described in this article.
1. Determine the host and the target
The debugger runs on the host system, and the code that you want to debug runs on the target system.
Host <--------------------------------------------------> Target
Because it is common to stop instruction execution on the processor during debugging, two computer systems are typically used. In some situations, you might be able to use a virtual machine as the second system. For example, you might be able to use a virtual PC that is running on the same PC as the code that you need to debug. However, if your code is communicating to low-level hardware, using a virtual PC may not be the best approach. For more information, see Setting up network debugging of a virtual machine - KDNET.
2. Determine the type: kernel-mode or user-mode
Next, you need to determine whether you will do kernel-mode or user-mode debugging.
Kernel mode is the processor-access mode in which the operating system and privileged programs run. Kernel-mode code has permission to access any part of the system, and it is not restricted like user-mode code. Kernel-mode code can gain access to any part of any other process running in either user mode or kernel mode. Much of the core OS functionality and many hardware device drivers run in kernel mode.
User mode is the mode that applications and subsystems on the computer run in. Processes that run in user mode do so within their own virtual address spaces. They are restricted from gaining direct access to many parts of the system, including system hardware, memory that was not allocated for their use, and other portions of the system that might compromise system integrity. Because processes that run in user mode are effectively isolated from the system and other user-mode processes, they cannot interfere with these resources.
If your goal is to debug a driver, determine if the driver is a kernel-mode driver or a user-mode driver. Windows Driver Model (WDM) drivers and Kernel-Mode Driver Framework (KMDF) are both kernel-mode drivers. As the name sugests, User-Mode Driver Framework (UMDF) drivers are user-mode drivers.
For some issues, it can be difficult to determine which mode the code executes in. In that case, you may need to pick one mode and look to see what information is available in that mode. Some issues require using the debugger in both user mode and kernel mode.
Depending on what mode you decide to debug in, you will need to configure and use the debuggers in different ways. Some debugging commands operate the same in both modes, and some commands operate differently in different modes.
For information about using the debugger in kernel mode, see the following articles:
Can Irun Dev C++ Using Visual Studio Command Prompts
- Debug drivers - step by step lab (Sysvad kernel-mode).
For information about using the debugger in user mode, see Getting started with WinDbg (user-mode).
3. Choose your debugger environment
WinDbg works well in most situations, but there are times when you may want to use another debugger, such as console debuggers for automation or Visual Studio. For more information, see Debugging environments.
4. Determine how to connect the target and host
Typically, target and host systems are connected by an Ethernet network. If you are doing early bring-up work, or you don't have an Ethernet connection on a device, other network connection options are available. For more information, see these articles:
5. Choose either the 32-bit or 64-bit debugging tools
Which debugging tools to choose—32-bit or 64-bit—depends on the version of Windows that is running on the target and host systems and on whether you are debugging 32-bit or 64-bit code. For more information, see Choosing the 32-Bit or 64-Bit debugging tools.
6. Configure symbols
To use all of the advanced functionality that WinDbg provides, you must load the proper symbols. If you do not have symbols properly configured, you will receive messages indicating that symbols are not available when you attempt to use functionality that is dependent on symbols. For more information, see Symbols for Windows debugging (WinDbg, KD, CDB, NTSD).
7. Configure source code
If your goal is to debug your own source code, you will need to configure a path to your source code. For more information, see Source path.
8. Become familiar with debugger operation
The Debugger operation section of this documentation describes debugger operation for various tasks. For example, Loading debugger extension DLLs explains how to load debugger extensions. To learn more about working with WinDbg, see Debugging using WinDbg.
9. Become familiar with debugging techniques
Standard debugging techniques apply to most debugging scenarios, and examples include setting breakpoints, inspecting the call stack, and finding a memory leak. Specialized debugging techniques apply to particular technologies or types of code. Examples include Plug and Play debugging, KMDF debugging, and RPC debugging.
10. Use the debugger reference commands
Over time, you will use different debugging commands as you work in the debugger. Use the .hh (open HTML help file) command in the debugger to display help information about any debugging command. For more information about the available commands, see Debugger reference.
11. Use debugging extensions for specific technologies
There are multiple debugging extensions that provide parsing of domain-specific data structures. For more information, see Specialized extensions.
12. Learn about related Windows internals
This documentation assumes a knowledge of Windows internals. To learn more about Windows internals (including memory usage, context, threads, and processes), review additional resources, such as Windows Internals by Mark Russinovich, David Solomon, and Alex Ionescu.
13. Review additional debugging resources
Additional resources include the following books and videos:
- Inside Windows Debugging: Practical Debugging and Tracing Strategies by Tarik Soulami
- Advanced Windows Debugging by Mario Hewardt and Daniel Pravat
- Defrag Tools, episodes 13 through 29, about WinDbg
See also
It's time to write your first application! The following instructions are for users of Windows Vista, Windows 7, and Windows 8. Instructions for other platforms are in 'Hello World!' for Solaris OS and Linux and 'Hello World!' for the NetBeans IDE.
If you encounter problems with the instructions on this page, consult the Common Problems (and Their Solutions).
- Creating Your First Application
A Checklist
To write your first program, you'll need:
- The Java SE Development Kit 8 (JDK 8)You can download the Windows version now. (Make sure you download the JDK, not the JRE.) Consult the installation instructions.
- A text editorIn this example, we'll use Notepad, a simple editor included with the Windows platforms. You can easily adapt these instructions if you use a different text editor.
These two items are all you'll need to write your first application.
Creating Your First Application
Your first application,
HelloWorldApp
, will simply display the greeting 'Hello world!'. To create this program, you will: - Create a source fileA source file contains code, written in the Java programming language, that you and other programmers can understand. You can use any text editor to create and edit source files.
- Compile the source file into a .class fileThe Java programming language compiler (
javac
) takes your source file and translates its text into instructions that the Java virtual machine can understand. The instructions contained within this file are known as bytecodes. - Run the programThe Java application launcher tool (
java
) uses the Java virtual machine to run your application.11 rows 8-Bit Shaper (VST and AU) for Mac OSX v1.1 freeware Download: 8BitShaperPC.zip 8-Bit Shaper (VST) for Windows v1.05 freeware Download: InstallXferDimensionExpander.dmg Dimension Expander (VST and AU) for Mac OSX v1.01 freeware Download: DimExpVSTPC.zip Dimension Expander VST FX for Windows. Dimension expander vst free download.
Create a Source File
To create a source file, you have two options:
- You can save the file
HelloWorldApp.java
on your computer and avoid a lot of typing. Then, you can go straight to Compile the Source File into a.class
File. - Or, you can use the following (longer) instructions.
First, start your editor. You can launch the Notepad editor from the Start menu by selecting Programs > Accessories > Notepad. In a new document, type in the following code:
Be Careful When You Type
Note: Type all code, commands, and file names exactly as shown. Both the compiler (
javac
) and launcher (java
) are case-sensitive, so you must capitalize consistently.HelloWorldApp
is not the same as helloworldapp
.Save the code in a file with the name
HelloWorldApp.java
. To do this in Notepad, first choose the File > Save As menu item. Then, in the Save As dialog box:- Using the Save in combo box, specify the folder (directory) where you'll save your file. In this example, the directory is
myapplication
on theC
drive. - In the File name text field, type
'HelloWorldApp.java'
, including the quotation marks. - From the Save as type combo box, choose Text Documents (*.txt).
- In the Encoding combo box, leave the encoding as ANSI.
When you're finished, the dialog box should look like this.
The Save As dialog just before you click Save.
Now click Save, and exit Notepad.
Compile the Source File into a .class File
Bring up a shell, or 'command,' window. You can do this from the Start menu by choosing Run.. and then entering
cmd
. The shell window should look similar to the following figure.A shell window.
The prompt shows your current directory. When you bring up the prompt, your current directory is usually your home directory for Windows XP (as shown in the preceding figure.
To compile your source file, change your current directory to the directory where your file is located. For example, if your source directory is
myapplication
on the C
drive, type the following command at the prompt and press Enter:Now the prompt should change to
Note:C:myapplication>
.To change to a directory on a different drive, you must type an extra command: the name of the drive. For example, to change to the
myapplication
directory on the D
drive, you must enter D:
, as follows:If you enter
dir
at the prompt, you should see your source file, as follows: Graphics in dev c++ mediafire.Now you are ready to compile. At the prompt, type the following command and press Enter.
The compiler has generated a bytecode file,
HelloWorldApp.class
. At the prompt, type dir
to see the new file that was generated as follows:Now that you have a
.class
file, you can run your program.If you encounter problems with the instructions in this step, consult the Common Problems (and Their Solutions). How to plug auto tune eva into audacity online.
Run the Program
In the same directory, enter the following command at the prompt:
You should see the following on your screen:
Congratulations! Your program works!
If you encounter problems with the instructions in this step, consult the Common Problems (and Their Solutions).