Skip to content

Commit

Permalink
more help strings
Browse files Browse the repository at this point in the history
  • Loading branch information
JensDll committed May 3, 2024
1 parent 17bdfa1 commit 0ad51c7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
6 changes: 5 additions & 1 deletion unix/.config/lldbdash/dashboard/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"text-secondary": lldbdash.commands.StrCommand,
"divider-fill-char": lldbdash.commands.StrCommand,
"show-divider": lldbdash.commands.BoolCommand,
"auto-apply-config": lldbdash.commands.BoolCommand,
},
)

Expand All @@ -36,6 +37,9 @@ class Dashboard:
"text-secondary": lldbdash.commands.StrCommand("\033[38;2;114;114;110m"),
"divider-fill-char": lldbdash.commands.StrCommand("─"),
"show-divider": lldbdash.commands.BoolCommand(True),
"auto-apply-config": lldbdash.commands.BoolCommand(
True, help="Auto apply config changes when edited during debug session."
),
}
enabled: typing.ClassVar[lldbdash.commands.ToggleCommand]

Expand Down Expand Up @@ -74,7 +78,7 @@ def print_divider(self, size: "terminal_size", module: "Module", out: Output):

def apply_config(self):
path = pathlib.Path.cwd() / Dashboard.settings["config-file"].value
if path.is_file():
if path.is_file() and Dashboard.settings["auto-apply-config"].value:
config_modified_time = path.stat().st_mtime
if config_modified_time > self.config_modified_time:
self.config_modified_time = config_modified_time
Expand Down
22 changes: 13 additions & 9 deletions unix/.config/lldbdash/modules/assembly_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,29 +297,33 @@ class AssemblyModule:
name = "assembly"
settings: "ModuleSettings" = {
"instructions-before": lldbdash.commands.IntCommand(
10, help="Number of instructions before the program counter."
10, help="The number of instructions displayed before the program counter."
),
"instructions-after": lldbdash.commands.IntCommand(
10, help="Number of instructions after the program counter."
10, help="The number of instructions displayed after the program counter."
),
"disassembly-flavor": lldbdash.commands.StrCommand(
"intel", help="The disassembly flavor."
"intel", help="The disassembly flavor (default, att, intel)."
),
"show-opcode": lldbdash.commands.BoolCommand(
True, help="Whether to show the opcode."
True, help="Whether to display the opcode."
),
"text-comment": lldbdash.commands.StrCommand(
"\033[38;2;14;188;108m", help="The color of instruction comments."
"\033[38;2;14;188;108m", help="The color of the instruction comment."
),
"text-mnemonic": lldbdash.commands.StrCommand(
"\033[38;2;17;168;193m", help="The color of instruction mnemonics."
"\033[38;2;17;168;193m", help="The color of the instruction mnemonic."
),
"predict-branching": lldbdash.commands.BoolCommand(
True, help="Whether to show branch information."
),
"predict-branching": lldbdash.commands.BoolCommand(True),
"branch-taken-marker": lldbdash.commands.StrCommand(
f"\033[38;2;14;188;108my{RESET_COLOR}"
f"\033[38;2;14;188;108my{RESET_COLOR}",
help='The branch taken marker displayed when "predict-branching" is enabled.',
),
"branch-not-taken-marker": lldbdash.commands.StrCommand(
f"\033[38;2;215;89;76mn{RESET_COLOR}"
f"\033[38;2;215;89;76mn{RESET_COLOR}",
help='The branch not taken marker displayed when "predict-branching" is enabled.',
),
"output": lldbdash.commands.StrCommand(
"0",
Expand Down
10 changes: 5 additions & 5 deletions unix/.config/lldbdash/modules/register/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,20 @@ def __init__(self, frame: lldb.SBFrame):
["r14", "r14d", "r14w", "r14l"],
["r15", "r15d", "r15w", "r15l"],
):
indices = list[int](filter(not_none, (gp_index.get(r, None) for r in regs)))
indices = list[int](filter(not_none, (gp_index.get(r) for r in regs)))
values = [self.gp_reg_set.GetChildAtIndex(indices[0]).GetValueAsUnsigned()]
self.entries[regs[0]] = Entry(indices, values, pc)

for reg in ["cs", "ds", "ss", "es", "fs", "gs", "rflags"]:
index = gp_index.get(reg, None)
index = gp_index.get(reg)
if index is None:
continue
values = [self.gp_reg_set.GetChildAtIndex(index).GetValueAsUnsigned()]
self.entries[reg] = Entry([index], values, pc)

for i in range(16):
xmm = f"xmm{i}"
index = fp_index.get(xmm, None)
index = fp_index.get(xmm)
if index is None:
continue
values = [
Expand All @@ -89,7 +89,7 @@ def __init__(self, frame: lldb.SBFrame):
self.entries[xmm] = Entry([index], values, pc)

for reg in ["mxcsr"]:
index = fp_index.get(reg, None)
index = fp_index.get(reg)
if index is None:
continue
values = [self.fp_reg_set.GetChildAtIndex(index).GetValueAsUnsigned()]
Expand All @@ -98,7 +98,7 @@ def __init__(self, frame: lldb.SBFrame):
for i in range(16):
ymm = f"ymm{i}"
xmm = f"xmm{i}"
index = avx_index.get(ymm, None)
index = avx_index.get(ymm)
if index is None:
continue
values = [
Expand Down
10 changes: 5 additions & 5 deletions unix/.config/lldbdash/modules/register_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ class RegisterModule:
name = "register"
settings: "ModuleSettings" = {
"show-decimal": lldbdash.commands.BoolCommand(
True, help="Display general purpose registers decimal value."
True, help="Display the general purpose register decimal value."
),
"show-segment": lldbdash.commands.BoolCommand(
True, help="Display segment reader."
True, help="Display the segment registers."
),
"show-rflags": lldbdash.commands.BoolCommand(
True, help="Display rflags register."
True, help="Display the rflags register."
),
"show-mxcsr": lldbdash.commands.BoolCommand(
True, help="Display mxcsr register."
True, help="Display the mxcsr register."
),
"show-vector": lldbdash.commands.BoolCommand(
True, help="Display vector reader."
True, help="Display the vector registers."
),
"output": lldbdash.commands.StrCommand(
"0",
Expand Down

0 comments on commit 0ad51c7

Please sign in to comment.