summaryrefslogtreecommitdiff
path: root/lldb/examples/python/cmdtemplate.py
diff options
context:
space:
mode:
authorMingming Liu <mingmingl@google.com>2025-09-10 15:25:31 -0700
committerGitHub <noreply@github.com>2025-09-10 15:25:31 -0700
commit1417dafa1db9cb1b2b09438aa9f53ea5ab6e36e2 (patch)
tree57f4b1f313c8cf74eed8819870f39c36ea263c68 /lldb/examples/python/cmdtemplate.py
parent898b813bc8a6d0276bf0f4769f5f2f64b34e632d (diff)
parentb8cefcb601ddaa18482555c4ff363c01a270c2fe (diff)
Merge branch 'main' into users/mingmingl-llvm/samplefdo-profile-formatusers/mingmingl-llvm/samplefdo-profile-format
Diffstat (limited to 'lldb/examples/python/cmdtemplate.py')
-rw-r--r--lldb/examples/python/cmdtemplate.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/examples/python/cmdtemplate.py b/lldb/examples/python/cmdtemplate.py
index a9fbe0b40e19..be4c2da53ee0 100644
--- a/lldb/examples/python/cmdtemplate.py
+++ b/lldb/examples/python/cmdtemplate.py
@@ -74,6 +74,11 @@ class FrameStatCommand(ParsedCommand):
dest = "statics",
default = True,
)
+ ov_parser.add_option(
+ "t",
+ "test-flag",
+ help="test a flag value.",
+ )
def get_repeat_command(self, args):
"""As an example, make the command not auto-repeat:"""
@@ -123,6 +128,11 @@ class FrameStatCommand(ParsedCommand):
% (variables_count, total_size, average_size),
file=result,
)
+ if ov_parser.was_set("test-flag"):
+ print("Got the test flag")
+ else:
+ print("Got no test flag")
+
# not returning anything is akin to returning success