Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

bug.h

00001 //
00002 // bug.h
00003 //
00004 // Copyright (C) 1996 Limit Point Systems, Inc.
00005 //
00006 // Author: Curtis Janssen <cljanss@limitpt.com>
00007 // Maintainer: LPS
00008 //
00009 // This file is part of the SC Toolkit.
00010 //
00011 // The SC Toolkit is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Library General Public License as published by
00013 // the Free Software Foundation; either version 2, or (at your option)
00014 // any later version.
00015 //
00016 // The SC Toolkit is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 // GNU Library General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Library General Public License
00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00024 //
00025 // The U.S. Government is granted a limited license as per AL 91-7.
00026 //
00027 
00028 #ifdef __GNUG__
00029 #pragma interface
00030 #endif
00031 
00032 #ifndef _util_misc_bug_h
00033 #define _util_misc_bug_h
00034 
00035 #include <util/class/class.h>
00036 #include <util/state/state.h>
00037 #include <util/ref/ref.h>
00038 
00044 class Debugger: public SavableState {
00045   protected:
00046     char *prefix_;
00047     char *exec_;
00048     char *cmd_;
00049     int debugger_ready_;
00050 
00051     int debug_;
00052     int traceback_;
00053     int exit_on_signal_;
00054     int sleep_;
00055     int wait_for_debugger_;
00056     int handle_sigint_;
00057     int *mysigs_;
00058 
00059     void init();
00060 
00061     static Debugger *default_debugger_;
00062   public:
00063     Debugger(const char *exec = 0);
00064 
00094     Debugger(const Ref<KeyVal>&);
00095 
00096     Debugger(StateIn&);
00097     ~Debugger();
00098 
00101     virtual void debug(const char *reason = 0);
00107     virtual void traceback(const char *reason = 0);
00109     virtual void set_debug_on_signal(int);
00111     virtual void set_traceback_on_signal(int);
00113     virtual void set_exit_on_signal(int);
00117     virtual void set_wait_for_debugger(int);
00118 
00120     virtual void handle(int sig);
00122     virtual void handle_defaults();
00123 
00125     virtual void set_prefix(const char *p);
00127     virtual void set_prefix(int p);
00128 
00134     virtual void set_cmd(const char *);
00136     virtual void default_cmd();
00140     virtual void set_exec(const char *);
00141 
00143     virtual void got_signal(int sig);
00144 
00146     static void set_default_debugger(const Ref<Debugger> &);
00148     static Debugger *default_debugger();
00149 
00150     void save_data_state(StateOut&);
00151 };
00152 
00153 
00154 #endif
00155 
00156 // Local Variables:
00157 // mode: c++
00158 // c-file-style: "CLJ"
00159 // End:

Generated at Thu Oct 4 18:08:42 2001 for MPQC 2.0.0 using the documentation package Doxygen 1.2.5.