MPQC 2.3.1

- Main Page
- Related Pages
- Classes
- Files

- File List

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
    00039 namespace sc {
    00040
    00046 class Debugger: public SavableState {
    00047   protected:
    00048     char *prefix_;
    00049     char *exec_;
    00050     char *cmd_;
    00051     volatile int debugger_ready_;
    00052
    00053     int debug_;
    00054     int traceback_;
    00055     int exit_on_signal_;
    00056     int sleep_;
    00057     int wait_for_debugger_;
    00058     int handle_sigint_;
    00059     int *mysigs_;
    00060
    00061     void init();
    00062
    00063     static Debugger *default_debugger_;
    00064   public:
    00065     Debugger(const char *exec = 0);
    00066
    00096     Debugger(const Ref<KeyVal>&);
    00097
    00098     Debugger(StateIn&);
    00099     ~Debugger();
    00100
    00103     virtual void debug(const char *reason = 0);
    00109     virtual void traceback(const char *reason = 0);
    00111     virtual void set_debug_on_signal(int);
    00113     virtual void set_traceback_on_signal(int);
    00115     virtual void set_exit_on_signal(int);
    00119     virtual void set_wait_for_debugger(int);
    00120
    00122     virtual void handle(int sig);
    00124     virtual void handle_defaults();
    00125
    00127     virtual void set_prefix(const char *p);
    00129     virtual void set_prefix(int p);
    00130
    00136     virtual void set_cmd(const char *);
    00138     virtual void default_cmd();
    00142     virtual void set_exec(const char *);
    00143
    00145     virtual void got_signal(int sig);
    00146
    00148     static void set_default_debugger(const Ref<Debugger> &);
    00150     static Debugger *default_debugger();
    00151
    00152     void save_data_state(StateOut&);
    00153 };
    00154
    00155 }
    00156
    00157 #endif
    00158
    00159 // Local Variables:
    00160 // mode: c++
    00161 // c-file-style: "CLJ"
    00162 // End: