e52a43f101
* exceptions.cc (stackdump): Rework to perform all operations needed for a stackdump and to avoid recursion. (exception::handle): Use simplified stackdump interface. * sigproc.cc (signal::exit): Ditto. Delete now, uneeded declaration.
38 lines
831 B
C++
38 lines
831 B
C++
/* exception.h
|
|
|
|
Copyright 2010, 2011, 2012 Red Hat, Inc.
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
details. */
|
|
|
|
#pragma once
|
|
|
|
#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; }
|
|
};
|
|
|
|
void stackdump (DWORD, CONTEXT * = NULL, EXCEPTION_RECORD * = NULL);
|
|
extern void inline
|
|
stackdump (DWORD n, bool)
|
|
{
|
|
stackdump (n, (CONTEXT *) 1);
|
|
}
|
|
|