Debugger, Callstack: display filename in front of path. Issue #0028084

git-svn-id: trunk@49093 -
This commit is contained in:
martin 2015-05-18 21:35:44 +00:00
parent d46605f9c2
commit b63b1981dd

View File

@ -268,8 +268,16 @@ begin
end;
procedure TCallStackDlg.UpdateView;
function LastDelimPos(const FileName: string): Integer;
begin
Result := Length(FileName);
if FileName[Result] in ['/', '\'] then
exit(-1);
while (Result > 0) and not (FileName[Result] in ['/', '\']) do
Dec(Result);
end;
var
n: Integer;
i, n: Integer;
Item: TListItem;
Entry: TIdeCallStackEntry;
First, Count, MaxCnt: Integer;
@ -372,7 +380,12 @@ begin
if (Source = '') and (Entry.UnitInfo <> nil) and (Entry.UnitInfo.LocationFullFile <> '') then
Source := Entry.UnitInfo.LocationFullFile;
if Source = '' then // we do not have a source file => just show an adress
Source := ':' + IntToHex(Entry.Address, 8);
Source := ':' + IntToHex(Entry.Address, 8)
else begin
i := LastDelimPos(Source);
if i > 1 then
Source := copy(Source, i+1, length(Source)) + ' (' + copy(Source, 1, i) + ')'
end;
Item.SubItems[1] := Source;
if (Entry.Line = 0) and (Entry.UnitInfo <> nil) and (Entry.UnitInfo.SrcLine > 0) then
Item.SubItems[2] := '~'+IntToStr(Entry.UnitInfo.SrcLine)