- break FileName:LineNo sets a breakpoint at a location in the source.
- break ~number sets a breakpoint on a symbol recently displayed with the x command.
- break module!ClassName.Method+IlOffset sets a breakpoint on the fully qualified location.
value
as the current option. The following options are currently available: - extpath
sets the path to search for extensions when the load
command is used.
- extpath+
adds a path for loading extensions.
-ad
Num] functionName [args ... ] The -ad
option specifies the application domain to use to resolve the function. If the -ad
option is not specified, the application domain for resolution defaults to the application domain where the thread that is used for function evaluation is located.
If the function that is being evaluated is not static, the first parameter passed in should be a this
pointer. All application domains are searched for arguments to the function evaluation..
To request a value from an application domain, prefix the variable with the module and application domain name; for example, funceval -ad 0 System.Object.ToString hello.exe#0!MyClass.g_rootRef
. This command evaluates the function System.Object.ToString
in the application domain 0
. Because the ToString
method is an instance function, the first parameter must be a this
pointer.
-or-
? [command]
If the debugger encounters an exception, use this command to roll the debugger back to the specified frame number. You can change the program state by using the set command and continue by using the go command.
LoadExtension
from the Microsoft.Tools.Mdbg.Extension.Extension
type.mode
with no options to get a list of the debugging modes and their current settings.-d
]-d
).–r
(recursive) option to traverse the InnerException
property on the exception object to get information about the entire chain of exceptions.*
| [~
]threadNumber] If the threadNumber parameter is specified as *
or if the thread number starts with ~
, the command applies to all threads except the one specified by threadNumber.
Resuming a non-suspended thread has no effect.
-d
(ebug
) | -o
(ptimize
) |-enc
] [[path_to_exe] [args_to_exe]]run
command. If the executable argument is provided, the specified program is run using the optionally supplied arguments.If class load, module load, and thread start events are ignored (as they are by default), the program stops on the first executable instruction of the main thread.
You can force the debugger to just-in-time (JIT) compile the code by using one of the following three flags:
- -d
( ebug
) disables optimizations. This is the default for MDbg.exe.
- -o
( ptimize
) forces the code to run more like it does outside the debugger, but also makes the debugging experience more difficult. This is the default for use outside the debugger.
- -enc
enables the Edit and Continue feature but incurs a performance hit.
You can also create your own debugger variables and assign reference values to them from within your application. These values act as handles to the original value, and even the original value is out of scope. All debugger variables must begin with $
(for example, $var
). Clear these handles by setting them to nothing using the following command:
set $var=
-il
] number-il
option, the number represents a common intermediate language (CIL) offset in the method. Otherwise, the number represents a source line number.*
, the command applies to all threads. If the thread number starts with ~
, the command applies to all threads except the one specified by threadNumber. Suspended threads are excluded from running when the process is run by either the go or step command. If there are no non-suspended threads in the process and you issue the go command, the process will not continue. In that case, press CTRL-C to break into the process. - symbol path
["value"
] - Displays or sets the current symbol path.
- symbol addpath
"value"
- Adds to your current symbol path.
- symbol reload
["module"
] - Reloads either all symbols or the symbols for the specified module.
- symbol list
[module
] - Shows the currently loaded symbols for either all modules or the specified module.
]
-nick
parameter to assign a nickname to a thread. - thread -nick
threadName assigns a nickname to the currently running thread.
Nicknames cannot be numbers. If the current thread already has an assigned nickname, the old nickname is replaced with the new one. If the new nickname is an empty string (""), the nickname for the current thread is deleted and no new nickname is assigned to the thread.
when
statements. when delete all | num
[num
[num
…]] - Deletes the when
statement specified by the number, or all when
statements if all
is specified.
when stopReason
[specific_condition
] docmd
[cmd
[cmd
…] ] - The stopReason parameter can be one of the following:
StepComplete
, ProcessExited
, ThreadCreated
, BreakpointHit
, ModuleLoaded
, ClassLoaded
, AssemblyLoaded
, AssemblyUnloaded
, ControlCTrapped
, ExceptionThrown
, UnhandledExceptionThrown
, AsyncStop
, AttachComplete
, UserBreak
, EvalComplete
, EvalException
, RemapOpportunityReached
, NativeStop
.
specific_condition can be one of the following:
- number - For ThreadCreated
and BreakpointHit
, triggers action only when stopped by a thread ID/breakpoint number with same value.
- [!
]name - For ModuleLoaded
, ClassLoaded
, AssemblyLoaded
, AssemblyUnloaded
, ExceptionThrown
, and UnhandledExceptionThrown
, triggers action only when the name matches the name of the stopReason.
specific_condition must be empty for other values of stopReason.
-v
] [-c
depth] [threadID] - The -v
option provides verbose information about each displayed stack frame.
- Specifying a number for depth
limits how many frames are displayed. Use the all command to display all frames. The default is 100.
- If you specify the threadID parameter, you can control which thread is associated with the stack. The default is the current thread only. Use the all command to get all threads.
-c
numSymbols] [module[!
pattern]]pattern
for a module. If numSymbols is specified, the output is limited to the specified number. If !
(indicating a regular expression) is not specified for pattern, all functions are displayed. If module is not provided, all loaded modules are displayed. Symbols (~#) can be used to set breakpoints using the break command.