FpDebug: Dwarfviewer. Allow drop files / various updates

git-svn-id: trunk@59965 -
This commit is contained in:
martin 2019-01-01 15:13:08 +00:00
parent f5e720ed1e
commit 0d0fab67b2
2 changed files with 20 additions and 6 deletions

View File

@ -3,12 +3,14 @@ object Form1: TForm1
Height = 440
Top = 211
Width = 643
AllowDropFiles = True
Caption = 'test fp'
ClientHeight = 440
ClientWidth = 643
OnCreate = FormCreate
OnDestroy = FormDestroy
LCLVersion = '1.9.0.0'
OnDropFiles = FormDropFiles
LCLVersion = '2.1.0.0'
object FileNameEdit1: TFileNameEdit
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner

View File

@ -31,6 +31,7 @@ type
procedure btnLinesClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormDropFiles(Sender: TObject; const FileNames: array of String);
private
{ private declarations }
NameList: TStringList;
@ -244,6 +245,7 @@ var
MaxData: PByte;
v: Int64;
begin
Result:='';
MaxData := AData + ASize - 1;
while AData <= MaxData do
begin
@ -515,7 +517,7 @@ var
stest := ToHexCommaList(p,ValueSize);
p2 := p;
s3 := IntToStr(ValueSize) + ': ' + ToHex(p, ValueSize);
if (Attribute = DW_AT_location) or (Attribute = DW_AT_data_member_location) then
if (Attribute = DW_AT_location) or (Attribute = DW_AT_data_location) or (Attribute = DW_AT_data_member_location) then
PascalTestCAseCode := PascalTestCAseCode +
Format(namePreFix+'Add(%s, %s, BytesLenU([%s])); // %s%s', [s1, s2, DecodeLocation(p2, ValueSize), stest, LineEnding])
else
@ -528,7 +530,7 @@ var
p2 := p;
stest := ToHexCommaList(p,ValueSize);
s3 := IntToStr(ValueSize) + ': ' + ToHex(p, ValueSize);
if (Attribute = DW_AT_location) or (Attribute = DW_AT_data_member_location) then
if (Attribute = DW_AT_location) or (Attribute = DW_AT_data_location) or (Attribute = DW_AT_data_member_location) then
PascalTestCAseCode := PascalTestCAseCode +
Format(namePreFix+'Add(%s, %s, BytesLen1([%s])); // %s%s', [s1, s2, DecodeLocation(p2, ValueSize), stest, LineEnding])
else
@ -541,7 +543,7 @@ var
p2 := p;
stest := ToHexCommaList(p,ValueSize);
s3 := IntToStr(ValueSize) + ': ' + ToHex(p, ValueSize);
if (Attribute = DW_AT_location) or (Attribute = DW_AT_data_member_location) then
if (Attribute = DW_AT_location) or (Attribute = DW_AT_data_location) or (Attribute = DW_AT_data_member_location) then
PascalTestCAseCode := PascalTestCAseCode +
Format(namePreFix+'Add(%s, %s, BytesLen2([%s])); // %s%s', [s1, s2, DecodeLocation(p2, ValueSize), stest, LineEnding])
else
@ -554,7 +556,7 @@ var
p2 := p;
stest := ToHexCommaList(p,ValueSize);
s3 := IntToStr(ValueSize) + ': ' + ToHex(p, ValueSize);
if (Attribute = DW_AT_location) or (Attribute = DW_AT_data_member_location) then
if (Attribute = DW_AT_location) or (Attribute = DW_AT_data_location) or (Attribute = DW_AT_data_member_location) then
PascalTestCAseCode := PascalTestCAseCode +
Format(namePreFix+'Add(%s, %s, BytesLen4([%s])); // %s%s', [s1, s2, DecodeLocation(p2, ValueSize), stest, LineEnding])
else
@ -675,7 +677,9 @@ var
if Attribute = DW_AT_name then Result := s3;
if (Attribute = DW_AT_location) or (Attribute = DW_AT_data_member_location) then begin
if (Attribute = DW_AT_location) or (Attribute = DW_AT_data_location) or (Attribute = DW_AT_data_member_location)
or (Attribute = DW_AT_upper_bound) or (Attribute = DW_AT_lower_bound)
then begin
stest := DecodeLocation(p2, ValueSize);
s3 := s3 + ' // ' +stest;
end;
@ -699,6 +703,7 @@ var
NMLIdx: Integer;
pre, sName: String;
begin
Result := nil;
p := s.Entry;
Abbrev := ULEB128toOrdinal(p);
p := s.Entry;
@ -802,6 +807,13 @@ begin
FTestCaseTexts.Free;
end;
procedure TForm1.FormDropFiles(Sender: TObject; const FileNames: array of String
);
begin
if Length(FileNames) > 0 then
FileNameEdit1.Text := FileNames[0];
end;
procedure TForm1.UnLoadDwarf;
begin
FreeAndNil(FDwarfInfo);