Hello,
I'm doing some exception interception on Windows using DR's drmgr_register_exception_event(event_exception). But I couldn't catch the exception.
My simple program looks like:
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if(argc <2)
{
printf("Syntax: %s <input string>\n", argv[0]);
exit (0);
}
if (argv[1][0] == 'A')
{
abort();
}
return 0;
}
So, abort() function rises status_stack_buffer_overrun exception.
My Client is:
#include "dr_api.h"
#include "drmgr.h"
#include "drx.h"
#include "utils.h"
static void
event_exit(void)
{
dr_printf("Exit\n");
drmgr_exit();
}
static bool
event_exception(void* drcontext, dr_exception_t* excpt)
{
dr_printf("Exception!\n");
return true;
}
DR_EXPORT void
dr_client_main(client_id_t id, int argc, const char *argv[])
{
dr_set_client_name("DynamoRIO Sample Client 'signal'", "
http://dynamorio.org/issues");
dr_printf("client_main\n");
drmgr_init();
drmgr_register_exception_event(event_exception);
}
When abort() function is called, nigher event_exception is not trigered, nor event_exit.
But I think, they both should be triggered.
Could anyone shed some light on this problem?
Thanks