Difference between revisions of "GPU621/Sentinel"
(Add screenshots, refine text) |
|||
Line 14: | Line 14: | ||
=== Visual Studio tools for multithreaded debugging === | === Visual Studio tools for multithreaded debugging === | ||
− | Visual Studio provides the developers with a variety of tools to assist with the multithreaded application debugging | + | [[File:Threads.png|200px|thumb|left|alt| Threads Window]] |
− | + | [[File:ParallelStacks.png|200px|thumb|right|alt| Parallel Stacks Window]] | |
− | + | [[File:ParallelWatch.png|200px|thumb|left|alt| Parallel Watch Window]] | |
− | + | [[File:DebugLocation.png|200px|thumb|right|alt| Debug Location Windows]] | |
− | + | [[File:Tasks.png|200px|thumb|left|alt| Tasks Windows]] | |
− | + | [[File:GPUThreads.png|200px|thumb|right|alt|GPU Threads Windows]] | |
− | + | [[File:AttachToProcess.png|200px|thumb|left|alt|Attach to Process Dialog]] | |
− | + | [[File:Processes.png|200px|thumb|right|alt|Processes Window]] | |
− | + | Visual Studio provides the developers with a variety of tools to assist with the multithreaded application debugging: | |
− | + | ||
− | + | 1. '''Threads window''' - Allows to view and manipulate the threads, also provides partial call stack for each of the threads | |
− | + | ||
− | + | 2. '''Thread markers''' - Icon resembling two cloth threads indicating where a thread is stopped. Provides a DataTip containing the name and thread ID, as well as thread manipulation shortcut menu | |
− | + | ||
− | + | 3. '''Parallel Stacks window''' - Shows call stack information for all the threads in the program | |
− | + | ||
− | + | 4. '''Parallel Watch window''' - Tracks the values produced by the multithreaded expression | |
+ | |||
+ | 5. '''Debug Location toolbar''' - Allows manipulating threads and processes | ||
+ | |||
+ | 6. '''Tasks window''' - Lists all the current parallel and scheduled tasks | ||
+ | |||
+ | 7. '''GPU Threads window''' - Allows working with the GPU threads | ||
+ | |||
+ | 8. '''Attach to Process dialog box''' - Allows the developer to attach the VS debugger to the process, enables the process debugging | ||
+ | |||
+ | 9. '''Processes window''' - Lists all the processes currently attached to the debugger | ||
+ | |||
+ | The tools mentioned above can be divided into the following categories depending on the multithreading technique: | ||
+ | |||
+ | 1. Threads - Threads windows, Thread markers, Parallel Stacks window, Parallel Parallel Watch window, Debug Location toolbar | ||
+ | |||
+ | 2. Tasks - Parallel Stacks window, Parallel Watch window, Tasks window | ||
+ | |||
+ | 3. GPU Threads - GPU Threads window | ||
+ | |||
+ | 4. Processes - Attach to Process dialog, Processes window, Debug Location toolbar | ||
+ | |||
+ | For our project, we are going to do OpenMP debugging, so we will need the following tools: | ||
+ | |||
+ | * Breakpoints | ||
+ | * Watch window | ||
+ | * Thread markers | ||
+ | * Threads window | ||
+ | * Parallel Watch window | ||
+ | * Parallel Stacks window | ||
== Basic Debugging Steps == | == Basic Debugging Steps == |
Revision as of 11:07, 21 November 2018
Multithreaded Application Debugging in Visual Studio
- The project is based on the material outlined in "Debug multithreaded applications in Visual Studio" section of MSDN documentation and other related MSDN documentation.
Group Members
Introduction
Multithreaded applications debugging overview
Debugging is one of the crucial software development stages. While all of us know the importance and the basics of debugging in the Visual Studio, debugging the multithreaded applications is more complicated than that of the serial programs we were used to before. The first problem of the multithreaded debugging is keeping track of multiple threads instead of just one as we did with the serial programs. Secondly, having multiple threads introduces new kinds of bugs and issues that can seriously affect the output of the software. Such issues include race conditions and deadlocks. A race condition is the behavior of the system when the output is dependent on the sequence of other events or commands. It becomes a bug when the events are out of order (Race condition wiki). Deadlock is a situation when each member of the group (a group of threads in our case) is waiting for some other member to take action, it typically happens when mutual exclusion is executed incorrectly, and the lock on the resource cannot be released (Deadlock wiki).
Visual Studio tools for multithreaded debugging
Visual Studio provides the developers with a variety of tools to assist with the multithreaded application debugging:
1. Threads window - Allows to view and manipulate the threads, also provides partial call stack for each of the threads
2. Thread markers - Icon resembling two cloth threads indicating where a thread is stopped. Provides a DataTip containing the name and thread ID, as well as thread manipulation shortcut menu
3. Parallel Stacks window - Shows call stack information for all the threads in the program
4. Parallel Watch window - Tracks the values produced by the multithreaded expression
5. Debug Location toolbar - Allows manipulating threads and processes
6. Tasks window - Lists all the current parallel and scheduled tasks
7. GPU Threads window - Allows working with the GPU threads
8. Attach to Process dialog box - Allows the developer to attach the VS debugger to the process, enables the process debugging
9. Processes window - Lists all the processes currently attached to the debugger
The tools mentioned above can be divided into the following categories depending on the multithreading technique:
1. Threads - Threads windows, Thread markers, Parallel Stacks window, Parallel Parallel Watch window, Debug Location toolbar
2. Tasks - Parallel Stacks window, Parallel Watch window, Tasks window
3. GPU Threads - GPU Threads window
4. Processes - Attach to Process dialog, Processes window, Debug Location toolbar
For our project, we are going to do OpenMP debugging, so we will need the following tools:
- Breakpoints
- Watch window
- Thread markers
- Threads window
- Parallel Watch window
- Parallel Stacks window
Basic Debugging Steps
- Setting up a Solution in Visual Studio 2017 Comunity Edition
- Build in Debug mode
- Double-check the outputs
- Start where the bug is
Setting up a Solution in Visual Studio 2017 Comunity Edition
How to Debug Multithreaded Application in VS
- Tools in more detail (maybe show an example ourselves)
- Walkthrough (workshop-style)
Note: Add the link to the configurations