diff --git a/components/lazdebuggergdbmi/test/TestApps/ExceptPrgStep.pas b/components/lazdebuggergdbmi/test/TestApps/ExceptPrgStep.pas index 41aac05abd..5797e26c33 100644 --- a/components/lazdebuggergdbmi/test/TestApps/ExceptPrgStep.pas +++ b/components/lazdebuggergdbmi/test/TestApps/ExceptPrgStep.pas @@ -34,6 +34,22 @@ begin except writeln(1); end; + + try + try + raise Exception.create('a'); + writeln(1); + writeln(1); + writeln(1); + finally + writeln(11); + end; + raise Exception.create('xxx'); + writeln(2); + except + writeln(1); + end; + writeln(2); writeln(2); writeln(2); diff --git a/components/lazdebuggergdbmi/test/testexception.pas b/components/lazdebuggergdbmi/test/testexception.pas index efd5d1c032..48e2212698 100644 --- a/components/lazdebuggergdbmi/test/testexception.pas +++ b/components/lazdebuggergdbmi/test/testexception.pas @@ -43,7 +43,9 @@ const *) BREAK_LINE_EXCEPT_1 = 20; // first except blog // may be 18 = at "except" keyword BREAK_LINE_EXCEPT_2 = 31; // 2nd except - BREAK_LINE_EXCEPT_END = 38; // line for break at end + BREAK_LINE_EXCEPT_3 = 45; // 3rd except not handled + BREAK_LINE_EXCEPT_4 = 50; // 3rd except + BREAK_LINE_EXCEPT_END = 54; // line for break at end implementation @@ -348,6 +350,7 @@ begin (FCurLine <= BREAK_LINE_EXCEPT_1) and (FCurLine >= BREAK_LINE_EXCEPT_1 - 2)); TestEquals(TstName+' (Stepped) Still Got 1 exception', 1, FGotExceptCount); + dbg.Run; TestEquals(TstName+' Got 2 exception', 2, FGotExceptCount); @@ -356,9 +359,24 @@ begin (FCurLine <= BREAK_LINE_EXCEPT_2) and (FCurLine >= BREAK_LINE_EXCEPT_2 - 2)); TestEquals(TstName+' (Stepped 2) Still Got 2 exception', 2, FGotExceptCount); + + dbg.Run; + TestEquals(TstName+' Got 3 exception', 3, FGotExceptCount); + + dbg.StepOver; + TestTrue(TstName+' (Stepped 2) at break '+IntToStr(FCurLine), + (FCurLine <= BREAK_LINE_EXCEPT_3) and (FCurLine >= BREAK_LINE_EXCEPT_3 - 2)); + TestEquals(TstName+' (Stepped 3) Still Got 3 exception', 3, FGotExceptCount); + + dbg.StepOver; + TestTrue(TstName+' (Stepped 4) at break '+IntToStr(FCurLine), + (FCurLine <= BREAK_LINE_EXCEPT_4) and (FCurLine >= BREAK_LINE_EXCEPT_4 - 2)); + TestEquals(TstName+' (Stepped 4) Still Got 3 exception', 3, FGotExceptCount); + + dbg.Run; // run to break (tmp break cleared) TestEquals(TstName+' at break', BREAK_LINE_EXCEPT_END, FCurLine); - TestEquals(TstName+' Still Got 2 exception', 2, FGotExceptCount); + TestEquals(TstName+' Still Got 3 exception', 3, FGotExceptCount); dbg.Stop; finally