Debugger stepping does not understand recursion (bug 38025)
authorAndi McClure <andi.mcclure@xamarin.com>
Mon, 23 May 2016 23:04:06 +0000 (19:04 -0400)
committerAndi McClure <andi.mcclure@xamarin.com>
Mon, 23 May 2016 23:04:06 +0000 (19:04 -0400)
commit37da53ace7c6942babef22b58637ae4be8b4b847
treeac0a1c79c917e175aeb5f8a2de44a82acc8d9cea
parent9e58da5408fc58fa86327396383e4edbf4b5dfe2
Debugger stepping does not understand recursion (bug 38025)

Testing with the debugger showed multiple failures around recursive
functions:

1. Step-out breakpoints can trigger on inner frames.
Solution: Extend existing inner-frame test from step-over to step out
also.

2. "Same source line, continuing" test triggers even on wrong frame
   (affects both step over and step out)
Solution: Check frame as part of this test

3. When step breakpoints pick next sequence points, they can register
   multiple breakpoints at the same place if a recursive call happens to
   exit there. (Possibly harmless but may have resulted in duplicate
   debugger events being generated in one test.)
Solution: Check for duplicates in step-request breakpoint list before
adding new breakpoints

4. Mono.Debugging.Soft in the debugger-libs repo sometimes resumes
   after breakpoints if it decides Mono.Debugger.Soft has not stepped
   far enough, but the check to trigger this was not recursion-aware.
Solution: This one is not addressed in this commit, but a fix was
checked in to debugger-libs. Any code using this commit therefore
needs to be run in conjunction with debugger-libs dfbf6d8b13.

Tests were also added for issues 1-3 above.
mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
mcs/class/Mono.Debugger.Soft/Test/dtest.cs
mono/mini/debugger-agent.c