gdebugger, gdbmi: fix stepping over exceptions

git-svn-id: branches/fixes_1_8@56550 -
This commit is contained in:
mattias 2017-11-30 14:37:45 +00:00
parent 5b5cc0f58b
commit b0b5617f89
3 changed files with 90 additions and 0 deletions

1
.gitattributes vendored
View File

@ -2390,6 +2390,7 @@ components/lazdebuggergdbmi/test/TestApps/ArgVPrg.pas svneol=native#text/pascal
components/lazdebuggergdbmi/test/TestApps/EnvPrg.pas svneol=native#text/pascal
components/lazdebuggergdbmi/test/TestApps/ExceptPrg.pas svneol=native#text/pascal
components/lazdebuggergdbmi/test/TestApps/ExceptPrgStep.pas svneol=native#text/pascal
components/lazdebuggergdbmi/test/TestApps/ExceptPrgStepOver.pas svneol=native#text/pascal
components/lazdebuggergdbmi/test/TestApps/WatchesPrg.pas svneol=native#text/pascal
components/lazdebuggergdbmi/test/TestApps/WatchesPrgArray.inc svneol=native#text/pascal
components/lazdebuggergdbmi/test/TestApps/WatchesPrgEnum.inc svneol=native#text/pascal

View File

@ -6315,6 +6315,8 @@ var
end;
ectStepOver, ectStepOverInstruction, ectStepOut, ectStepInto:
begin
FTheDebugger.FPopExceptStack.EnableOrSetByAddr(Self, True);
FTheDebugger.FCatchesBreak.EnableOrSetByAddr(Self, True);
Result := FStepBreakPoint > 0;
if Result then
exit;

View File

@ -0,0 +1,87 @@
program ExceptPrgStepOver;
uses sysutils;
procedure foo;
begin
raise Exception.create('a');
writeln(1);
end;
procedure bar;
begin
try
foo();
writeln(88);
writeln(88);
except
writeln(99);
end;
end;
///////////////
procedure ffoo;
begin
try
raise Exception.create('a');
writeln(88);
writeln(88);
finally
writeln(55);
end;
writeln(1);
end;
procedure fbar;
begin
try
ffoo();
writeln(88);
writeln(88);
except
writeln(99);
end;
end;
///////////////
procedure abc;
begin
try
raise Exception.create('a'); // 3) line 49 // step over: handled at same level
writeln(88);
writeln(88);
except
writeln(99); // 3) after step, line 53 (or 51 to 53)
end;
end;
///////////////
procedure xyz;
begin
raise Exception.create('a'); // 4) line 60 // step over: handled by outer
writeln(1);
end;
///////////////
begin
bar; // 1) line 67 // step over: handled in nested
writeln(1);
fbar; // 2) line 70 // step over: handled in nested / with finally
writeln(1);
abc; // 3)
writeln(2);
try
xyz; // 4)
writeln(3);
writeln(3);
except
writeln(77); // 4) after step, line 81 (or 79 to 81)
end;
writeln(2);
writeln(2);
end.