Index: debugger/gdbmidebugger.pp =================================================================== --- debugger/gdbmidebugger.pp (revision 40201) +++ debugger/gdbmidebugger.pp (working copy) @@ -120,9 +120,9 @@ gdsbDefault, gdsbEntry, gdsbMainAddr, gdsbMain, gdsbAddZero ); - { TGDBMIDebuggerProperties } + { TGDBMIDebuggerPropertiesBase } - TGDBMIDebuggerProperties = class(TDebuggerProperties) + TGDBMIDebuggerPropertiesBase = class(TDebuggerProperties) private FEncodeCurrentDirPath: TGDBMIDebuggerFilenameEncoding; FEncodeExeFileName: TGDBMIDebuggerFilenameEncoding; @@ -131,6 +131,7 @@ {$ENDIF} FGDBOptions: String; FInternalStartBreak: TGDBMIDebuggerStartBreak; + FUseGdbPidForPauseSignal: Boolean; FTimeoutForEval: Integer; FWarnOnTimeOut: Boolean; procedure SetTimeoutForEval(const AValue: Integer); @@ -138,7 +139,7 @@ public constructor Create; override; procedure Assign(Source: TPersistent); override; - published + public property Debugger_Startup_Options: String read FGDBOptions write FGDBOptions; {$IFDEF UNIX} property ConsoleTty: String read FConsoleTty write FConsoleTty; @@ -151,8 +152,20 @@ read FEncodeExeFileName write FEncodeExeFileName default gdfeDefault; property InternalStartBreak: TGDBMIDebuggerStartBreak read FInternalStartBreak write FInternalStartBreak default gdsbDefault; + property UseGdbPidForPauseSignal: Boolean + read FUseGdbPidForPauseSignal write FUseGdbPidForPauseSignal; end; + TGDBMIDebuggerProperties = class(TGDBMIDebuggerPropertiesBase) + published + property TimeoutForEval; + property WarnOnTimeOut; + property EncodeCurrentDirPath; + property EncodeExeFileName; + property InternalStartBreak; + property UseGdbPidForPauseSignal; + end; + TGDBMIDebugger = class; { TGDBMIDebuggerCommand } @@ -204,7 +217,7 @@ FLastExecCommand: String; FLastExecResult: TGDBMIExecResult; FLogWarnings, FFullCmdReply: String; - function GetDebuggerProperties: TGDBMIDebuggerProperties; + function GetDebuggerProperties: TGDBMIDebuggerPropertiesBase; function GetDebuggerState: TDBGState; function GetTargetInfo: PGDBMITargetInfo; protected @@ -213,7 +226,7 @@ function ErrorStateMessage: String; virtual; function ErrorStateInfo: String; virtual; property DebuggerState: TDBGState read GetDebuggerState; - property DebuggerProperties: TGDBMIDebuggerProperties read GetDebuggerProperties; + property DebuggerProperties: TGDBMIDebuggerPropertiesBase read GetDebuggerProperties; property TargetInfo: PGDBMITargetInfo read GetTargetInfo; protected procedure SetCommandState(NewState: TGDBMIDebuggerCommandState); @@ -2124,7 +2137,7 @@ cgptNone: esc := gdfeNone; cgptCurDir: begin - esc := TGDBMIDebuggerProperties(GetProperties).FEncodeCurrentDirPath; + esc := TGDBMIDebuggerPropertiesBase(GetProperties).FEncodeCurrentDirPath; //TODO: check FGDBOS //Unix/Windows can use gdfeEscSpace, but work without too; if esc = gdfeDefault @@ -2135,7 +2148,7 @@ end; cgptExeName: begin - esc := TGDBMIDebuggerProperties(GetProperties).FEncodeExeFileName; + esc := TGDBMIDebuggerPropertiesBase(GetProperties).FEncodeExeFileName; if esc = gdfeDefault then esc := //Unix/Windows can use gdfeEscSpace, but work without too; @@ -4584,6 +4597,8 @@ "main" could map to more than one location, so we try entry point first *) TargetInfo^.TargetPID := RunToMain(EntryPoint); + if TGDBMIDebuggerPropertiesBase(FTheDebugger.GetProperties).UseGdbPidForPauseSignal then + TargetInfo^.TargetPID := FTheDebugger.DebugProcess.ProcessID; if DebuggerState = dsStop then begin @@ -6405,10 +6420,10 @@ { =========================================================================== } -{ TGDBMIDebuggerProperties } +{ TGDBMIDebuggerPropertiesBase } { =========================================================================== } -procedure TGDBMIDebuggerProperties.SetTimeoutForEval(const AValue: Integer); +procedure TGDBMIDebuggerPropertiesBase.SetTimeoutForEval(const AValue: Integer); begin if FTimeoutForEval = AValue then exit; FTimeoutForEval := AValue; @@ -6416,13 +6431,13 @@ then FTimeoutForEval := -1; end; -procedure TGDBMIDebuggerProperties.SetWarnOnTimeOut(const AValue: Boolean); +procedure TGDBMIDebuggerPropertiesBase.SetWarnOnTimeOut(const AValue: Boolean); begin if FWarnOnTimeOut = AValue then exit; FWarnOnTimeOut := AValue; end; -constructor TGDBMIDebuggerProperties.Create; +constructor TGDBMIDebuggerPropertiesBase.Create; begin {$IFDEF UNIX} FConsoleTty := ''; @@ -6439,18 +6454,19 @@ inherited; end; -procedure TGDBMIDebuggerProperties.Assign(Source: TPersistent); +procedure TGDBMIDebuggerPropertiesBase.Assign(Source: TPersistent); begin inherited Assign(Source); - FGDBOptions := TGDBMIDebuggerProperties(Source).FGDBOptions; + FGDBOptions := TGDBMIDebuggerPropertiesBase(Source).FGDBOptions; {$IFDEF UNIX} - FConsoleTty := TGDBMIDebuggerProperties(Source).FConsoleTty; + FConsoleTty := TGDBMIDebuggerPropertiesBase(Source).FConsoleTty; {$ENDIF} - FTimeoutForEval := TGDBMIDebuggerProperties(Source).FTimeoutForEval; - FWarnOnTimeOut := TGDBMIDebuggerProperties(Source).FWarnOnTimeOut; - FEncodeCurrentDirPath := TGDBMIDebuggerProperties(Source).FEncodeCurrentDirPath; - FEncodeExeFileName := TGDBMIDebuggerProperties(Source).FEncodeExeFileName; - FInternalStartBreak := TGDBMIDebuggerProperties(Source).FInternalStartBreak; + FTimeoutForEval := TGDBMIDebuggerPropertiesBase(Source).FTimeoutForEval; + FWarnOnTimeOut := TGDBMIDebuggerPropertiesBase(Source).FWarnOnTimeOut; + FEncodeCurrentDirPath := TGDBMIDebuggerPropertiesBase(Source).FEncodeCurrentDirPath; + FEncodeExeFileName := TGDBMIDebuggerPropertiesBase(Source).FEncodeExeFileName; + FInternalStartBreak := TGDBMIDebuggerPropertiesBase(Source).FInternalStartBreak; + FUseGdbPidForPauseSignal := TGDBMIDebuggerPropertiesBase(Source).FUseGdbPidForPauseSignal; end; @@ -7655,8 +7671,8 @@ FNeedStateToIdle := False; Options := '-silent -i mi -nx'; - if Length(TGDBMIDebuggerProperties(GetProperties).Debugger_Startup_Options) > 0 - then Options := Options + ' ' + TGDBMIDebuggerProperties(GetProperties).Debugger_Startup_Options; + if Length(TGDBMIDebuggerPropertiesBase(GetProperties).Debugger_Startup_Options) > 0 + then Options := Options + ' ' + TGDBMIDebuggerPropertiesBase(GetProperties).Debugger_Startup_Options; if CreateDebugProcess(Options) then begin @@ -10202,9 +10218,9 @@ Result := FTheDebugger.State; end; -function TGDBMIDebuggerCommand.GetDebuggerProperties: TGDBMIDebuggerProperties; +function TGDBMIDebuggerCommand.GetDebuggerProperties: TGDBMIDebuggerPropertiesBase; begin - Result := TGDBMIDebuggerProperties(FTheDebugger.GetProperties); + Result := TGDBMIDebuggerPropertiesBase(FTheDebugger.GetProperties); end; function TGDBMIDebuggerCommand.GetTargetInfo: PGDBMITargetInfo; Index: debugger/gdbmiserverdebugger.pas =================================================================== --- debugger/gdbmiserverdebugger.pas (revision 40201) +++ debugger/gdbmiserverdebugger.pas (working copy) @@ -51,7 +51,7 @@ { TGDBMIServerDebuggerProperties } - TGDBMIServerDebuggerProperties = class(TGDBMIDebuggerProperties) + TGDBMIServerDebuggerProperties = class(TGDBMIDebuggerPropertiesBase) private FDebugger_Remote_Hostname: string; FDebugger_Remote_Port: string; @@ -61,6 +61,11 @@ published property Debugger_Remote_Hostname: String read FDebugger_Remote_Hostname write FDebugger_Remote_Hostname; property Debugger_Remote_Port: String read FDebugger_Remote_Port write FDebugger_Remote_Port; + property TimeoutForEval; + property WarnOnTimeOut; + property EncodeCurrentDirPath; + property EncodeExeFileName; + property InternalStartBreak; end; implementation @@ -114,6 +119,7 @@ inherited Create; FDebugger_Remote_Hostname:= ''; FDebugger_Remote_Port:= '2345'; + UseGdbPidForPauseSignal := True; end; procedure TGDBMIServerDebuggerProperties.Assign(Source: TPersistent); Index: ide/debugmanager.pas =================================================================== --- ide/debugmanager.pas (revision 40201) +++ ide/debugmanager.pas (working copy) @@ -57,7 +57,7 @@ DebuggerDlg, Watchesdlg, BreakPointsdlg, BreakPropertyDlg, LocalsDlg, WatchPropertyDlg, CallStackDlg, EvaluateDlg, RegistersDlg, AssemblerDlg, DebugOutputForm, ExceptionDlg, InspectDlg, DebugEventsForm, PseudoTerminalDlg, FeedbackDlg, ThreadDlg, HistoryDlg, - GDBMIDebugger, SSHGDBMIDebugger, ProcessDebugger, + GDBMIDebugger, SSHGDBMIDebugger, GDBMIServerDebugger, ProcessDebugger, BaseDebugManager;