Home
Auto Debug On Line Help
 
User Script: Auto Debug System

OnException

The OnException event will be called when the debuggee process has an exception.

void OnException(
  LONG dwProcessId,        // The debuggee process ID.
  LONG ExceptionAddress, // The exception address.
  LONG ExceptionCode,    // The exception code.
  LONG ExceptionFlags    // The exception flags.
);

Parameters

dwProcessId
The debuggee process ID.
ExceptionAddress
Address where the exception occurred.
ExceptionCode
Reason the exception occurred. This is the code generated by a hardware exception, or the code specified in the RaiseException function for a software-generated exception.
ExceptionFlags
Exception flags. This member can be either zero, indicating a continuable exception, or EXCEPTION_NONCONTINUABLE indicating a noncontinuable exception. Any attempt to continue execution after a noncontinuable exception causes the EXCEPTION_NONCONTINUABLE_EXCEPTION exception.

Return Values

No return value.

Examples

VBscript Example:

sub main
  addMenuItem "Save Log", "SaveLogFile"
  addMenuItem "Kill Trace Process", "KillTraceProcess"
  startProcess "Notepad.exe", "c:\a.txt"
end sub

sub SaveLogFile
    MsgBox "Call Save Log File"
    saveLog "c:\aaa.dsf"
end sub

sub KillTraceProcess
    MsgBox "Call Kill Process"
    killProcess false
end sub

sub OnException(dwProcessId, ExceptionAddress, ExceptionCode, ExceptionFlags)
   echo dwProcessId & "  " & ExceptionAddress &"  " & ExceptionCode & "  " & ExceptionFlags
end sub

JavaScript Example:

function main(){
  addMenuItem("Save Log", "SaveLogFile");
  addMenuItem("Kill Trace Process", "KillTraceProcess");

  startProcess("Notepad.exe", "c:\a.txt");
}

function SaveLogFile(){
    echo("Call Save Log File");
    saveLog("c:\aaa.dsf");
}

function KillTraceProcess(){
    echo("Call Kill Process");
    killProcess(false);
}

function OnException(dwProcessId, ExceptionAddress, ExceptionCode, ExceptionFlags)
{
   echo (dwProcessId + "  " + ExceptionAddress +"  " + ExceptionCode + "  " + ExceptionFlags);
}

Requirements

Auto Debug for Windows: Unsupport.
Auto Debug Professional: Requires version 5.0 or later.

See Also

Script Information Overview, Script Events, OnBreakPointEntry,OnBreakPointReturn ,OnProcessEnd

Copyright c 2003-2024, www.autodebug.com All Rights Reserved