/*
Copyright (C) 2006 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 BREAKPOINT_20060720_H_
#define BREAKPOINT_20060720_H_

#include <QByteArray>
#include <QString>
#include "Types.h"
#include "API.h"

class EDB_EXPORT Breakpoint {
public:
	Breakpoint(edb::address_t address, bool onetime = false);
	~Breakpoint();
	
public:
	edb::address_t address() const		{ return m_Address; }
	unsigned int hitCount() const		{ return m_HitCount; }
	bool enabled() const				{ return m_Enabled; }
	bool oneTime() const				{ return m_OneTime; }
	QByteArray originalBytes() const	{ return m_OriginalBytes; }

public:
	static const int size = 1;

public:
	bool enable();
	bool disable();
	void hit()					{ m_HitCount++; }
	void setOneTime(bool value)	{ m_OneTime = value; }
		
public:
	QString condition;
	
private:
	edb::address_t			m_Address;
	unsigned int			m_HitCount;
	bool					m_Enabled;
	bool					m_OneTime;
	QByteArray				m_OriginalBytes;
};

#endif

