microsoft / WinDbg-Samples

Sample extensions, scripts, and API uses for WinDbg.
MIT License
707 stars 117 forks source link

How is help text added to function aliases? #45

Open powercode opened 2 years ago

powercode commented 2 years ago

With

dx -r1 Debugger.State.FunctionAliases

I get

    dflow            [!dflow [<address>]
Shows the instructions of the function containing [<address>] which influence the source operands of that instruction.]
    dis              [!dis [<address>]
Disassembles instructions starting at [<address>] using the data model disassembler.]
    printExceptionStack        <- my function

When registering my own function, it only shows the name of the function. How can I add help texts?

Regards

Windbg Preview
Debugger client version: 1.2202.7001.0
Debugger engine version: 10.0.22549.1000
lzybkr commented 2 years ago

The commands descriptions come from the extension gallery manifest.

For example, we have this in the manifest file amd64\OptionalExtensions\DbgModelApiXtn_GalleryManifest.xml:

        <ScriptComponent Name="CodeFlow" Type="Engine" File=".\CodeFlow.js">
            <FunctionAliases>
                <FunctionAlias Name="dflow">
                    <AliasItem>
                        <Syntax>
                            <![CDATA[!dflow [<address>]]]>
                        </Syntax>
                        <Description>
                            <![CDATA[Shows the instructions of the function containing [<address>] which influence the source operands of that instruction.]]>
                        </Description>
                    </AliasItem>
                </FunctionAlias>
                <FunctionAlias Name="dis">
                    <AliasItem>
                        <Syntax>
                            <![CDATA[!dis [<address>]]]>
                        </Syntax>
                        <Description>
                            <![CDATA[Disassembles instructions starting at [<address>] using the data model disassembler.]]>
                        </Description>
                    </AliasItem>
                </FunctionAlias>