IXtfApplicationClient::DebugEnable Method
Enables or disables debugging for the app package with the specified package moniker.
Note Note that you should only set the debug flag for a package when that package is not running. Setting the debug flag on a running package can yield unpredictable results.
Syntax
public:
HRESULT DebugEnable(
LPCWSTR pszPackageMoniker,
BOOL fEnable
)
Parameters
pszPackageMoniker
Type: LPCWSTR
Pointer to the package moniker of the app.
fEnable
Type: BOOL
Specify true to enable debugging; false to disable debugging.
Return value
Type: HRESULT
HRESULT success or error code.
Requirements
Header: Declared in xtfapplication.h.
Library: Use xtfapplication.lib.
Remarks
Setting the debug flag for an app package has the following effects for all apps in the app package:
- The app will not be terminated if it takes longer than 45 seconds to complete activation.
- The app will not be terminated if it takes too long to suspend. (Limit is 1 second for an exclusive app, or 5 seconds for a shared app.)
- The app will not be suspended after losing visibility for too long. (After 10 minutes for exclusive apps, or after 5 seconds for shared apps.)
- To suspend the app, you do not use the /n option in your
xbapp suspend command.
- When your app is in debug mode, it is not subject to normal Process Lifetime Management limits, and will only suspend or resume when you direct it to do so using command line tools. This means that it can be suspended in states where the normal PLM process would not cause it to be suspended, such as when it is visible. Be mindful of this effect when testing suspend and resume behavior, in order to be sure you’re testing normal behavior and not the effects of running in debug mode.
Clearing the debug flag for an app package has the following effects for apps in the app package:
- The app will be terminated if it takes longer than 45 seconds to complete activation.
- The app will be terminated if it takes too long to suspend. (Limit is 1 second for an exclusive app, or 5 seconds for a shared app.)
- The app will be suspended after losing visibility for too long. (After 10 minutes for exclusive apps, or after 5 seconds for shared apps.)
- To suspend the app, you must use the /n option in your
xbapp suspend /n command.
The state of the debug flag applies on a package-wide basis. If you have multiple apps in a single package with the debug flag set, then all of the apps will run in debug mode.
Rebooting your dev kit clears the debug flag.
Running your app from Visual Studio using F5 (Start Debugging) automatically sets the debug flag before running your app, and clears the flag when you stop running your app. If you start with Ctrl+F5 (Start Without Debugging), the debug flag is cleared before your app runs, and remains cleared after your app terminates. If your app crashes while in debug mode while Visual Studio is attached, then Visual Studio will clear the debug flag when it is detached from your app.
The debug flag state does not change in the following situations:
- The debug flag will remain set if the app crashes, as long as the Visual Studio debugger is not attached at the time.
- The debug flag will remain set through a suspend and resume.
- The debug flag will remain set through a termination as long as the Visual Studio debugger is not attached at the time.
See also
Reference
IXtfApplicationClient Interface
IXtfApplicationClient Members
XtfApplication