[Lldb-commits] [lldb] [LLDB][Docs] List available settings (PR #168245)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 12 08:51:08 PST 2026
================
@@ -0,0 +1,106 @@
+import argparse
+from typing import TypedDict, Union, Optional, TextIO, NotRequired
+from dataclasses import dataclass
+import json
+
+
+class Property(TypedDict):
+ name: str
+ type: str
+ default: NotRequired[str]
+ description: NotRequired[str]
+
+
+class PropertyGroup(TypedDict):
+ path: str
+ """The full path to this group separated by dots"""
+ properties: list[Property]
+
+
+ at dataclass
+class PropertyTree:
+ items: dict[str, Union["PropertyTree", Property]]
+
+
+def append_group(tree: PropertyTree, group: PropertyGroup):
+ segments = group["path"].split(".") if group["path"] else []
+
+ subtree = tree
+ for segment in segments:
+ if segment not in subtree.items:
+ subtree.items[segment] = PropertyTree(items={})
+ subtree = subtree.items[segment]
+ assert isinstance(subtree, PropertyTree)
+
+ for property in group["properties"]:
+ subtree.items[property["name"]] = property
+
+
+def print_property(f: TextIO, path: str, property: Property):
+ f.write(f"```{{lldbsetting}} {path}\n")
----------------
DavidSpickett wrote:
Ok I understand. I was thinking about the file being markdown but ofc you need a way to trigger sphinx directives.
https://github.com/llvm/llvm-project/pull/168245
More information about the lldb-commits
mailing list