|
Step 0.0
Setup Debug Assistant
Please remember, for a successful install, you need to have either Visual Studio 2005/2008 or both installed
on your machine. Also, close all instances of Visual Studio. If you have a previous installation of Debug Assistant
please go to Control Panel to uninstall it, before installation.
After install, start Visual Studio 2005/2008,
"DebugAssist" should appear in Visual Studio menu just next to "Tools" menu. Click on "Show Trace Window", a
tool window opens. This is Debug Assistant's main interface. Drag and dock this window to the bottom of Visual
Studio main window if it is not already there. This
step is only necessary at the time you install Debug Assistant.
Step 0.1
Setup Trace Scope
In Debug Assistant window, click on Setup Trace Scope. Depending solution size, it may take
a few seconds to retrieve solution hierarchy, but the information is cached later on until
the hierarchy has changed.
There are 5 areas to fill out.
Area 1 - A treeview of the solution hierarchy including
projects, directories, files. You select by ticking the checkboxes on any level. Right
click on items you will see menus for other actions. Add Module is to add projects that
is not in current solutions.
Area 2 - If a project is highlighted on the treeview on the
left, this area shows the full path of the project output (DLL or EXE). By default,
it is filled with macro $(ProjectOutputFile), which is the project output in your
project settings. If module file is in different place, you need to change it using Browse button. Be aware the value of $(ProjectOutputFile) depends on build configurations. It can
be different between Debug build and Release build. If in Release build, there is
no debug information is generated, then you will not get trace result for this module.
Area 3 - Setup function exceptions list. This is a list of functions you
ignore in trace. The format is function names separated by spaces, tabs, line returns,
";", ",". If you want to trace certain functions only, put functions inside of {},
like {MyFuncName, MyFuncName2}. If you have trace only like this, all exceptions
outside of brackets are ignored. Exception list can be inherited along the project hierarchy.
Area 4 - If
the .pdb file is not in the same directory with the module file (DLL, EXE), or you
have moved the .pdb files from its original location where they are
generated, you need to tell Debug
Assistant where they are. And check your project settings: C/C++->General->Debug information format,
make sure "Disabled" is not selected in current build.
Area 5 - You need to tell Debug Assistant the path of the startup
executable. This would be the main module of the traced process. You may also give
the startup executable command line arguments.
The trace settings you filled here is remembered, next time you open the same solution,
the settings will be loaded up automatically.
Step 1. Start Process/Attach Process
Now, we are ready to startup the program
to trace its execution by clicking Start Process button, or trace a program that
is already started by clicking Attach Process button. In either case, you will be
asked to trace functions only or trace every line. Trace functions only is faster
and you get less trace data. It is good if trace scope is large, and you think there
is going to be a lot of trace result or you have no idea. Usually, you choose trace
function first, then after change scope or restrict functions to trace, when you are
sure result is not large, use trace every line to get detailed result that you
want.
Click Show Trace Message button to check if there are warnings or errors during instrumentation
and process startup.
Step 2. Turn on the Trace
Program execution is not recorded until
you turn on the trace by clicking Turn On Trace button. From then on, your program
execution is recorded until you turn trace off by Click Turn Off Trace button. You
can turn trace on/off at any time. Depending on situation, after turn on trace,
you may feel a little slow down on your program, in most of cases it won't be a
problem.
Step 3. Show Trace Result
Click Show Trace Result button, Debug
Assistant window turns to result view. Move mouse around to highlight each trace
point, on the top of window is the description of the current selected trace point.
Result is organized by hierarchy of functions.
The very top is the root node, that includes
all the top level functions that were called. In each function or root node, there are
regular lines , function calls ,
loops . Different color shows percentage time spent
on this code inside of its calling function. Blue is less than 10%, green is 10~30%,
orange is 30~50%, Red is over 50%. You can click to open/close function and loop nodes.
Please note, the way a loop is wrapped up is: only first N-1 loops are wrapped up in one node,
the last loop is not. Click on function to highlight it. Then a slider appears.
If you put mouse on it, an arrow appears . Then drag and move slider, you will see current node
is selected in code window. Arrow button allow you to replay a function from any where. while
it is playing, click anywhere to pause.
Trace and show results take memory, after finish using current result, it is recommended
that you may dispose result by clicking Purge Trace Result Button.
You may have noticed that there are Save/Open Trace Result buttons, you can use
them to save result for latter review.
The End
Yes. This short tutorial covers almost
everything you need to know. That doesn't mean it is always easy and painless to
get the result you want. Sometimes you may get too much result that makes
it hard to find your point of interest. What you need to do is: limiting files selected,
adding function exceptions, or even just tracing certain functions only.
Basically, you can start to use it now. But to make your experience as smooth as possible,
we suggest you follow the walk through page , that walks you through some tracing examples.
In Questions & Answers, you will find some tips for
solving problems you may encounter.
For further information, please read the complete documentation.
|
Voice from our clients
"If you have a large project, programmer spend a lot of time figuring out what is
going on in the code. That's where Debug Assistant can help. It's a great tool.”
|