debugging, added enum to identify bp modifications

This commit is contained in:
Basile Burg 2015-10-16 17:23:31 +02:00
parent a3aa014085
commit f81af3aa03
2 changed files with 9 additions and 7 deletions

View File

@ -42,7 +42,7 @@ type
procedure startDebugging;
procedure killGdb;
procedure updateFileLineBrks;
procedure editorModBrk(sender: TCESynMemo; line: integer; removed: boolean);
procedure editorModBrk(sender: TCESynMemo; line: integer; modification: TBreakPointModification);
// GDB output processors
procedure processInfoRegs(sender: TObject);
procedure processInfoStack(sender: TObject);
@ -181,12 +181,12 @@ begin
end;
end;
procedure TCEGdbWidget.editorModBrk(sender: TCESynMemo; line: integer; removed: boolean);
procedure TCEGdbWidget.editorModBrk(sender: TCESynMemo; line: integer; modification: TBreakPointModification);
var
str: string;
nme: string;
const
cmd: array[boolean] of string = ('break ', 'clear ');
cmd: array[TBreakPointModification] of string = ('break ', 'clear ');
begin
// set only breakpoint in live, while debugging
// note: only works if execution is paused (breakpoint)
@ -196,7 +196,7 @@ begin
nme := sender.fileName;
if not FileExists(nme) then exit;
//
str := cmd[removed] + nme + ':' + intToStr(line);
str := cmd[modification] + nme + ':' + intToStr(line);
fGdb.Suspend;
gdbCommand(str);
fGdb.Resume;

View File

@ -16,9 +16,11 @@ type
TCESynMemo = class;
TBreakPointModification = (bpAdded, bpRemoved);
// breakpoint added or removed
TBreakPointModifyEvent = procedure(sender: TCESynMemo; line: integer;
removed: boolean) of object;
modification: TBreakPointModification) of object;
// Simple THintWindow descendant allowing the font size to be in sync with the editor.
TCEEditorHintWindow = class(THintWindow)
@ -1103,7 +1105,7 @@ begin
fBreakPoints.Add(pointer(line));
{$WARNINGS ON}
if assigned(fBreakpointEvent) then
fBreakpointEvent(self, line, false);
fBreakpointEvent(self, line, bpAdded);
end;
procedure TCESynMemo.removeBreakPoint(line: integer);
@ -1116,7 +1118,7 @@ begin
fBreakPoints.Remove(pointer(line));
{$WARNINGS ON}
if assigned(fBreakpointEvent) then
fBreakpointEvent(self, line, true);
fBreakpointEvent(self, line, bpRemoved);
end;
function TCESynMemo.findBreakPoint(line: integer): boolean;