Lines Matching +full:lldb +full:- +full:build
2 Test the lldb command line completion mechanism.
8 import lldb
36 self.build()
39 self, "// Break here", lldb.SBFileSpec("main.cpp")
41 self.assertState(process.GetState(), lldb.eStateStopped)
49 self.build()
52 self, "// Break here", lldb.SBFileSpec("main.cpp")
54 self.assertState(process.GetState(), lldb.eStateStopped)
59 self.do_test_variable_completion("dwim-print")
67 self.complete_from_to(f"{command} ptr_fooo->", f"{command} ptr_fooo->t")
68 self.complete_from_to(f"{command} ptr_fooo->t.", f"{command} ptr_fooo->t.x")
69 self.complete_from_to(f"{command} ptr_fooo->dd", f"{command} ptr_fooo->dd")
79 f"{command} ptr_container->", f"{command} ptr_container->MemberVar"
82 f"{command} ptr_container->Mem", f"{command} ptr_container->MemberVar"
86 """Test that 'process attach --con' completes to 'process attach --continue '."""
87 self.complete_from_to("process attach --con", "process attach --continue ")
90 self.complete_from_to("process launch --arch ", ["mips", "arm64"])
93 self.build()
95 self, "// Break here", lldb.SBFileSpec("main.cpp")
105 self.build()
107 self, "// Break here", lldb.SBFileSpec("main.cpp")
109 err = lldb.SBError()
110 local_spec = lldb.SBFileSpec(self.getBuildArtifact("libshared.so"))
111 if lldb.remote_platform:
114 lldb.SBFileSpec(
130 subcommands = ["attach -P", "connect -p", "launch -p"]
135 "process " + subcommand + " mach-o-core",
140 match_strings = lldb.SBStringList()
141 num_matches = interp.HandleCompletion(input, len(input), 0, -1, match_strings)
153 # The LLDB process itself and the process already attached to are both
156 self.build()
160 "-x"
161 ], # Arg "-x" makes the subprocess wait for input thus it won't be terminated too early
167 self.completions_contain("process attach -p ", [str(pid)])
168 self.completions_contain("platform process attach -p ", [str(pid)])
171 self.completions_contain_str("process attach -n ", "a.out")
172 self.completions_contain_str("platform process attach -n ", "a.out")
179 self.build()
181 self.main_source_spec = lldb.SBFileSpec(self.main_source)
190 "breakpoint modify --th", ["--thread-id", "--thread-index", "--thread-name"]
194 self.completions_match("disassemble -F ", ["default", "intel", "att"])
200 self.complete_from_to("log disable ll", ["lldb"])
202 self.complete_from_to("log disable lldb al", ["all"])
203 self.complete_from_to("log disable lldb sym", ["symbol"])
206 self.complete_from_to("log list ll", ["lldb"])
208 self.complete_from_to("log list ll", ["lldb"])
209 self.complete_from_to("log list lldb dwa", ["dwarf"])
229 self.complete_from_to("process launch --arch arm", ["arm64"])
233 self.complete_from_to("target symbols add --shlib ", [])
238 self.complete_from_to("log enable lldb expr -f " + src_dir, ["main.cpp"])
243 self.complete_from_to("log enable lldb expr -f " + src_dir, [src_dir + os.sep])
271 self.build()
273 self, "// Break here", lldb.SBFileSpec("main.cpp")
303 self.build()
305 self, "// Break here", lldb.SBFileSpec("main.cpp")
313 """Test that 'settings append target.er' completes to 'settings append target.error-path'."""
315 "settings append target.er", "settings append target.error-path"
319 """Test that 'settings insert-after target.env' completes to 'settings insert-after target.env-vars'."""
321 "settings insert-after target.env", "settings insert-after target.env-vars"
325 """Test that 'settings insert-before target.env' completes to 'settings insert-before target.env-vars'."""
327 "settings insert-before target.env",
328 "settings insert-before target.env-vars",
332 """Test that 'settings replace target.ru' completes to 'settings replace target.run-args'."""
334 "settings replace target.ru", "settings replace target.run-args"
338 self.complete_from_to("settings show term-w", "settings show term-width")
341 self.complete_from_to("settings list term-w", "settings list term-width")
344 self.complete_from_to("settings show term-h", "settings show term-height")
347 self.complete_from_to("settings list term-h", "settings list term-height")
350 self.complete_from_to("settings remove term-w", "settings remove term-width")
353 self.complete_from_to("settings remove term-h", "settings remove term-height")
360 """Test that 'settings set thread-f' completes to 'settings set thread-format'."""
361 self.complete_from_to("settings set thread-f", "settings set thread-format")
364 """Test that 'settings set --g' completes to 'settings set --global'."""
365 self.complete_from_to("settings set --g", "settings set --global")
368 """Test that 'settings clear thread-f' completes to 'settings clear thread-format'."""
369 self.complete_from_to("settings clear thread-f", "settings clear thread-format")
373 self.complete_from_to("settings set target.ma", "settings set target.max-")
376 """Test that 'settings set target.exec' completes to 'settings set target.exec-search-paths '."""
378 "settings set target.exec", "settings set target.exec-search-paths"
383 'target.prefer-dynamic-value', 'target.process.']."""
385 "settings set target.pr", ["target.prefer-dynamic-value", "target.process."]
402 'target.process.thread.step-avoid-regexp', 'target.process.thread.trace-thread'].
407 "target.process.thread.step-avoid-regexp",
408 "target.process.thread.trace-thread",
415 "settings set stop-disassembly-display ",
416 ["never", "always", "no-debuginfo", "no-source"],
420 self.build()
422 self, "ptr_foo", lldb.SBFileSpec("main.cpp")
429 self.runCmd("thread step-scripted -C thread_plan_script.PushPlanStack")
435 'modules', 'select', 'stop-hook', 'variable']."""
438 ["create", "delete", "list", "modules", "select", "stop-hook", "variable"],
442 """Tests source file completion by completing the line-table argument."""
443 self.build()
445 self.complete_from_to("target modules dump line-table main.cp", ["main.cpp"])
451 "source-file",
452 "disk-file",
453 "disk-directory",
456 "settings-name",
457 "platform-plugin",
459 "variable-path",
462 "process-plugin",
463 "disassembly-flavor",
464 "type-language",
465 "frame-index",
466 "module-uuid",
467 "stophook-id",
468 "thread-index",
469 "watchpoint-id",
470 "breakpoint-name",
471 "process-id",
472 "process-name",
473 "remote-disk-file",
474 "remote-disk-directory",
475 "type-category-name",
478 self.completions_contain("command script add -C ", completion_types)
483 "command script add -C disk-file -f my_test_cmd.my_test_cmd my_test_cmd"
504 self.build()
511 "target modules search-paths insert ", "target modules search-paths insert "
513 self.build()
517 "target modules search-paths insert ", "target modules search-paths insert "
519 self.runCmd("target modules search-paths add a b")
521 "target modules search-paths insert ",
522 "target modules search-paths insert 0",
526 "target modules search-paths insert 0 ",
527 "target modules search-paths insert 0 ",
531 """Test that 'target create --co' completes to 'target variable --core '."""
532 self.complete_from_to("target create --co", "target create --core ")
544 "step-in",
545 "step-inst",
546 "step-inst-over",
547 "step-out",
548 "step-over",
549 "step-script",
558 self.build()
560 self, "// Break here", lldb.SBFileSpec("main.cpp")
571 self.complete_from_to("type filter add -w ", ["default"])
575 self.complete_from_to("watchpoint set variable -", ["-w", "-s"])
577 "watchpoint set variable -w", "watchpoint set variable -w "
579 self.complete_from_to("watchpoint set variable --", ["--watch", "--size"])
581 "watchpoint set variable --w", "watchpoint set variable --watch"
584 "watchpoint set variable -w ", ["read", "write", "read_write"]
587 "watchpoint set variable --watch ", ["read", "write", "read_write"]
590 "watchpoint set variable --watch w", "watchpoint set variable --watch write"
593 "watchpoint set variable -w read_", "watchpoint set variable -w read_write"
595 # Now try the same thing with a variable name (non-option argument) to
597 self.complete_from_to("watchpoint set variable foo -", ["-w", "-s"])
599 "watchpoint set variable foo -w", "watchpoint set variable foo -w "
601 self.complete_from_to("watchpoint set variable foo --", ["--watch", "--size"])
603 "watchpoint set variable foo --w", "watchpoint set variable foo --watch"
606 "watchpoint set variable foo -w ", ["read", "write", "read_write"]
609 "watchpoint set variable foo --watch ", ["read", "write", "read_write"]
612 "watchpoint set variable foo --watch w",
613 "watchpoint set variable foo --watch write",
616 "watchpoint set variable foo -w read_",
617 "watchpoint set variable foo -w read_write",
621 self.runCmd("command script add -h test_desc -f none -s current usercmd1")
626 r"command regex test_command s/^$/finish/ 's/([0-9]+)/frame select %1/'"
643 # The list can contain only aliases if there's no built-ins to match.
649 """Test descriptions of top-level command completions"""
653 ["command", "Commands for managing custom LLDB commands."],
665 ["plugin", "Commands for managing LLDB plugins."],
671 self.check_completion_with_desc("non-existent-command", [])
677 "breakpoint set -",
679 ["-h", "Set the breakpoint on exception catcH."],
680 ["-w", "Set the breakpoint on exception throW."],
686 "breakpoint set --",
688 ["--on-catch", "Set the breakpoint on exception catcH."],
689 ["--on-throw", "Set the breakpoint on exception throW."],
695 "breakpoint set --on-",
697 ["--on-catch", "Set the breakpoint on exception catcH."],
698 ["--on-throw", "Set the breakpoint on exception throW."],
703 self.check_completion_with_desc("breakpoint set --Z", [])
706 self.build()
708 self, "// Break here", lldb.SBFileSpec("main.cpp")
712 self.complete_from_to("thread backtrace -s ", ["0"])
716 "frame recognizer add -l py_class -s module_name -n recognizer_name"
725 "platform target-install main.cp", "platform target-install main.cpp"
730 self.build()
733 "breakpoint set -n Fo", "breakpoint set -n Foo::Bar(int,\\ int)"
737 self.complete_from_to("breakpoint set -n Qu", "")
740 self.runCmd("type filter add --child a Aoo")
742 self.runCmd("type filter add --child b -x Boo")
745 self.runCmd("type format add -f hex Coo")
747 self.runCmd("type format add -f hex -x Doo")
750 self.runCmd("type summary add -c Eoo")
752 self.runCmd("type summary add -x -c Foo")
755 self.runCmd("type synthetic add Goo -l test")
757 self.runCmd("type synthetic add -x Hoo -l test")
766 self.build()
780 self.build()
781 self.main_source_spec = lldb.SBFileSpec("main.cpp")
809 "target stop-hook " + subcommand + " ",
810 "target stop-hook " + subcommand + " ",
813 self.build()
815 self.runCmd("target stop-hook add -o test")
819 "target stop-hook " + subcommand + " ",
820 "target stop-hook " + subcommand + " 1",
826 "target stop-hook " + subcommand + " 1 ",
827 "target stop-hook " + subcommand + " 1 ",
831 self.complete_from_to("type category -l ", ["c"])
834 self.build()
837 "target modules load -u ", [target.GetModuleAtIndex(0).GetUUIDString()]
859 self.build()
881 self.build()
886 self.complete_from_to("breakpoint read -N ", "breakpoint read -N ")
887 self.complete_from_to("breakpoint read -f breakpoints.json -N ", ["mm"])
889 "breakpoint read -f breakpoints.json -N n",
890 "breakpoint read -f breakpoints.json -N n",
893 "breakpoint read -f breakpoints_invalid.json -N ",
894 "breakpoint read -f breakpoints_invalid.json -N ",
901 self.complete_from_to("breakpoint set -N n", "breakpoint set -N n")
903 self.complete_from_to("breakpoint set -N ", "breakpoint set -N nn")
914 self.build()
915 error = lldb.SBError()
931 self.completions_match("target symbols add -s ", basenames + paths)
934 self.completions_match("target symbols add -s a.", ["a.out"])
938 self.completions_match("target symbols add -s '" + prefix, paths)
942 self.completions_match("target symbols add -s '" + prefix_sep, paths)
948 self.completions_match("target symbols add -s '" + prefix_sep_sep, paths_sep)