mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 02:41:50 +02:00
* handle case where the first instruction with line information is looked up
o this should be handled better. The common way is looking up address - 1, but that doesn't seem to work here. git-svn-id: trunk@49142 -
This commit is contained in:
parent
7b5e58382b
commit
f13b47289e
@ -896,7 +896,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ when we have found the address we need to return the previous
|
{ when we have found the address we need to return the previous
|
||||||
line because that contains the call instruction }
|
line because that contains the call instruction
|
||||||
|
Note that there may not be any call instruction, because this may
|
||||||
|
be the actual instruction that crashed, and it may be on the first
|
||||||
|
line of the function }
|
||||||
if (state.segment > segment) or
|
if (state.segment > segment) or
|
||||||
((state.segment = segment) and
|
((state.segment = segment) and
|
||||||
(state.address >= addr)) then
|
(state.address >= addr)) then
|
||||||
@ -918,10 +921,17 @@ begin
|
|||||||
opcode := ReadNext();
|
opcode := ReadNext();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (found) then begin
|
if (found) then
|
||||||
line := prev_line;
|
begin
|
||||||
source := GetFullFilename(file_names, include_directories, prev_file);
|
{ can happen if the crash happens on the first instruction with line info }
|
||||||
end;
|
if prev_line = 0 then
|
||||||
|
begin
|
||||||
|
prev_line := state.line;
|
||||||
|
prev_file := state.file_id;
|
||||||
|
end;
|
||||||
|
line := prev_line;
|
||||||
|
source := GetFullFilename(file_names, include_directories, prev_file);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user