reactosdbg/DebugProtocol/Breakpoint.cs
Aleksey Bragin 9868a9e7f5 Willem Alexander Hajenius <reactos.1000.ahajenius@spamgourmet.com>
- KDBG/IDebugProtocol: parse/add/delete/enable/disable breakpoints. Some other
refactorings done to reduce method size.
- Dockable window that shows current list of breakpoints with add/delete/edit
button (you can also double-click to edit). Breakpoints can easily be
enabled/disabled with a checkbox.
- Dialog window to add or edit breakpoint details. GUI tries to prevent invalid
input.
- Add svn:ignore to RosDBG directory.

svn path=/trunk/reactosdbg/; revision=1308
2011-08-02 19:54:03 +00:00

57 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DebugProtocol
{
public class Breakpoint
{
public enum BPType { Software, Hardware, WriteWatch, ReadWatch, AccessWatch };
public int ID { get; set; }
public BPType BreakpointType { get; set; }
public ulong Address { get; set; }
public int Length { get; set; }
public string Condition { get; set; }
public bool Enabled { get; set; }
public Breakpoint(int id)
{
ID = id;
BreakpointType = BPType.Software;
Address = 0;
Length = 1;
Condition = string.Empty;
Enabled = false;
}
public Breakpoint(int id, BPType type, ulong addr, int len, string cond)
{
ID = id;
BreakpointType = type;
Address = addr;
Length = len;
Condition = cond;
Enabled = false;
}
//TODO: include condition/enabled in hashcode?
public override int GetHashCode()
{
return (int)(((int)BreakpointType) ^ (int)Address ^ (Length << 28));
}
public override bool Equals(object other)
{
Breakpoint otherbp = other as Breakpoint;
if (otherbp == null) return false;
return
otherbp.ID == ID;/*
(otherbp.BreakpointType == BreakpointType) &&
(otherbp.Address == Address) &&
(otherbp.Length == Length);*/
}
}
}