diff options
| author | Jim Ingham <jingham@apple.com> | 2011-09-23 21:24:57 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2011-09-23 21:24:57 +0000 |
| commit | 76bb7596056d815b03290f40979eecba47355141 (patch) | |
| tree | b066804f53ed5622d4103832580a6487fbcebaf1 /lldb/test/functionalities/stop-hook/TestStopHookMechanism.py | |
| parent | edf503757c229370dbea79d0f1e57959a59ac1ff (diff) | |
| download | bcm5719-llvm-76bb7596056d815b03290f40979eecba47355141.tar.gz bcm5719-llvm-76bb7596056d815b03290f40979eecba47355141.zip | |
Added a test for problems caused when Clang errantly makes the line range for one line
too long, so that the jump from the line above the bad line to the line after
ends up in the middle of the bad line instead. Added a workaround to lldb to just
continue to the end if we find ourselves stopped in the middle of some other line.
llvm-svn: 140419
Diffstat (limited to 'lldb/test/functionalities/stop-hook/TestStopHookMechanism.py')
| -rw-r--r-- | lldb/test/functionalities/stop-hook/TestStopHookMechanism.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py b/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py index db722d52a3e..d04aaa88213 100644 --- a/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py +++ b/lldb/test/functionalities/stop-hook/TestStopHookMechanism.py @@ -29,6 +29,7 @@ class StopHookMechanismTestCase(TestBase): # Find the line numbers inside main.cpp. self.begl = line_number('main.cpp', '// Set breakpoint here to test target stop-hook.') self.endl = line_number('main.cpp', '// End of the line range for which stop-hook is to be run.') + self.correct_step_line = line_number ('main.cpp', '// We should stop here after stepping.') self.line = line_number('main.cpp', '// Another breakpoint which is outside of the stop-hook range.') def stop_hook_firing(self): @@ -66,6 +67,13 @@ class StopHookMechanismTestCase(TestBase): child.sendline('thread step-over') # Expecting to find the output emitted by the firing of our stop hook. child.expect_exact('(void *) $') + # This is orthogonal to the main stop hook test, but this example shows a bug in + # CLANG where the line table entry for the "return -1" actually includes some code + # from the other branch of the if/else, so we incorrectly stop at the "return -1" line. + # I fixed that in lldb and I'm sticking in a test here because I don't want to have to + # make up a whole nother test case for it. + child.sendline('frame info') + child.expect_exact('at main.cpp:%d'%self.correct_step_line) # Now continue the inferior, we'll stop at another breakpoint which is outside the stop-hook range. child.sendline('process continue') |

