FPDebug: fixes

git-svn-id: trunk@43377 -
This commit is contained in:
martin 2013-11-05 22:37:08 +00:00
parent e87a5be48c
commit 3163c7673e
4 changed files with 64 additions and 31 deletions

View File

@ -1884,9 +1884,11 @@ begin
ti := TypeInfo; // Parent
if ti <> nil then
if ti <> nil then begin
Result := ti.MemberByName[AIndex];
FLastChildByName := Result;
FLastChildByName := Result;
FLastChildByName.AddReference;
end;
end;
function TDbgDwarfIdentifierStructure.GetMemberCount: Integer;
@ -2212,6 +2214,7 @@ var
EntryName: String;
s: String;
InEnum: Boolean;
ParentScopIdx: Integer;
begin
Result := False;
InEnum := False;
@ -2235,6 +2238,7 @@ begin
if Abbrev.tag = DW_TAG_enumeration_type then begin
assert(not InEnum, 'nested enum');
InEnum := True;
ParentScopIdx := ScopeIndex;
GoChild;
Continue;
end;
@ -2245,7 +2249,7 @@ begin
if InEnum then begin
InEnum := False;
GoParent;
ScopeIndex := ParentScopIdx;
GoNext;
continue;
end;

View File

@ -69,6 +69,7 @@ begin
ATypeName := ATypeName + '^';
end;
ATypeName := '';
Result := False;
end;
@ -133,7 +134,7 @@ var
while (i < c) and Result do begin
m := ADbgSymbol.Member[i];
AddVisibility(m.MemberVisibility, i= 0);
Result := GetTypeAsDeclaration(s, m, [tdfNoFirstLineIndent, tdfIncludeVarName] + AFlags, AnIndent + 4);
Result := GetTypeAsDeclaration(s, m, [tdfIncludeVarName] + AFlags, AnIndent + 4);
if Result then
AText := AText + GetIndent + s + ';' + LineEnding;
inc(i);
@ -238,8 +239,11 @@ var
s: String;
begin
if tdfSkipRecordBody in AFlags then begin
GetTypeName(s, ADbgSymbol);
ADeclaration := s + ' {=record}';
Result := True;
if GetTypeName(s, ADbgSymbol) then
ADeclaration := s + ' {=record}'
else
ADeclaration := Format('record {...};%s%send', [LineEnding, GetIndent]);
exit;
end;
Result := MembersAsGdbText(s, False);

View File

@ -157,6 +157,15 @@ type
destructor Destroy; override;
end;
TFpPascalExpressionPartConstant = class(TFpPascalExpressionPartContainer)
end;
TFpPascalExpressionPartConstantNumber = class(TFpPascalExpressionPartConstant)
end;
TFpPascalExpressionPartConstantText = class(TFpPascalExpressionPartConstant)
end;
{ TFpPascalExpressionPartWithPrecedence }
TFpPascalExpressionPartWithPrecedence = class(TFpPascalExpressionPartContainer)
@ -714,14 +723,6 @@ var
else AddPart(TFpPascalExpressionPartOperatorPlusMinus);
end;
procedure AddConstChar;
begin
end;
procedure AddConstNumber;
begin
end;
procedure AddIdentifier;
begin
while TokenEndPtr^ in ['a'..'z', 'A'..'Z', '_', '0'..'9'] do
@ -780,6 +781,30 @@ var
end;
end;
procedure AddConstNumber;
begin
case CurPtr^ of
'$': while TokenEndPtr^ in ['a'..'z', 'A'..'Z', '0'..'9'] do inc(TokenEndPtr);
'&': while TokenEndPtr^ in ['0'..'7'] do inc(TokenEndPtr);
'%': while TokenEndPtr^ in ['0'..'1'] do inc(TokenEndPtr);
'0'..'9':
if (TokenEndPtr^ = '0') and ((TokenEndPtr + 1)^ = 'x') and
((TokenEndPtr + 2)^ in ['a'..'z', 'A'..'Z', '0'..'9'])
then begin
inc(TokenEndPtr, 3);
while TokenEndPtr^ in ['a'..'z', 'A'..'Z', '0'..'9'] do inc(TokenEndPtr);
end
else
while TokenEndPtr^ in ['0'..'0'] do inc(TokenEndPtr);
end;
AddPart(TFpPascalExpressionPartConstantNumber);
end;
procedure AddConstChar;
begin
SetError(Format('Unexpected char ''%0:s'' at pos %1:d', [CurPtr^, PosFromPChar(CurPtr)])); // error
end;
begin
if FTextExpression = '' then
exit;
@ -798,7 +823,7 @@ begin
TokenEndPtr := CurPtr + 1;
case CurPtr^ of
'@' : AddPart(TFpPascalExpressionPartOperatorAddressOf);
'^': AddRefOperator;
'^': AddRefOperator; // ^A may be #$01
'.': HandleDot;
'+', '-' : AddPlusMinus;
'*', '/' : AddPart(TFpPascalExpressionPartOperatorMulDiv);
@ -807,9 +832,9 @@ begin
'[': HandleSqareBracket;
']': CloseBracket(TFpPascalExpressionPartSquareBracket);
//',': ;
//'''': AddConstChar;
//'0'..'9',
//'$', '%': AddConstNumber;
'''', '#': AddConstChar;
'0'..'9',
'$', '%', '&': AddConstNumber;
'a'..'z',
'A'..'Z', '_': AddIdentifier;
else begin

View File

@ -217,17 +217,21 @@ const
Result := False;
exit;
end;
s := ti.Name;
if s = '' then begin
if (AMember.Kind = FpDbgInfo.skSet) or (AMember.Kind = FpDbgInfo.skEnum) or
(AMember.Kind = FpDbgInfo.skArray)
then
if not GetTypeAsDeclaration(s, ti, [tdfSkipClassBody, tdfSkipRecordBody]) then
s := '';
end;
if (s = '') and not (AMember.Kind = FpDbgInfo.skRecord) then begin
Result := False;
exit;
if not( (AMember.Kind = FpDbgInfo.skSet) or (AMember.Kind = FpDbgInfo.skEnum) or
(AMember.Kind = FpDbgInfo.skArray) or (AMember.Kind = FpDbgInfo.skPointer) or
(AMember.Kind = FpDbgInfo.skRecord)
)
then begin
Result := False;
exit;
end;
if not GetTypeAsDeclaration(s, ti, [tdfSkipClassBody, tdfSkipRecordBody]) then begin
Result := False;
exit;
end
end;
if AMember.Kind = FpDbgInfo.skFunction then begin
@ -235,10 +239,6 @@ const
AText := AText + ' function ' + AMember.Name + ' () : '+s+';' + s2 + LineEnding;
end
else
if AMember.Kind = FpDbgInfo.skRecord then begin
AText := AText + ' ' + AMember.Name + ' : '+s+' = record ;' + LineEnding;
end
else
begin
AText := AText + ' ' + AMember.Name + ' : ' + s + ';' + LineEnding;
end;