#97, set the debugger as a single service

docs opened at debug-time couldn't know the dbg
This commit is contained in:
Basile Burg 2016-09-21 16:57:21 +02:00
parent 10ee87bfbb
commit 91b29be626
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
3 changed files with 20 additions and 1 deletions

View File

@ -17,7 +17,8 @@ type
(**
* ICEEDebugObserver can call any of the method during debugging
*)
ICEDebugger = interface
ICEDebugger = interface(ICESingleService)
function running: boolean;
procedure addBreakPoint(const fname: string; line: integer; kind: TBreakPointKind);
procedure removeBreakPoint(const fname: string; line: integer);
end;

View File

@ -228,6 +228,8 @@ type
procedure docChanged(document: TCESynMemo);
procedure docClosing(document: TCESynMemo);
//
function running: boolean;
function singleServiceName: string;
procedure addBreakPoint(const fname: string; line: integer; kind: TBreakPointKind);
procedure removeBreakPoint(const fname: string; line: integer);
public
@ -369,6 +371,7 @@ constructor TCEGdbWidget.create(aOwner: TComponent);
begin
inherited;
EntitiesConnector.addObserver(self);
EntitiesConnector.addSingleService(self);
fDocHandler:= getMultiDocHandler;
fMsg:= getMessageDisplay;
fFileLineBrks:= TStringList.Create;
@ -458,6 +461,19 @@ end;
{$ENDREGION}
{$REGION Unsorted Debugging things ---------------------------------------------}
function TCEGdbWidget.running: boolean;
begin
if assigned(fGdb) then
exit(fGdb.Running)
else
exit(false);
end;
function TCEGdbWidget.singleServiceName: string;
begin
exit('ICEDebugger');
end;
procedure TCEGdbWidget.killGdb;
begin
if not assigned(fGdb) then

View File

@ -754,6 +754,8 @@ begin
//
fDastWorxExename:= exeFullName('dastworx' + exeExt);
//
fDebugger := EntitiesConnector.getSingleService('ICEDebugger') as ICEDebugger;
//
subjDocNew(TCEMultiDocSubject(fMultiDocSubject), self);
EntitiesConnector.addObserver(self);
end;