mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 02:49:06 +02:00
LazDebuggerFp: Variant-converter, check record size.
This commit is contained in:
parent
d0d616e131
commit
4bc63f4650
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, fgl, FpDbgInfo, FpdMemoryTools, FpDbgCallContextInfo,
|
Classes, SysUtils, fgl, FpDbgInfo, FpdMemoryTools, FpDbgCallContextInfo,
|
||||||
FpPascalBuilder, FpErrorMessages, FpDbgClasses, DbgIntfBaseTypes,
|
FpPascalBuilder, FpErrorMessages, FpDbgClasses, FpDbgUtil, DbgIntfBaseTypes,
|
||||||
lazCollections, LazClasses, LCLProc, FpDebugDebuggerBase;
|
lazCollections, LazClasses, LCLProc, FpDebugDebuggerBase;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -309,23 +309,24 @@ var
|
|||||||
r: Boolean;
|
r: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
if not (
|
if (ASourceValue.Kind <> skRecord) or
|
||||||
(ASourceValue.Kind = skRecord) and
|
(AnFpDebugger.DbgController.CurrentProcess = nil) or
|
||||||
( (ASourceValue.MemberCount = 0) or
|
( (AnFpDebugger.DbgController.CurrentProcess.Mode = dm32) and
|
||||||
(ASourceValue.MemberCount >= 2)
|
(ASourceValue.DataSize.Size <> 16)
|
||||||
) )
|
) or
|
||||||
|
( (AnFpDebugger.DbgController.CurrentProcess.Mode = dm64) and
|
||||||
|
(ASourceValue.DataSize.Size <> 24)
|
||||||
|
)
|
||||||
then begin
|
then begin
|
||||||
SetError(CreateError(fpErrAnyError, ['Value not a variant']));
|
SetError(CreateError(fpErrAnyError, ['Value not a variant']));
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if (ASourceValue.MemberCount >= 2) then begin
|
m := ASourceValue.MemberByName['vtype'];
|
||||||
m := ASourceValue.Member[0];
|
r := (m = nil) or (SizeToFullBytes(m.DataSize) <> 2);
|
||||||
r := SizeToFullBytes(m.DataSize) <> 2;
|
m.ReleaseReference;
|
||||||
m.ReleaseReference;
|
if r then begin
|
||||||
if r then begin
|
SetError(CreateError(fpErrAnyError, ['Value not a variant']));
|
||||||
SetError(CreateError(fpErrAnyError, ['Value not a variant']));
|
exit;
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ProcVal := nil;
|
ProcVal := nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user