bug.h
//
// bug.h
//
// Copyright (C) 1996 Limit Point Systems, Inc.
//
// Author: Curtis Janssen <cljanss@limitpt.com>
// Maintainer: LPS
//
// This file is part of the SC Toolkit.
//
// The SC Toolkit is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// The SC Toolkit is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public License
// along with the SC Toolkit; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
//
// The U.S. Government is granted a limited license as per AL 91-7.
//
#ifdef __GNUG__
#pragma interface
#endif
#ifndef _util_misc_bug_h
#define _util_misc_bug_h
#include <util/class/class.h>
#include <util/state/state.h>
#include <util/ref/ref.h>
namespace sc {
class Debugger: public SavableState {
protected:
char *prefix_;
char *exec_;
char *cmd_;
volatile int debugger_ready_;
int debug_;
int traceback_;
int exit_on_signal_;
int sleep_;
int wait_for_debugger_;
int handle_sigint_;
int *mysigs_;
void init();
static Debugger *default_debugger_;
public:
Debugger(const char *exec = 0);
Debugger(const Ref<KeyVal>&);
Debugger(StateIn&);
~Debugger();
virtual void debug(const char *reason = 0);
virtual void traceback(const char *reason = 0);
virtual void set_debug_on_signal(int);
virtual void set_traceback_on_signal(int);
virtual void set_exit_on_signal(int);
virtual void set_wait_for_debugger(int);
virtual void handle(int sig);
virtual void handle_defaults();
virtual void set_prefix(const char *p);
virtual void set_prefix(int p);
virtual void set_cmd(const char *);
virtual void default_cmd();
virtual void set_exec(const char *);
virtual void got_signal(int sig);
static void set_default_debugger(const Ref<Debugger> &);
static Debugger *default_debugger();
void save_data_state(StateOut&);
};
}
#endif
// Local Variables:
// mode: c++
// c-file-style: "CLJ"
// End: