diff --git a/scripts/lldbinit.py b/scripts/lldbinit.py index 719a615d14fe..25db83329faa 100644 --- a/scripts/lldbinit.py +++ b/scripts/lldbinit.py @@ -64,6 +64,11 @@ Args: can come with a `0x` prefix, allowing easier copy-paste from raw printed hex values (such as via the `p/x` lldb command). +Aliases: + dc [|-- || ] + - Shorthand for `dump context` which is the common case where there is a + `context` var or method in scope. + Example usage: # Dumps the `inst_id` local variable, with a `context` local variable. dump context inst_id @@ -204,6 +209,7 @@ def format_carbon_id( def __lldb_init_module(debugger: Any, internal_dict: Any) -> None: RunCommand("command script add -f lldbinit.cmd_dump dump") + RunCommand("command alias dc dump context") RunCommand( "type summary add --python-function lldbinit.format_carbon_id" + " --recognizer-function lldbinit.is_carbon_id"