mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 20:30:33 +02:00
FPDebug: fixes
git-svn-id: trunk@43377 -
This commit is contained in:
parent
e87a5be48c
commit
3163c7673e
@ -1884,9 +1884,11 @@ begin
|
|||||||
|
|
||||||
|
|
||||||
ti := TypeInfo; // Parent
|
ti := TypeInfo; // Parent
|
||||||
if ti <> nil then
|
if ti <> nil then begin
|
||||||
Result := ti.MemberByName[AIndex];
|
Result := ti.MemberByName[AIndex];
|
||||||
FLastChildByName := Result;
|
FLastChildByName := Result;
|
||||||
|
FLastChildByName.AddReference;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDbgDwarfIdentifierStructure.GetMemberCount: Integer;
|
function TDbgDwarfIdentifierStructure.GetMemberCount: Integer;
|
||||||
@ -2212,6 +2214,7 @@ var
|
|||||||
EntryName: String;
|
EntryName: String;
|
||||||
s: String;
|
s: String;
|
||||||
InEnum: Boolean;
|
InEnum: Boolean;
|
||||||
|
ParentScopIdx: Integer;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
InEnum := False;
|
InEnum := False;
|
||||||
@ -2235,6 +2238,7 @@ begin
|
|||||||
if Abbrev.tag = DW_TAG_enumeration_type then begin
|
if Abbrev.tag = DW_TAG_enumeration_type then begin
|
||||||
assert(not InEnum, 'nested enum');
|
assert(not InEnum, 'nested enum');
|
||||||
InEnum := True;
|
InEnum := True;
|
||||||
|
ParentScopIdx := ScopeIndex;
|
||||||
GoChild;
|
GoChild;
|
||||||
Continue;
|
Continue;
|
||||||
end;
|
end;
|
||||||
@ -2245,7 +2249,7 @@ begin
|
|||||||
|
|
||||||
if InEnum then begin
|
if InEnum then begin
|
||||||
InEnum := False;
|
InEnum := False;
|
||||||
GoParent;
|
ScopeIndex := ParentScopIdx;
|
||||||
GoNext;
|
GoNext;
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
|
@ -69,6 +69,7 @@ begin
|
|||||||
ATypeName := ATypeName + '^';
|
ATypeName := ATypeName + '^';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
ATypeName := '';
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -133,7 +134,7 @@ var
|
|||||||
while (i < c) and Result do begin
|
while (i < c) and Result do begin
|
||||||
m := ADbgSymbol.Member[i];
|
m := ADbgSymbol.Member[i];
|
||||||
AddVisibility(m.MemberVisibility, i= 0);
|
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
|
if Result then
|
||||||
AText := AText + GetIndent + s + ';' + LineEnding;
|
AText := AText + GetIndent + s + ';' + LineEnding;
|
||||||
inc(i);
|
inc(i);
|
||||||
@ -238,8 +239,11 @@ var
|
|||||||
s: String;
|
s: String;
|
||||||
begin
|
begin
|
||||||
if tdfSkipRecordBody in AFlags then begin
|
if tdfSkipRecordBody in AFlags then begin
|
||||||
GetTypeName(s, ADbgSymbol);
|
Result := True;
|
||||||
ADeclaration := s + ' {=record}';
|
if GetTypeName(s, ADbgSymbol) then
|
||||||
|
ADeclaration := s + ' {=record}'
|
||||||
|
else
|
||||||
|
ADeclaration := Format('record {...};%s%send', [LineEnding, GetIndent]);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
Result := MembersAsGdbText(s, False);
|
Result := MembersAsGdbText(s, False);
|
||||||
|
@ -157,6 +157,15 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TFpPascalExpressionPartConstant = class(TFpPascalExpressionPartContainer)
|
||||||
|
end;
|
||||||
|
|
||||||
|
TFpPascalExpressionPartConstantNumber = class(TFpPascalExpressionPartConstant)
|
||||||
|
end;
|
||||||
|
|
||||||
|
TFpPascalExpressionPartConstantText = class(TFpPascalExpressionPartConstant)
|
||||||
|
end;
|
||||||
|
|
||||||
{ TFpPascalExpressionPartWithPrecedence }
|
{ TFpPascalExpressionPartWithPrecedence }
|
||||||
|
|
||||||
TFpPascalExpressionPartWithPrecedence = class(TFpPascalExpressionPartContainer)
|
TFpPascalExpressionPartWithPrecedence = class(TFpPascalExpressionPartContainer)
|
||||||
@ -714,14 +723,6 @@ var
|
|||||||
else AddPart(TFpPascalExpressionPartOperatorPlusMinus);
|
else AddPart(TFpPascalExpressionPartOperatorPlusMinus);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure AddConstChar;
|
|
||||||
begin
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure AddConstNumber;
|
|
||||||
begin
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure AddIdentifier;
|
procedure AddIdentifier;
|
||||||
begin
|
begin
|
||||||
while TokenEndPtr^ in ['a'..'z', 'A'..'Z', '_', '0'..'9'] do
|
while TokenEndPtr^ in ['a'..'z', 'A'..'Z', '_', '0'..'9'] do
|
||||||
@ -780,6 +781,30 @@ var
|
|||||||
end;
|
end;
|
||||||
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
|
begin
|
||||||
if FTextExpression = '' then
|
if FTextExpression = '' then
|
||||||
exit;
|
exit;
|
||||||
@ -798,7 +823,7 @@ begin
|
|||||||
TokenEndPtr := CurPtr + 1;
|
TokenEndPtr := CurPtr + 1;
|
||||||
case CurPtr^ of
|
case CurPtr^ of
|
||||||
'@' : AddPart(TFpPascalExpressionPartOperatorAddressOf);
|
'@' : AddPart(TFpPascalExpressionPartOperatorAddressOf);
|
||||||
'^': AddRefOperator;
|
'^': AddRefOperator; // ^A may be #$01
|
||||||
'.': HandleDot;
|
'.': HandleDot;
|
||||||
'+', '-' : AddPlusMinus;
|
'+', '-' : AddPlusMinus;
|
||||||
'*', '/' : AddPart(TFpPascalExpressionPartOperatorMulDiv);
|
'*', '/' : AddPart(TFpPascalExpressionPartOperatorMulDiv);
|
||||||
@ -807,9 +832,9 @@ begin
|
|||||||
'[': HandleSqareBracket;
|
'[': HandleSqareBracket;
|
||||||
']': CloseBracket(TFpPascalExpressionPartSquareBracket);
|
']': CloseBracket(TFpPascalExpressionPartSquareBracket);
|
||||||
//',': ;
|
//',': ;
|
||||||
//'''': AddConstChar;
|
'''', '#': AddConstChar;
|
||||||
//'0'..'9',
|
'0'..'9',
|
||||||
//'$', '%': AddConstNumber;
|
'$', '%', '&': AddConstNumber;
|
||||||
'a'..'z',
|
'a'..'z',
|
||||||
'A'..'Z', '_': AddIdentifier;
|
'A'..'Z', '_': AddIdentifier;
|
||||||
else begin
|
else begin
|
||||||
|
@ -217,28 +217,28 @@ const
|
|||||||
Result := False;
|
Result := False;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
s := ti.Name;
|
s := ti.Name;
|
||||||
if s = '' then begin
|
if s = '' then begin
|
||||||
if (AMember.Kind = FpDbgInfo.skSet) or (AMember.Kind = FpDbgInfo.skEnum) or
|
if not( (AMember.Kind = FpDbgInfo.skSet) or (AMember.Kind = FpDbgInfo.skEnum) or
|
||||||
(AMember.Kind = FpDbgInfo.skArray)
|
(AMember.Kind = FpDbgInfo.skArray) or (AMember.Kind = FpDbgInfo.skPointer) or
|
||||||
then
|
(AMember.Kind = FpDbgInfo.skRecord)
|
||||||
if not GetTypeAsDeclaration(s, ti, [tdfSkipClassBody, tdfSkipRecordBody]) then
|
)
|
||||||
s := '';
|
then begin
|
||||||
end;
|
|
||||||
if (s = '') and not (AMember.Kind = FpDbgInfo.skRecord) then begin
|
|
||||||
Result := False;
|
Result := False;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
if not GetTypeAsDeclaration(s, ti, [tdfSkipClassBody, tdfSkipRecordBody]) then begin
|
||||||
|
Result := False;
|
||||||
|
exit;
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
|
||||||
if AMember.Kind = FpDbgInfo.skFunction then begin
|
if AMember.Kind = FpDbgInfo.skFunction then begin
|
||||||
if sfVirtual in AMember.Flags then s2 := ' virtual;';
|
if sfVirtual in AMember.Flags then s2 := ' virtual;';
|
||||||
AText := AText + ' function ' + AMember.Name + ' () : '+s+';' + s2 + LineEnding;
|
AText := AText + ' function ' + AMember.Name + ' () : '+s+';' + s2 + LineEnding;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if AMember.Kind = FpDbgInfo.skRecord then begin
|
|
||||||
AText := AText + ' ' + AMember.Name + ' : '+s+' = record ;' + LineEnding;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
begin
|
||||||
AText := AText + ' ' + AMember.Name + ' : ' + s + ';' + LineEnding;
|
AText := AText + ' ' + AMember.Name + ' : ' + s + ';' + LineEnding;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user