Skip to main content
13-Aquamarine
December 11, 2020
Question

Stop Creo fatal error handler (traceback.log) and allow debuggers to take care of exceptions

  • December 11, 2020
  • 0 replies
  • 1108 views

ToolKit debug with Windows SDK cdb.exe debugger by dropping breakpoint __debugbreak() in trouble.

How to allow debugger, like cdb.exe from Windows SDK, to work?

 

Debug a ToolKit visit action function and trying to drop a breakpoint, which in Visual C is __debugbreak() , for Windows SDK debugger CDB.EXE to get the control : 

 

ProError UserDimensionVisitAction(ProDimension* dimension, ProError filter_status, ProAppData app_data){
 ProError status;
 if (g_debug) __debugbreak(); // <------- drop an int3 breakpoint in Microsoft way
 status = ProArrayObjectAdd(
 (ProArray*) app_data,
 PRO_VALUE_UNUSED, 
 1, 
 dimension 
 );
 fprintf(g_pLog, "ProArrayObjectAdd(): %d \n", status); fflush(g_pLog);
 if (status != PRO_TK_NO_ERROR) return PRO_TK_GENERAL_ERROR;
 else return PRO_TK_NO_ERROR; // or the caller will stop running
}

 

 But the breakpoint goes to Creo's fatal error handler first like this:

 

traceback.log

-------------------------------------------------
The trace creation timestamp is: Sat Dec 12 04:28:35 20
The executable build timestamp is: Thu Sep 01 16:20:15 16
The datecode is: 2016240
The pro machine type is: x86e_win64
The process ID is: 36348
The traceback type is : CRASH
The logger exit status is: 01003
-------------------------------------------------
Exception EXCEPTION_BREAKPOINT has occurred in the thread 20208. <---- my breakpoint!!

Main Thread 20208
===================== VVVVVVVVVVVVVVVVVVVVVV my program, 86 is the line __debugbreak() called 
0x00007FFD145618D0	DrwEx22 (drwex22.c:86) (dim_exercise:0x00007FFD14560000) ( 0x0, 0x3fc9a6e0, 0x3fc9a6b0, 0x1e155520 ) 
0x00007FFD3FC32769	NULL (NULL:0) (libui_sh:0x00007FFD3F9F0000) ( 0x1, 0x2cc157c4, 0x3fb57f90, 0x0 ) 
0x00007FFD3FB5B8DC	NULL (NULL:0) (libui_sh:0x00007FFD3F9F0000) ( 0x9eef350, 0x0, 0x1e6134b0, 0x13ada30 ) 
0x00007FF72C35AEA9	NULL (NULL:0) (xtop:0x00007FF726990000) ( 0x13ad890, 0x0, 0x0, 0x0 ) 
0x00007FF72C35B709	NULL (NULL:0) (xtop:0x00007FF726990000) ( 0x23, 0x13adc40, 0x0, 0xffffffff ) 

.... snip ......

 

so how to avoid the fatal error which is actually a breakpoint for debugging ?