mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 16:20:35 +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,7 +237,8 @@ begin
|
||||
FDebuggerProperties := FDebuggerClass.CreateProperties;
|
||||
if FDebuggerProperties <> nil then
|
||||
AXMLCfg.ReadObject(p, FDebuggerProperties);
|
||||
FFLags := [dpcLoaded];
|
||||
if Active or not (dfNotSuitableForOsArch in FDebuggerClass.SupportedFeatures) then
|
||||
FFLags := [dpcLoaded];
|
||||
end
|
||||
else begin
|
||||
if p[Length(p)] = '/' then
|
||||
@ -263,7 +266,8 @@ begin
|
||||
FConfigName := '';
|
||||
FActive := ACreateAsActive;
|
||||
FDebuggerProperties := ADebuggerClass.CreateProperties;
|
||||
FFLags := [dpcLoaded]; // i.e. treat as loaded, save when saving all
|
||||
if FActive or not (dfNotSuitableForOsArch in FDebuggerClass.SupportedFeatures) then
|
||||
FFLags := [dpcLoaded]; // i.e. treat as loaded, save when saving all
|
||||
|
||||
InitUID;
|
||||
end;
|
||||
@ -279,7 +283,8 @@ begin
|
||||
FDebuggerClass := TBaseDebugManagerIntf.DebuggersByClassName[ConfigClass];
|
||||
if FDebuggerClass <> nil then begin
|
||||
FDebuggerProperties := FDebuggerClass.CreateProperties;
|
||||
FFLags := [dpcLoaded]; // i.e. treat as loaded, save when saving all
|
||||
if FActive or not (dfNotSuitableForOsArch in FDebuggerClass.SupportedFeatures) then
|
||||
FFLags := [dpcLoaded]; // i.e. treat as loaded, save when saving all
|
||||
end;
|
||||
|
||||
InitUID;
|
||||
|
Loading…
Reference in New Issue
Block a user