|
@@ -51,7 +51,6 @@ type
|
|
HasExe : boolean;
|
|
HasExe : boolean;
|
|
RunCount : longint;
|
|
RunCount : longint;
|
|
WindowWidth : longint;
|
|
WindowWidth : longint;
|
|
- TBreakNumber : longint;
|
|
|
|
FPCBreakErrorNumber : longint;
|
|
FPCBreakErrorNumber : longint;
|
|
{$ifdef SUPPORT_REMOTE}
|
|
{$ifdef SUPPORT_REMOTE}
|
|
isRemoteDebugging:boolean;
|
|
isRemoteDebugging:boolean;
|
|
@@ -66,9 +65,6 @@ type
|
|
procedure DoBreakSession;virtual;}
|
|
procedure DoBreakSession;virtual;}
|
|
procedure DoEndSession(code:longint);virtual;
|
|
procedure DoEndSession(code:longint);virtual;
|
|
procedure DoUserSignal;virtual;
|
|
procedure DoUserSignal;virtual;
|
|
- procedure FlushAll; virtual;
|
|
|
|
- function Query(question : pchar; args : pchar) : longint; virtual;
|
|
|
|
-
|
|
|
|
procedure AnnotateError;
|
|
procedure AnnotateError;
|
|
procedure InsertBreakpoints;
|
|
procedure InsertBreakpoints;
|
|
procedure RemoveBreakpoints;
|
|
procedure RemoveBreakpoints;
|
|
@@ -338,10 +334,8 @@ uses
|
|
{$ifdef DOS}
|
|
{$ifdef DOS}
|
|
fpusrscr,
|
|
fpusrscr,
|
|
{$endif DOS}
|
|
{$endif DOS}
|
|
-
|
|
|
|
App,Strings,
|
|
App,Strings,
|
|
FVConsts,
|
|
FVConsts,
|
|
- MsgBox,
|
|
|
|
{$ifdef Windows}
|
|
{$ifdef Windows}
|
|
Windebug,
|
|
Windebug,
|
|
{$endif Windows}
|
|
{$endif Windows}
|
|
@@ -654,15 +648,7 @@ begin
|
|
begin
|
|
begin
|
|
LoadFile(f);
|
|
LoadFile(f);
|
|
HasExe:=true;
|
|
HasExe:=true;
|
|
- { Procedure HandleErrorAddrFrame
|
|
|
|
- (Errno : longint;addr,frame : longint);
|
|
|
|
- [public,alias:'FPC_BREAK_ERROR']; }
|
|
|
|
- {
|
|
|
|
- Command('b HANDLEERRORADDRFRAME');
|
|
|
|
- this would only work if RTL is compiled with debug information
|
|
|
|
- PM 2009/11/03 }
|
|
|
|
Command('b FPC_BREAK_ERROR');
|
|
Command('b FPC_BREAK_ERROR');
|
|
- { But this apparently sometimes also fails :( }
|
|
|
|
FPCBreakErrorNumber:=last_breakpoint_number;
|
|
FPCBreakErrorNumber:=last_breakpoint_number;
|
|
{$ifdef FrameNameKnown}
|
|
{$ifdef FrameNameKnown}
|
|
{ this fails in GDB 5.1 because
|
|
{ this fails in GDB 5.1 because
|
|
@@ -840,8 +826,6 @@ begin
|
|
PopStatus;
|
|
PopStatus;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
- s:=IDEApp.GetRemoteExecString;
|
|
|
|
- MessageBox(#3'Start in remote'#13#3+s,nil,mfOKbutton);
|
|
|
|
PopStatus;
|
|
PopStatus;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
@@ -957,76 +941,6 @@ begin
|
|
GDBWindow^.WriteString(S);
|
|
GDBWindow^.WriteString(S);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TDebugController.Query(question : pchar; args : pchar) : longint;
|
|
|
|
-var
|
|
|
|
- c : char;
|
|
|
|
- WasModal : boolean;
|
|
|
|
- ModalView : PView;
|
|
|
|
- res : longint;
|
|
|
|
-begin
|
|
|
|
- if not assigned(Application) then
|
|
|
|
- begin
|
|
|
|
- system.Write(question);
|
|
|
|
- repeat
|
|
|
|
- system.write('(y or n)');
|
|
|
|
- system.read(c);
|
|
|
|
- system.writeln(c);
|
|
|
|
- until (lowercase(c)='y') or (lowercase(c)='n');
|
|
|
|
- if lowercase(c)='y' then
|
|
|
|
- query:=1
|
|
|
|
- else
|
|
|
|
- query:=0;
|
|
|
|
- exit;
|
|
|
|
- end;
|
|
|
|
- if assigned(Application^.Current) and
|
|
|
|
- ((Application^.Current^.State and sfModal)<>0) then
|
|
|
|
- begin
|
|
|
|
- WasModal:=true;
|
|
|
|
- ModalView:=Application^.Current;
|
|
|
|
- ModalView^.SetState(sfModal, false);
|
|
|
|
- ModalView^.Hide;
|
|
|
|
- end
|
|
|
|
- else
|
|
|
|
- WasModal:=false;
|
|
|
|
- PushStatus(Question);
|
|
|
|
- res:=MessageBox(Question,nil,mfyesbutton+mfnobutton);
|
|
|
|
- PopStatus;
|
|
|
|
- if res=cmYes then
|
|
|
|
- Query:=1
|
|
|
|
- else
|
|
|
|
- Query:=0;
|
|
|
|
- if WasModal then
|
|
|
|
- begin
|
|
|
|
- ModalView^.Show;
|
|
|
|
- ModalView^.SetState(sfModal, true);
|
|
|
|
- ModalView^.Draw;
|
|
|
|
- end;
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-procedure TDebugController.FlushAll;
|
|
|
|
-begin
|
|
|
|
- if assigned(GDBWindow) then
|
|
|
|
- begin
|
|
|
|
- If StrLen(GetError)>0 then
|
|
|
|
- begin
|
|
|
|
- GDBWindow^.WriteErrorText(GetError);
|
|
|
|
- if in_command=0 then
|
|
|
|
- gdberrorbuf.reset;
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
- If StrLen(GetOutput)>0 then
|
|
|
|
- begin
|
|
|
|
- GDBWindow^.WriteOutputText(GetOutput);
|
|
|
|
- { Keep output for command results }
|
|
|
|
- if in_command=0 then
|
|
|
|
- gdboutputbuf.reset;
|
|
|
|
- end;
|
|
|
|
- end
|
|
|
|
- else
|
|
|
|
- Inherited FlushAll;
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
procedure TDebugController.CommandEnd(const s:string);
|
|
procedure TDebugController.CommandEnd(const s:string);
|
|
begin
|
|
begin
|
|
if assigned(GDBWindow) and (in_command<=1) then
|
|
if assigned(GDBWindow) and (in_command<=1) then
|
|
@@ -1355,13 +1269,7 @@ begin
|
|
end
|
|
end
|
|
else if not assigned(PB) then
|
|
else if not assigned(PB) then
|
|
begin
|
|
begin
|
|
- if (BreakIndex<>start_break_number) and
|
|
|
|
- (BreakIndex<>TbreakNumber) then
|
|
|
|
- WarningBox(#3'Stopped by breakpoint '+IntToStr(BreakIndex),nil);
|
|
|
|
- if BreakIndex=start_break_number then
|
|
|
|
- start_break_number:=0;
|
|
|
|
- if BreakIndex=TbreakNumber then
|
|
|
|
- TbreakNumber:=0;
|
|
|
|
|
|
+ WarningBox(#3'Stopped by breakpoint '+IntToStr(BreakIndex),nil);
|
|
end
|
|
end
|
|
{ For watch we should get old and new value !! }
|
|
{ For watch we should get old and new value !! }
|
|
else if (Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive)) and
|
|
else if (Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive)) and
|
|
@@ -3600,17 +3508,15 @@ end;
|
|
|
|
|
|
function GetGDBTargetShortName : string;
|
|
function GetGDBTargetShortName : string;
|
|
begin
|
|
begin
|
|
-{$ifndef CROSSGDB}
|
|
|
|
-GetGDBTargetShortName:=source_info.shortname;
|
|
|
|
-{$else CROSSGDB}
|
|
|
|
{$ifdef SUPPORT_REMOTE}
|
|
{$ifdef SUPPORT_REMOTE}
|
|
{$ifdef PALMOSGDB}
|
|
{$ifdef PALMOSGDB}
|
|
GetGDBTargetShortName:='palmos';
|
|
GetGDBTargetShortName:='palmos';
|
|
{$else}
|
|
{$else}
|
|
GetGDBTargetShortName:='linux';
|
|
GetGDBTargetShortName:='linux';
|
|
{$endif PALMOSGDB}
|
|
{$endif PALMOSGDB}
|
|
|
|
+{$else not SUPPORT_REMOTE}
|
|
|
|
+GetGDBTargetShortName:=source_info.shortname
|
|
{$endif not SUPPORT_REMOTE}
|
|
{$endif not SUPPORT_REMOTE}
|
|
-{$endif CROSSGDB}
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure InitDebugger;
|
|
procedure InitDebugger;
|