Patent ID: 7996722

Claim:
In association with an application process that comprises multiple threads, wherein threads of the process are disposed to run on a data processing system, and each thread can have a user mode machine state or a kernel mode machine state, or both, selectively, when the thread is running, a method comprising the steps of: allocating a specified memory location for each of said threads; responsive to a given thread entering a kernel mode machine state, selectively saving the user mode machine state of the given thread, wherein said saved user mode machine state comprises the state of the given thread immediately prior to the given thread entering the kernel mode machine state; responsive to the given thread entering a sleep state, selectively saving the kernel mode machine state of the given thread in the specified memory location for the given thread, wherein said saved kernel mode machine state comprises the state of the given thread immediately prior to the given thread entering the sleep state; responsive to detecting a hang condition in the operation of said process, attaching a debugger to said process to access at least said saved user mode machine states; responsive to attaching said debugger, duplicating said saved kernel mode machine state in the specified location, and saving said duplicated kernel mode machine state; analyzing information provided at least by said accessed user mode machine state to determine the cause of said hang condition; and after determining the cause of said hang condition, restoring the state of said given thread to said saved kernel mode machine state, and resuming execution of said application process.