Add AL value to debugger interrupt breakpoints. Useful for breaking on specific sub-functions, and for function numbers in AX such as the mouse driver INT 33h. Faster breakpoint checking with some redundant conditions removed.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3849
This commit is contained in:
parent
625dcb3c28
commit
40c32b040c
1 changed files with 34 additions and 22 deletions
|
@ -281,32 +281,34 @@ class CBreakpoint
|
|||
public:
|
||||
|
||||
CBreakpoint(void);
|
||||
void SetAddress (Bit16u seg, Bit32u off) { location = GetAddress(seg,off); type = BKPNT_PHYSICAL; segment = seg; offset = off; };
|
||||
void SetAddress (PhysPt adr) { location = adr; type = BKPNT_PHYSICAL; };
|
||||
void SetInt (Bit8u _intNr, Bit16u ah) { intNr = _intNr, ahValue = ah; type = BKPNT_INTERRUPT; };
|
||||
void SetAddress (Bit16u seg, Bit32u off) { location = GetAddress(seg,off); type = BKPNT_PHYSICAL; segment = seg; offset = off; };
|
||||
void SetAddress (PhysPt adr) { location = adr; type = BKPNT_PHYSICAL; };
|
||||
void SetInt (Bit8u _intNr, Bit16u ah, Bit16u al) { intNr = _intNr, ahValue = ah; alValue = al; type = BKPNT_INTERRUPT; };
|
||||
void SetOnce (bool _once) { once = _once; };
|
||||
void SetType (EBreakpoint _type) { type = _type; };
|
||||
void SetValue (Bit8u value) { ahValue = value; };
|
||||
void SetOther (Bit8u other) { alValue = other; };
|
||||
|
||||
bool IsActive (void) { return active; };
|
||||
void Activate (bool _active);
|
||||
|
||||
EBreakpoint GetType (void) { return type; };
|
||||
bool GetOnce (void) { return once; };
|
||||
PhysPt GetLocation (void) { if (GetType()!=BKPNT_INTERRUPT) return location; else return 0; };
|
||||
PhysPt GetLocation (void) { return location; };
|
||||
Bit16u GetSegment (void) { return segment; };
|
||||
Bit32u GetOffset (void) { return offset; };
|
||||
Bit8u GetIntNr (void) { if (GetType()==BKPNT_INTERRUPT) return intNr; else return 0; };
|
||||
Bit16u GetValue (void) { if (GetType()!=BKPNT_PHYSICAL) return ahValue; else return 0; };
|
||||
Bit8u GetIntNr (void) { return intNr; };
|
||||
Bit16u GetValue (void) { return ahValue; };
|
||||
Bit16u GetOther (void) { return alValue; };
|
||||
|
||||
// statics
|
||||
static CBreakpoint* AddBreakpoint (Bit16u seg, Bit32u off, bool once);
|
||||
static CBreakpoint* AddIntBreakpoint (Bit8u intNum, Bit16u ah, bool once);
|
||||
static CBreakpoint* AddIntBreakpoint (Bit8u intNum, Bit16u ah, Bit16u al, bool once);
|
||||
static CBreakpoint* AddMemBreakpoint (Bit16u seg, Bit32u off);
|
||||
static void ActivateBreakpoints (PhysPt adr, bool activate);
|
||||
static bool CheckBreakpoint (PhysPt adr);
|
||||
static bool CheckBreakpoint (Bitu seg, Bitu off);
|
||||
static bool CheckIntBreakpoint (PhysPt adr, Bit8u intNr, Bit16u ahValue);
|
||||
static bool CheckIntBreakpoint (PhysPt adr, Bit8u intNr, Bit16u ahValue, Bit16u alValue);
|
||||
static bool IsBreakpoint (PhysPt where);
|
||||
static bool IsBreakpointDrawn (PhysPt where);
|
||||
static bool DeleteBreakpoint (PhysPt where);
|
||||
|
@ -325,6 +327,7 @@ private:
|
|||
// Int
|
||||
Bit8u intNr;
|
||||
Bit16u ahValue;
|
||||
Bit16u alValue;
|
||||
// Shared
|
||||
bool active;
|
||||
bool once;
|
||||
|
@ -337,7 +340,7 @@ public:
|
|||
CBreakpoint::CBreakpoint(void):
|
||||
location(0),
|
||||
active(false),once(false),
|
||||
segment(0),offset(0),intNr(0),ahValue(0),
|
||||
segment(0),offset(0),intNr(0),ahValue(0),alValue(0),
|
||||
type(BKPNT_UNKNOWN) { };
|
||||
|
||||
void CBreakpoint::Activate(bool _active)
|
||||
|
@ -376,10 +379,10 @@ CBreakpoint* CBreakpoint::AddBreakpoint(Bit16u seg, Bit32u off, bool once)
|
|||
return bp;
|
||||
};
|
||||
|
||||
CBreakpoint* CBreakpoint::AddIntBreakpoint(Bit8u intNum, Bit16u ah, bool once)
|
||||
CBreakpoint* CBreakpoint::AddIntBreakpoint(Bit8u intNum, Bit16u ah, Bit16u al, bool once)
|
||||
{
|
||||
CBreakpoint* bp = new CBreakpoint();
|
||||
bp->SetInt (intNum,ah);
|
||||
bp->SetInt (intNum,ah,al);
|
||||
bp->SetOnce (once);
|
||||
BPoints.push_front (bp);
|
||||
return bp;
|
||||
|
@ -475,7 +478,7 @@ bool CBreakpoint::CheckBreakpoint(Bitu seg, Bitu off)
|
|||
return false;
|
||||
};
|
||||
|
||||
bool CBreakpoint::CheckIntBreakpoint(PhysPt adr, Bit8u intNr, Bit16u ahValue)
|
||||
bool CBreakpoint::CheckIntBreakpoint(PhysPt adr, Bit8u intNr, Bit16u ahValue, Bit16u alValue)
|
||||
// Checks if interrupt breakpoint is valid and should stop execution
|
||||
{
|
||||
if ((ignoreAddressOnce!=0) && (adr==ignoreAddressOnce)) {
|
||||
|
@ -490,7 +493,7 @@ bool CBreakpoint::CheckIntBreakpoint(PhysPt adr, Bit8u intNr, Bit16u ahValue)
|
|||
for(i=BPoints.begin(); i != BPoints.end(); i++) {
|
||||
bp = (*i);
|
||||
if ((bp->GetType()==BKPNT_INTERRUPT) && bp->IsActive() && (bp->GetIntNr()==intNr)) {
|
||||
if ((bp->GetValue()==BPINT_ALL) || (bp->GetValue()==ahValue)) {
|
||||
if (((bp->GetValue()==BPINT_ALL) || (bp->GetValue()==ahValue)) && ((bp->GetOther()==BPINT_ALL) || (bp->GetOther()==alValue))) {
|
||||
// Ignore it once ?
|
||||
if (ignoreOnce==bp) {
|
||||
ignoreOnce=0;
|
||||
|
@ -606,8 +609,9 @@ void CBreakpoint::ShowList(void)
|
|||
if (bp->GetType()==BKPNT_PHYSICAL) {
|
||||
DEBUG_ShowMsg("%02X. BP %04X:%04X\n",nr,bp->GetSegment(),bp->GetOffset());
|
||||
} else if (bp->GetType()==BKPNT_INTERRUPT) {
|
||||
if (bp->GetValue()==BPINT_ALL) DEBUG_ShowMsg("%02X. BPINT %02X\n",nr,bp->GetIntNr());
|
||||
else DEBUG_ShowMsg("%02X. BPINT %02X AH=%02X\n",nr,bp->GetIntNr(),bp->GetValue());
|
||||
if (bp->GetValue()==BPINT_ALL) DEBUG_ShowMsg("%02X. BPINT %02X\n",nr,bp->GetIntNr());
|
||||
else if (bp->GetOther()==BPINT_ALL) DEBUG_ShowMsg("%02X. BPINT %02X AH=%02X\n",nr,bp->GetIntNr(),bp->GetValue());
|
||||
else DEBUG_ShowMsg("%02X. BPINT %02X AH=%02X AL=%02X\n",nr,bp->GetIntNr(),bp->GetValue(),bp->GetOther());
|
||||
} else if (bp->GetType()==BKPNT_MEMORY) {
|
||||
DEBUG_ShowMsg("%02X. BPMEM %04X:%04X (%02X)\n",nr,bp->GetSegment(),bp->GetOffset(),bp->GetValue());
|
||||
} else if (bp->GetType()==BKPNT_MEMORY_PROT) {
|
||||
|
@ -633,7 +637,7 @@ bool DEBUG_IntBreakpoint(Bit8u intNum)
|
|||
{
|
||||
/* First get the physical address and check for a set Breakpoint */
|
||||
PhysPt where=GetAddress(SegValue(cs),reg_eip);
|
||||
if (!CBreakpoint::CheckIntBreakpoint(where,intNum,reg_ah)) return false;
|
||||
if (!CBreakpoint::CheckIntBreakpoint(where,intNum,reg_ah,reg_al)) return false;
|
||||
// Found. Breakpoint is valid
|
||||
CBreakpoint::ActivateBreakpoints(where,false); // Deactivate all breakpoints
|
||||
return true;
|
||||
|
@ -1105,14 +1109,21 @@ bool ParseCommand(char* str) {
|
|||
|
||||
if (command == "BPINT") { // Add Interrupt Breakpoint
|
||||
Bit8u intNr = (Bit8u)GetHexValue(found,found);
|
||||
bool all = !(*found);found++;
|
||||
Bit8u valAH = (Bit8u)GetHexValue(found,found);
|
||||
bool all = !(*found);
|
||||
Bit8u valAH = (Bit8u)GetHexValue(found,found);
|
||||
if ((valAH==0x00) && (*found=='*' || all)) {
|
||||
CBreakpoint::AddIntBreakpoint(intNr,BPINT_ALL,false);
|
||||
CBreakpoint::AddIntBreakpoint(intNr,BPINT_ALL,BPINT_ALL,false);
|
||||
DEBUG_ShowMsg("DEBUG: Set interrupt breakpoint at INT %02X\n",intNr);
|
||||
} else {
|
||||
CBreakpoint::AddIntBreakpoint(intNr,valAH,false);
|
||||
DEBUG_ShowMsg("DEBUG: Set interrupt breakpoint at INT %02X AH=%02X\n",intNr,valAH);
|
||||
all = !(*found);
|
||||
Bit8u valAL = (Bit8u)GetHexValue(found,found);
|
||||
if ((valAL==0x00) && (*found=='*' || all)) {
|
||||
CBreakpoint::AddIntBreakpoint(intNr,valAH,BPINT_ALL,false);
|
||||
DEBUG_ShowMsg("DEBUG: Set interrupt breakpoint at INT %02X AH=%02X\n",intNr,valAH);
|
||||
} else {
|
||||
CBreakpoint::AddIntBreakpoint(intNr,valAH,valAL,false);
|
||||
DEBUG_ShowMsg("DEBUG: Set interrupt breakpoint at INT %02X AH=%02X AL=%02X\n",intNr,valAH,valAL);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
@ -1294,7 +1305,8 @@ bool ParseCommand(char* str) {
|
|||
DEBUG_ShowMsg("Home/End - Scroll log messages.\n");
|
||||
DEBUG_ShowMsg("BP [segment]:[offset] - Set breakpoint.\n");
|
||||
DEBUG_ShowMsg("BPINT [intNr] * - Set interrupt breakpoint.\n");
|
||||
DEBUG_ShowMsg("BPINT [intNr] [ah] - Set interrupt breakpoint with ah.\n");
|
||||
DEBUG_ShowMsg("BPINT [intNr] [ah] * - Set interrupt breakpoint with ah.\n");
|
||||
DEBUG_ShowMsg("BPINT [intNr] [ah] [al] - Set interrupt breakpoint with ah and al.\n");
|
||||
#if C_HEAVY_DEBUG
|
||||
DEBUG_ShowMsg("BPM [segment]:[offset] - Set memory breakpoint (memory change).\n");
|
||||
DEBUG_ShowMsg("BPPM [selector]:[offset]- Set pmode-memory breakpoint (memory change).\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue