Hi everybody!

We are not able to use the debugger with some of our applications, and I
found why. The following test app:

#include <stdio.h>
void main()
{   
  int* p = NULL;

  __try
  { 
    printf("in try\n");
    *p = 1;
  }
  __except(1)
  {
    printf("in except\n");
  }   
}

will work fine when running under wine, but if you start the application with the 
debugger, it will stop on a page fault exception. 

I think the problem is that DEBUG_HandleException is called, but the condition

    if (first_chance && !Options.debug && !force ) return 0;  /* pass to app first */

is false (Options.debug == 1), so the app does not get the exception first and the 
debugger think we have a page fault. Is there a way to know we are in a __try / 
__except context? Do you have any ideas how to get it working?

In our apps, we are using this __try / __except mechanism to find if the application 
is running on a Katmai style processor by calling Katmai-specific assembly calls, 
which result in exception on non-Katmai processors...

Any ideas?

David






Reply via email to