diff options
author | Raphael Isemann <teemperor@gmail.com> | 2018-07-27 23:37:08 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2018-07-27 23:37:08 +0000 |
commit | d4ff5ba926071650069f1cd04800c9e80ad772b3 (patch) | |
tree | 1e8d73dd6187c368d252345e6d5482212d802f94 /lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py | |
parent | a90d24da1c886a9c00ff132a13e798cce4f1a739 (diff) | |
download | bcm5719-llvm-d4ff5ba926071650069f1cd04800c9e80ad772b3.tar.gz bcm5719-llvm-d4ff5ba926071650069f1cd04800c9e80ad772b3.zip |
Add missing boundary checks to variable completion.
Summary: Stopgap patch to at least stop all the crashes I get from this code.
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D49949
llvm-svn: 338177
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py index 4f6a073a44c..2366d9007e7 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py @@ -39,6 +39,46 @@ class CommandLineCompletionTestCase(TestBase): self.complete_from_to('de', 'detach ') @skipIfFreeBSD # timing out on the FreeBSD buildbot + def test_frame_variable(self): + self.build() + self.main_source = "main.cpp" + self.main_source_spec = lldb.SBFileSpec(self.main_source) + self.dbg.CreateTarget(self.getBuildArtifact("a.out")) + + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self, + '// Break here', self.main_source_spec) + self.assertEquals(process.GetState(), lldb.eStateStopped) + # FIXME: This pulls in the debug information to make the completions work, + # but the completions should also work without. + self.runCmd("frame variable fooo") + + self.complete_from_to('frame variable fo', + 'frame variable fooo') + self.complete_from_to('frame variable fooo.', + 'frame variable fooo.') + self.complete_from_to('frame variable fooo.dd', + 'frame variable fooo.dd') + + self.complete_from_to('frame variable ptr_fooo->', + 'frame variable ptr_fooo->') + self.complete_from_to('frame variable ptr_fooo->dd', + 'frame variable ptr_fooo->dd') + + self.complete_from_to('frame variable cont', + 'frame variable container') + self.complete_from_to('frame variable container.', + 'frame variable container.MemberVar') + self.complete_from_to('frame variable container.Mem', + 'frame variable container.MemberVar') + + self.complete_from_to('frame variable ptr_cont', + 'frame variable ptr_container') + self.complete_from_to('frame variable ptr_container->', + 'frame variable ptr_container->MemberVar') + self.complete_from_to('frame variable ptr_container->Mem', + 'frame variable ptr_container->MemberVar') + + @skipIfFreeBSD # timing out on the FreeBSD buildbot def test_process_attach_dash_dash_con(self): """Test that 'process attach --con' completes to 'process attach --continue '.""" self.complete_from_to( |