mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 17:00:19 +02:00
Debugger: Add dfNotSuitableForOsArch, to filter out unusable backends
This commit is contained in:
parent
8cd89c5af8
commit
c7de909539
@ -62,7 +62,13 @@ type
|
||||
|
||||
TDBGFeature = (
|
||||
dfEvalFunctionCalls, // The debugger supports calling functions in watches/expressions. defAllowFunctionCall in TWatcheEvaluateFlags
|
||||
dfThreadSuspension
|
||||
dfThreadSuspension,
|
||||
|
||||
(* dfNotSuitableForOsArch:
|
||||
If this is set, then this debugger can not be used on the current
|
||||
architecture and/or OS
|
||||
*)
|
||||
dfNotSuitableForOsArch
|
||||
);
|
||||
TDBGFeatures = set of TDBGFeature;
|
||||
|
||||
|
@ -4621,7 +4621,11 @@ end;
|
||||
|
||||
class function TFpDebugDebugger.SupportedFeatures: TDBGFeatures;
|
||||
begin
|
||||
{$IF defined(windows) or defined(linux)}
|
||||
Result := [dfEvalFunctionCalls, dfThreadSuspension];
|
||||
{$ELSE}
|
||||
Result := [dfNotSuitableForOsArch];
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
@ -332,6 +332,8 @@ begin
|
||||
List := TStringListUTF8Fast.Create;
|
||||
for i := 0 to TBaseDebugManagerIntf.DebuggerCount - 1 do begin
|
||||
d := TBaseDebugManagerIntf.Debuggers[i];
|
||||
if dfNotSuitableForOsArch in d.SupportedFeatures then
|
||||
continue;
|
||||
List.AddObject(d.Caption, TObject(d));
|
||||
end;
|
||||
List.Sorted := True;
|
||||
|
@ -187,7 +187,9 @@ begin
|
||||
FActive := False;
|
||||
|
||||
FDebuggerClass := TBaseDebugManagerIntf.DebuggersByClassName[ConfigClass];
|
||||
if FDebuggerClass <> nil then begin
|
||||
if (FDebuggerClass <> nil) and
|
||||
( Active or not (dfNotSuitableForOsArch in FDebuggerClass.SupportedFeatures) ) // Active entries will always be loaded for compatibility
|
||||
then begin
|
||||
FDebuggerProperties := FDebuggerClass.CreateProperties;
|
||||
if FDebuggerProperties <> nil then
|
||||
AXMLCfg.ReadObject(APath + 'Properties/', FDebuggerProperties);
|
||||
@ -235,6 +237,7 @@ begin
|
||||
FDebuggerProperties := FDebuggerClass.CreateProperties;
|
||||
if FDebuggerProperties <> nil then
|
||||
AXMLCfg.ReadObject(p, FDebuggerProperties);
|
||||
if Active or not (dfNotSuitableForOsArch in FDebuggerClass.SupportedFeatures) then
|
||||
FFLags := [dpcLoaded];
|
||||
end
|
||||
else begin
|
||||
@ -263,6 +266,7 @@ begin
|
||||
FConfigName := '';
|
||||
FActive := ACreateAsActive;
|
||||
FDebuggerProperties := ADebuggerClass.CreateProperties;
|
||||
if FActive or not (dfNotSuitableForOsArch in FDebuggerClass.SupportedFeatures) then
|
||||
FFLags := [dpcLoaded]; // i.e. treat as loaded, save when saving all
|
||||
|
||||
InitUID;
|
||||
@ -279,6 +283,7 @@ begin
|
||||
FDebuggerClass := TBaseDebugManagerIntf.DebuggersByClassName[ConfigClass];
|
||||
if FDebuggerClass <> nil then begin
|
||||
FDebuggerProperties := FDebuggerClass.CreateProperties;
|
||||
if FActive or not (dfNotSuitableForOsArch in FDebuggerClass.SupportedFeatures) then
|
||||
FFLags := [dpcLoaded]; // i.e. treat as loaded, save when saving all
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user