How to Suspend and Detach an Application Process to Attach a Debugger

Applies to: AppAcceleratorV.dll 4.5.1810.22916

Purpose

The purpose of this article is to detail how to configure Cloudhouse's AppAcceleratorV (AAV) Suspend and Detach mode, which can help debug a crashing application running in a Cloudhouse Compatibility Container™.

Overview

Sometimes it is hard to diagnose application faults or problems occurring early in an application's startup sequence, as there is insufficient time to attach a debugger to the process before an error occurs.

AAV provides a Suspend and Detach mode you can enable for an application process. Once the application has started, AAV will immediately detach, allowing you to attach a debugger such as WinDbg to the application process. 

The following configurations are possible, each detailed below:

Step-by-step process

To configure any of these configurations:

  1. Navigate to the Container's folder.
  2. Edit the AppAcceleratorV.clc in a text editor such as NotePad++
  3. Add the relevant entries for the required configuration to this file.
  4. Save the file.

Suspending a Process

To suspend a process, add the following entries replacing someprocess.exe with the name of the process you want to suspend.  In this example, when someprocess.exe runs under AAV, the process will be hooked, suspended, and then AAV will detach and exit logging a message.

<Detaches>
   <Detach Suspend=”true”>someprocess.exe</Detach>
</Detaches>

Unsuspending a Process

To unsuspend a process, add the following entries replacing someapp.exe with the name of the process you want to unsuspend.  In this example, when the AAV process is started, the someapp.exe process will be hooked, and AAV will be detached.

<Detaches>
  <Detach Suspend=”false”>someapp.exe</Detach>
</Detaches>
<Exe>someapp.exe</exe>

Suspending a Child Process

To suspend a child process, add the following entries replacing somechildprocess.exe with the name of the child process you want to suspend.  In this example, when AAV runs and you launch somechildprocess.exe from someapp.exe, the child process will be hooked and suspended before AAV is detached from the child process and a message logged to the child process' log; someapp.exe will continue to run under AAV.

<Detaches>
  <Detach Suspend=”true”>somechildprocess.exe</Detach>
</Detaches>
<Exe>someapp.exe</Exe>

Detaching a Process

To detach a process, add the following entries replacing someapp.exe with the name of the process you want to detach.  In this example, when AAV starts, the someapp.exe process will be hooked, and AAV will be detached.

<Detaches>
   <Detach>someapp.exe</Detach>
   </Detaches>
<Exe>someapp.exe</exe>

Resuming Suspended Processes

To resume a suspended process, use ProcessHacker or WinDbg to restart the application process suspended by AAV.

Was this article helpful?

Can't find what you're looking for?

Contact Support