HermesCommon  2.0
callstack.h
Go to the documentation of this file.
1 // This file is part of HermesCommon
2 //
3 // Copyright (c) 2009 hp-FEM group at the University of Nevada, Reno (UNR).
4 // Email: hpfem-group@unr.edu, home page: http://hpfem.org/.
5 //
6 // Hermes2D is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published
8 // by the Free Software Foundation; either version 2 of the License,
9 // or (at your option) any later version.
10 //
11 // Hermes2D is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with Hermes2D; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef __HERMES_COMMON_CALLSTACK_H_
23 #define __HERMES_COMMON_CALLSTACK_H_
24 
25 #include "compat.h"
26 #include "common.h"
27 #ifdef WITH_STACKTRACE
28  #ifdef WIN32
29  #include <windows.h>
30  #include "StackWalker.h"
31 
32  class MyStackWalker : public StackWalker
33  {
34  public:
35  MyStackWalker() : StackWalker(StackWalker::RetrieveSymbol & StackWalker::RetrieveLine, NULL, GetCurrentProcessId(), GetCurrentProcess())
36  {
37  int a = 1;
38  }
39  protected:
40  virtual void OnOutput(LPCSTR szText)
41  { printf(szText);}
42  };
43 
44  #endif
45 #endif
46 
48 class HERMES_API CallStack
49 {
50 public:
51  // dump the call stack objects to standard error
52  static void dump(int signalCode);
53 };
54 #endif