/*
Copyright (C) 2006 - 2009 Evan Teran
                   eteran@alum.rit.edu

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef DEBUGGERCOREBASE_20090529_H_
#define DEBUGGERCOREBASE_20090529_H_

#include "DebuggerCoreInterface.h"

class QProcess;

class DebuggerCoreBase : public QObject, public DebuggerCoreInterface {
public:
	DebuggerCoreBase();
	virtual ~DebuggerCoreBase();
	
public:
	// thread support stuff (optional)
	virtual QList<edb::tid_t> threadIDs() const;
	virtual edb::tid_t activeThread() const;
	virtual void setActiveThread(edb::tid_t);

public:
	virtual bool open(const QString &path, const QString &cwd, const QStringList &args);
	virtual bool open(const QString &path, const QString &cwd, const QStringList &args, const QString &tty) = 0;
	
public:
	virtual int breakpointSize() const;
	virtual void setBreakpointCondition(edb::address_t address, const QString &condition);
	virtual QString getBreakpointCondition(edb::address_t address);
	virtual void addBreakpoint(edb::address_t address, bool oneTime = false);
	virtual void removeBreakpoint(edb::address_t address);
	virtual edb::address_t disableBreakpoint(edb::address_t address);
	virtual edb::address_t enableBreakpoint(edb::address_t address);
	virtual BreakpointState backupBreakpoints() const;
	virtual QSharedPointer<Breakpoint> findBreakpoint(edb::address_t address);
	virtual void clearBreakpoints();

public:
	virtual edb::pid_t pid() const;
	
protected:
	bool attached() const;

protected:
	edb::tid_t			m_ActiveThread;
	edb::pid_t			m_PID;
	BreakpointState		m_Breakpoints;
};

#endif
