mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-10 15:39:14 +01:00
DBG: register usage for win64 ABI
git-svn-id: trunk@30493 -
This commit is contained in:
parent
33f168fcdb
commit
45fc51696a
@ -3147,8 +3147,9 @@ function TGDBMIDebuggerCommandStartDebugging.DoExecute: Boolean;
|
||||
|
||||
procedure SetTargetInfo(const AFileType: String);
|
||||
var
|
||||
FoundPtrSize: Boolean;
|
||||
FoundPtrSize, UseWin64ABI: Boolean;
|
||||
begin
|
||||
UseWin64ABI := False;
|
||||
// assume some defaults
|
||||
TargetInfo^.TargetPtrSize := GetIntValue('sizeof(%s)', [PointerTypeCast]);
|
||||
FoundPtrSize := (FLastExecResult.State <> dsError) and (TargetInfo^.TargetPtrSize > 0);
|
||||
@ -3165,7 +3166,11 @@ function TGDBMIDebuggerCommandStartDebugging.DoExecute: Boolean;
|
||||
'pei-arm-big'
|
||||
], True, False) of
|
||||
0..3: TargetInfo^.TargetCPU := 'x86';
|
||||
4..5: TargetInfo^.TargetCPU := 'x86_64'; //TODO: should we check, PtrSize must be 8, but what if not?
|
||||
4: TargetInfo^.TargetCPU := 'x86_64'; //TODO: should we check, PtrSize must be 8, but what if not?
|
||||
5: begin
|
||||
TargetInfo^.TargetCPU := 'x86_64'; //TODO: should we check, PtrSize must be 8, but what if not?
|
||||
UseWin64ABI := True;
|
||||
end;
|
||||
6: begin
|
||||
//mach-o-be
|
||||
TargetInfo^.TargetIsBE := True;
|
||||
@ -3226,7 +3231,13 @@ function TGDBMIDebuggerCommandStartDebugging.DoExecute: Boolean;
|
||||
TargetInfo^.TargetRegisters[1] := '$edx';
|
||||
TargetInfo^.TargetRegisters[2] := '$ecx';
|
||||
end
|
||||
else begin
|
||||
else if UseWin64ABI
|
||||
then begin
|
||||
TargetInfo^.TargetRegisters[0] := '$rcx';
|
||||
TargetInfo^.TargetRegisters[1] := '$rdx';
|
||||
TargetInfo^.TargetRegisters[2] := '$r8';
|
||||
end else
|
||||
begin
|
||||
TargetInfo^.TargetRegisters[0] := '$rdi';
|
||||
TargetInfo^.TargetRegisters[1] := '$rsi';
|
||||
TargetInfo^.TargetRegisters[2] := '$rdx';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user