-
Notifications
You must be signed in to change notification settings - Fork 218
Logging
The MIEngine has logging in it to make it easy to see what commands we are sending to GDB/LLDB, what output GDB/LLDB is returning, and how long each command took.
If you have the MIEngine solution open and you are hitting F5 using the debug configuration, the logging is automatically on. Just open the output window (Debug->Windows->Output) and you can see the interactions that MIEngine is having with the target debugger.
In Visual Studio 2017 and newer, it is easy to enable logging by opening the Visual Studio Command Window (View->Other Windows->Command Window), and use this command to control logging:
Debug.MIDebugLog (/On[:<filename>] | /Off) [/OutputWindow]
Options:
- /On[:] – Turn on MIEngine logging. Optionally specify a file to contain the log. Either the file must be supplied, or the “/OutputWindow” option must appear.
- /Off -- Turn off MIEngine logging. If logging to a file the file is closed.
- /OutputWindow -- Log to the “Debug” pane in the output Window.
The command may be issued at any point. Logging can be turned on and off as often as desired. If you have enabled logging via SetMIDebugLogging.cmd this command will override those settings. Unlike SetMIDebugLogging.cmd, the MIDebugLog state is not remembered between VS invocations.
The Visual Studio 2015 version of MIEngine didn't ship with logging controls built into the command window. But logging can still be enabled from the command prompt by:
- Clone the sources:
git clone https://github.com/Microsoft/MIEngine.git
- Enable logging:
src\MICore\SetMIDebugLogging.cmd on
- Restart Visual Studio
- Try the scenario
- To turn logging back off, run
src\MICore\SetMIDebugLogging.cmd off
- Open %TMP%\Microsoft.MIDebug.log
- SetMIDebugLogging.cmd has no dependencies, so you can copy it to another computer if you don't want to enlist on the target box.
- If you are looking at Android scenarios, there is a '/serverlogging' argument to SetMIDebugLogging.cmd which can be used to turn on gdbserver logging