Implement CallParamDefaultLocation for AVR.

This commit is contained in:
ccrause 2024-02-25 17:41:04 +02:00 committed by Martin
parent 88a0e31b16
commit 6915cc97fe

View File

@ -112,6 +112,7 @@ end;
AMemManager: TFpDbgMemManager; AMemModel: TFpDbgMemModel;
AProcessConfig: TDbgProcessConfig = nil); override;
destructor Destroy; override;
function CallParamDefaultLocation(AParamIdx: Integer): TFpDbgMemLocation; override;
end;
TAvrBreakInfo = object
@ -493,6 +494,19 @@ begin
inherited Destroy;
end;
function TDbgAvrProcess.CallParamDefaultLocation(
AParamIdx: Integer): TFpDbgMemLocation;
begin
Result := inherited CallParamDefaultLocation(AParamIdx);
// Assume word sized parameters passed via registers
// this means larger parameters will mess up this guess
if (AParamIdx >= 0) and (AParamIdx <= 8) then
begin
Result.MType := mlfTargetRegister;
Result.Address := 24 - 2*AParamIdx;
end;
end;
class function TDbgAvrProcess.isSupported(target: TTargetDescriptor): boolean;
begin
result := (target.OS = osEmbedded) and