debugger: treat ShortString type as skSimple type, reduce amount of hacks for ShortString handling

git-svn-id: trunk@23005 -
This commit is contained in:
paul 2009-12-06 16:04:49 +00:00
parent 12a6edefa1
commit fdb1f1236c
3 changed files with 11 additions and 22 deletions

View File

@ -2372,22 +2372,15 @@ begin
AResult := GetVariantValue(AResult);
end;
skRecord: begin
if (ResultInfo.TypeName = 'ShortString') or
(ResultInfo.TypeName = 'SHORTSTRING') then
AResult := AResult // don't show 'record ShortString' as this is debug info implementation details
else
if (ResultInfo.TypeName = '&ShortString') then
begin
// we have an address here, so we need to typecast
AResult := GetStrValue('ShortString(%s)', [S]);
end
else
AResult := 'record ' + ResultInfo.TypeName + ' '+ AResult;
AResult := 'record ' + ResultInfo.TypeName + ' '+ AResult;
end;
skSimple: begin
if ResultInfo.TypeName = 'CURRENCY' then
AResult := FormatCurrency(AResult)
else
if (ResultInfo.TypeName = '&ShortString') then
AResult := GetStrValue('ShortString(%s)', [S]) // we have an address here, so we need to typecast
else
AResult := AResult;
end;

View File

@ -263,7 +263,12 @@ var
begin
if (FTypeName = 'Variant') or
(FTypeName = 'VARIANT') then
FKind := skVariant
FKind := skVariant
else
if (FTypeName = 'ShortString') or
(FTypeName = 'SHORTSTRING') or
(FTypeName = '&ShortString') then
FKind := skSimple
else
FKind := skRecord;

View File

@ -150,16 +150,7 @@ begin
if not Assigned(FDBGInfo.Fields) then exit;
EditInspected.Text:=FExpression+' : '+FDBGInfo.TypeName;
GridDataSetup;
// handle special records
if (FDBGInfo.TypeName = 'ShortString') or
(FDBGInfo.TypeName = 'SHORTSTRING') then
begin
FGridData.Cells[0,1]:=FExpression;
FGridData.Cells[1,1]:=FDBGInfo.TypeName;
FGridData.Cells[2,1]:=FHumanReadable;
end
else
ShowDataFields;
ShowDataFields;
FGridData.AutoSizeColumn(2);
end;