mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 20:59:06 +02:00
Debugger, Callstack: display filename in front of path. Issue #0028084
git-svn-id: trunk@49093 -
This commit is contained in:
parent
d46605f9c2
commit
b63b1981dd
@ -268,8 +268,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCallStackDlg.UpdateView;
|
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
|
var
|
||||||
n: Integer;
|
i, n: Integer;
|
||||||
Item: TListItem;
|
Item: TListItem;
|
||||||
Entry: TIdeCallStackEntry;
|
Entry: TIdeCallStackEntry;
|
||||||
First, Count, MaxCnt: Integer;
|
First, Count, MaxCnt: Integer;
|
||||||
@ -372,7 +380,12 @@ begin
|
|||||||
if (Source = '') and (Entry.UnitInfo <> nil) and (Entry.UnitInfo.LocationFullFile <> '') then
|
if (Source = '') and (Entry.UnitInfo <> nil) and (Entry.UnitInfo.LocationFullFile <> '') then
|
||||||
Source := Entry.UnitInfo.LocationFullFile;
|
Source := Entry.UnitInfo.LocationFullFile;
|
||||||
if Source = '' then // we do not have a source file => just show an adress
|
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;
|
Item.SubItems[1] := Source;
|
||||||
if (Entry.Line = 0) and (Entry.UnitInfo <> nil) and (Entry.UnitInfo.SrcLine > 0) then
|
if (Entry.Line = 0) and (Entry.UnitInfo <> nil) and (Entry.UnitInfo.SrcLine > 0) then
|
||||||
Item.SubItems[2] := '~'+IntToStr(Entry.UnitInfo.SrcLine)
|
Item.SubItems[2] := '~'+IntToStr(Entry.UnitInfo.SrcLine)
|
||||||
|
Loading…
Reference in New Issue
Block a user