Files
clang-p2996/lldb/test/API/functionalities/target_var/TestTargetVar.py
Felipe de Azevedo Piovezan 12329648e2 [lldb] Omit --show-globals in help target var (#85855)
This option doesn't exist. It is currently displayed by `help target
var` due to a bug introduced by 41ae8e7445 in 2018.

Some code for `target var` and `frame var` is shared, and some hard-code
constants are used in order to filter out options that belong only to
`frame var`. However, the aforementioned commit failed to update these
constants properly. This patch addresses the issue by having a _single_
place where the filtering of options needs to be done.
2024-03-20 07:03:24 -07:00

37 lines
1.1 KiB
Python

"""
Test that target var can resolve complex DWARF expressions.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class targetCommandTestCase(TestBase):
@skipIfDarwinEmbedded # needs x86_64
@skipIf(debug_info="gmodules") # not relevant
@skipIf(compiler="clang", compiler_version=["<", "7.0"])
def testTargetVarExpr(self):
self.build()
lldbutil.run_to_name_breakpoint(self, "main")
self.expect(
"help target variable",
substrs=[
"--no-args",
"--no-recognized-args",
"--no-locals",
"--show-globals",
],
matching=False,
)
self.expect("target variable i", substrs=["i", "42"])
self.expect(
"target variable var", patterns=["\(incomplete \*\) var = 0[xX](0)*dead"]
)
self.expect(
"target variable var[0]",
error=True,
substrs=["can't find global variable 'var[0]'"],
)