2010-02-28 16:54:25 +01:00
|
|
|
/* exception.h
|
|
|
|
|
2012-02-12 23:43:33 +01:00
|
|
|
Copyright 2010, 2011, 2012 Red Hat, Inc.
|
2010-02-28 16:54:25 +01:00
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
2012-02-12 23:43:33 +01:00
|
|
|
#pragma once
|
2010-02-28 16:54:25 +01:00
|
|
|
|
|
|
|
#include <exceptions.h>
|
|
|
|
|
|
|
|
extern exception_list *_except_list asm ("%fs:0");
|
|
|
|
|
|
|
|
class exception
|
|
|
|
{
|
|
|
|
exception_list el;
|
|
|
|
exception_list *save;
|
|
|
|
static int handle (EXCEPTION_RECORD *, exception_list *, CONTEXT *, void *);
|
|
|
|
public:
|
|
|
|
exception () __attribute__ ((always_inline))
|
|
|
|
{
|
|
|
|
save = _except_list;
|
|
|
|
el.handler = handle;
|
|
|
|
el.prev = _except_list;
|
|
|
|
_except_list = ⪙
|
|
|
|
};
|
|
|
|
~exception () __attribute__ ((always_inline)) { _except_list = save; }
|
|
|
|
};
|
|
|
|
|
2012-02-12 23:43:33 +01:00
|
|
|
void stackdump (DWORD, CONTEXT * = NULL, EXCEPTION_RECORD * = NULL);
|
|
|
|
extern void inline
|
|
|
|
stackdump (DWORD n, bool)
|
|
|
|
{
|
|
|
|
stackdump (n, (CONTEXT *) 1);
|
|
|
|
}
|
2010-02-28 16:54:25 +01:00
|
|
|
|