2012-11-06 14:45:26 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2012, Rene Gollent, rene@gollent.com.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef WATCHPOINT_H
|
|
|
|
#define WATCHPOINT_H
|
|
|
|
|
|
|
|
|
2012-11-07 17:50:17 +04:00
|
|
|
#include <ObjectList.h>
|
2012-11-06 14:45:26 +04:00
|
|
|
#include <Referenceable.h>
|
|
|
|
|
|
|
|
#include "types/Types.h"
|
|
|
|
|
|
|
|
|
|
|
|
class Watchpoint : public BReferenceable {
|
|
|
|
public:
|
|
|
|
Watchpoint(target_addr_t address, uint32 type,
|
|
|
|
int32 length);
|
|
|
|
~Watchpoint();
|
|
|
|
|
|
|
|
target_addr_t Address() const { return fAddress; }
|
|
|
|
uint32 Type() const { return fType; }
|
|
|
|
int32 Length() const { return fLength; }
|
|
|
|
|
|
|
|
bool IsInstalled() const { return fInstalled; }
|
|
|
|
void SetInstalled(bool installed);
|
|
|
|
|
|
|
|
bool IsEnabled() const { return fEnabled; }
|
|
|
|
void SetEnabled(bool enabled);
|
|
|
|
// WatchpointManager only
|
|
|
|
|
|
|
|
bool ShouldBeInstalled() const
|
|
|
|
{ return fEnabled && !fInstalled; }
|
|
|
|
|
|
|
|
bool Contains(target_addr_t address) const;
|
|
|
|
|
|
|
|
static int CompareWatchpoints(const Watchpoint* a,
|
|
|
|
const Watchpoint* b);
|
|
|
|
static int CompareAddressWatchpoint(
|
|
|
|
const target_addr_t* address,
|
|
|
|
const Watchpoint* watchpoint);
|
|
|
|
|
|
|
|
private:
|
|
|
|
target_addr_t fAddress;
|
|
|
|
uint32 fType;
|
|
|
|
int32 fLength;
|
|
|
|
|
|
|
|
bool fInstalled;
|
|
|
|
bool fEnabled;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-11-07 17:50:17 +04:00
|
|
|
typedef BObjectList<Watchpoint> WatchpointList;
|
|
|
|
|
|
|
|
|
2012-11-06 14:45:26 +04:00
|
|
|
#endif // WATCHPOINT_H
|