Lines Matching +full:lldb +full:- +full:build
2 Test dwim-print with variables, variable paths, and expressions.
6 import lldb
13 def _run_cmd(self, cmd: str) -> str:
14 """Run the given lldb command and return its output."""
15 result = lldb.SBCommandReturnObject()
21 def _strip_result_var(self, string: str) -> str:
26 compare it to `dwim-print` output, which disables result variables.
34 ) -> None:
35 """Run dwim-print and verify the output against the expected command."""
36 # Resolve the dwim-print command to either `expression` or `frame variable`.
37 substitute_cmd = dwim_cmd.replace("dwim-print", actual_cmd, 1)
39 result = lldb.SBCommandReturnObject()
45 resolved_cmd = resolved_cmd.replace(" -- ", " ", 1)
50 # Verify dwim-print chose the expected command.
51 self.runCmd("settings set dwim-print-verbosity full")
62 """Test dwim-print with variables."""
63 self.build()
67 self._expect_cmd(f"dwim-print {var}", "frame variable")
70 """Test dwim-print with variable path expressions."""
71 self.build()
75 self._expect_cmd(f"dwim-print {expr}", "expression")
78 """Test dwim-print with expressions."""
79 self.build()
83 self._expect_cmd(f"dwim-print {expr}", "expression")
86 """Test dwim-print's ability to evaluate expressions without a target."""
87 self._expect_cmd("dwim-print 1 + 2", "expression")
90 self.build()
92 self._expect_cmd(f"dwim-print/x argc", "frame variable")
93 self._expect_cmd(f"dwim-print/x argc + 1", "expression")
96 self.build()
98 self._expect_cmd(f"dwim-print -fx -- argc", "frame variable")
99 self._expect_cmd(f"dwim-print -fx -- argc + 1", "expression")
102 self.build()
104 self._expect_cmd(f"dwim-print -T -- argc", "frame variable")
105 self._expect_cmd(f"dwim-print -T -- argc + 1", "expression")
109 self.build()
111 self._expect_cmd(f"dwim-print -l c++ -- argc", "frame variable")
112 self._expect_cmd(f"dwim-print -l c++ -- argc + 1", "expression")
115 self.build()
117 error_msg = "error: 'dwim-print' takes a variable or expression"
118 self.expect(f"dwim-print", error=True, startstr=error_msg)
119 self.expect(f"dwim-print -- ", error=True, startstr=error_msg)
122 """Test dwim-print with nested values (structs, etc)."""
123 self.build()
125 self, "break here", lldb.SBFileSpec("main.cpp")
127 self.runCmd("settings set auto-one-line-summaries false")
128 self._expect_cmd(f"dwim-print s", "frame variable")
129 self._expect_cmd(f"dwim-print (struct Structure)s", "expression")
132 """Test dwim-print with type summaries."""
133 self.build()
135 self, "break here", lldb.SBFileSpec("main.cpp")
137 self.runCmd("settings set auto-one-line-summaries false")
138 self.runCmd("type summary add -e -s 'stub summary' Structure")
139 self._expect_cmd(f"dwim-print s", "frame variable")
140 self._expect_cmd(f"dwim-print (struct Structure)s", "expression")
144 """Test dwim-print does not surface an error message for void expressions."""
145 self.build()
147 self, "break here", lldb.SBFileSpec("main.cpp")
149 self.expect("dwim-print (void)15", matching=False, patterns=["(?i)error"])
152 """Test dwim-print does not delete persistent variables."""
153 self.build()
155 self, "break here", lldb.SBFileSpec("main.cpp")
157 self.expect("dwim-print int $i = 15")
161 self.expect("dwim-print $i", startstr="(int) 15")
165 self.build()
167 self, "break here", lldb.SBFileSpec("main.cpp")
169 self.expect("dwim-print -O -- opaque", substrs=["0x"])
172 """Test dwim-print supports certain variable expression paths."""
173 self.build()
175 self, "break here", lldb.SBFileSpec("main.cpp")
177 self.runCmd("settings set auto-one-line-summaries false")
178 self._expect_cmd("dwim-print w.s", "frame variable")
179 self._expect_cmd("dwim-print wp->s", "expression")
182 """Test dwim-print supports accessing members/ivars without qualification."""
183 self.build()
185 self, "break inside", lldb.SBFileSpec("main.cpp")
187 self._expect_cmd("dwim-print number", "frame variable")