mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-22 21:09:35 +01:00
[RSP] Add HWBreak parameter to Add/DeleteBreakWatchPoint method so that TProcess can decide whether a HW or SW break should be inserted on the target.
This commit is contained in:
parent
06c4f184d7
commit
411eebba23
@ -133,8 +133,8 @@ type
|
|||||||
function Kill(): boolean;
|
function Kill(): boolean;
|
||||||
function Detach(): boolean;
|
function Detach(): boolean;
|
||||||
function MustReplyEmpty: boolean;
|
function MustReplyEmpty: boolean;
|
||||||
function SetBreakWatchPoint(addr: PtrUInt; BreakWatchKind: TDBGWatchPointKind; watchsize: integer = 1): boolean;
|
function SetBreakWatchPoint(addr: PtrUInt; BreakWatchKind: TDBGWatchPointKind; watchsize: integer = 1; HWbreak: boolean = true): boolean;
|
||||||
function DeleteBreakWatchPoint(addr: PtrUInt; BreakWatchKind: TDBGWatchPointKind; watchsize: integer = 1): boolean;
|
function DeleteBreakWatchPoint(addr: PtrUInt; BreakWatchKind: TDBGWatchPointKind; watchsize: integer = 1; HWBreak: boolean = true): boolean;
|
||||||
// TODO: no support for thread ID or different address
|
// TODO: no support for thread ID or different address
|
||||||
function Continue(): boolean;
|
function Continue(): boolean;
|
||||||
function SingleStep(): boolean;
|
function SingleStep(): boolean;
|
||||||
@ -766,7 +766,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TRspConnection.SetBreakWatchPoint(addr: PtrUInt;
|
function TRspConnection.SetBreakWatchPoint(addr: PtrUInt;
|
||||||
BreakWatchKind: TDBGWatchPointKind; watchsize: integer): boolean;
|
BreakWatchKind: TDBGWatchPointKind; watchsize: integer; HWbreak: boolean
|
||||||
|
): boolean;
|
||||||
var
|
var
|
||||||
cmd, reply: string;
|
cmd, reply: string;
|
||||||
begin
|
begin
|
||||||
@ -776,7 +777,11 @@ begin
|
|||||||
wpkRead: cmd := cmd + '3,' + IntToHex(addr, 4) + ',' + IntToHex(watchsize, 4);
|
wpkRead: cmd := cmd + '3,' + IntToHex(addr, 4) + ',' + IntToHex(watchsize, 4);
|
||||||
wpkReadWrite: cmd := cmd + '4,' + IntToHex(addr, 4) + ',' + IntToHex(watchsize, 4);
|
wpkReadWrite: cmd := cmd + '4,' + IntToHex(addr, 4) + ',' + IntToHex(watchsize, 4);
|
||||||
// NOTE: Not sure whether hardware break is better than software break, depends on gdbserver implementation...
|
// NOTE: Not sure whether hardware break is better than software break, depends on gdbserver implementation...
|
||||||
wkpExec: cmd := cmd + '1,' + IntToHex(addr, 4) + ',00';
|
wkpExec:
|
||||||
|
if HWbreak then
|
||||||
|
cmd := cmd + '1,' + IntToHex(addr, 4) + ',00'
|
||||||
|
else
|
||||||
|
cmd := cmd + '0,' + IntToHex(addr, 4) + ',00';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
EnterCriticalSection(fCS);
|
EnterCriticalSection(fCS);
|
||||||
@ -790,7 +795,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TRspConnection.DeleteBreakWatchPoint(addr: PtrUInt;
|
function TRspConnection.DeleteBreakWatchPoint(addr: PtrUInt;
|
||||||
BreakWatchKind: TDBGWatchPointKind; watchsize: integer): boolean;
|
BreakWatchKind: TDBGWatchPointKind; watchsize: integer; HWBreak: boolean
|
||||||
|
): boolean;
|
||||||
var
|
var
|
||||||
cmd, reply: string;
|
cmd, reply: string;
|
||||||
begin
|
begin
|
||||||
@ -800,7 +806,11 @@ begin
|
|||||||
wpkRead: cmd := cmd + '3,' + IntToHex(addr, 4) + ',' + IntToHex(watchsize, 4);
|
wpkRead: cmd := cmd + '3,' + IntToHex(addr, 4) + ',' + IntToHex(watchsize, 4);
|
||||||
wpkReadWrite: cmd := cmd + '4,' + IntToHex(addr, 4) + ',' + IntToHex(watchsize, 4);
|
wpkReadWrite: cmd := cmd + '4,' + IntToHex(addr, 4) + ',' + IntToHex(watchsize, 4);
|
||||||
// NOTE: Not sure whether hardware break is better than software break, depends on gdbserver implementation...
|
// NOTE: Not sure whether hardware break is better than software break, depends on gdbserver implementation...
|
||||||
wkpExec: cmd := cmd + '1,' + IntToHex(addr, 4) + ',00';
|
wkpExec:
|
||||||
|
if HWBreak then
|
||||||
|
cmd := cmd + '1,' + IntToHex(addr, 4) + ',00'
|
||||||
|
else
|
||||||
|
cmd := cmd + '0,' + IntToHex(addr, 4) + ',00';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
EnterCriticalSection(fCS);
|
EnterCriticalSection(fCS);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user