.netdebuggingwindbgadplus

ADPlus PostCommand not running


I'm trying to get ADPlus to run a PostCommand, but the call is failing.

I first was using the config file that I had used to call a PreCommand in an older version of ADPlus. The config file looks like this:

...
<PostCommands>
    <ShellSync>
        <Application> C:\path\to\foo\foobar.exe </Application>
        <Arguments> C:\foobar </Arguments>
    </ShellSync>
</PostCommands>
...

When I run ADPlus with this config file, I get the following error and no crash dump is generated:

!!! ERROR !!!
Invalid key word: [C:\path\to\foo\foobar.exe]
at ADPlus.AdplusEngine.KeyWord2Command(String KeyWord, String Context, Boolean UseEscapedFlnm)
at ADPlus.AdplusEngine.ParseKeywords(String KeyWords, String Context, Boolean UseEscapedFlnm)
at ADPlus.AdplusEngine.CreateCDBScript(String FileName, AdplusApl CallingApl)
at ADPlus.AdplusApl.TryRun()
!!!ERROR - ADPlus failed to run

Seeing that it thought C:\path\to\foo\foobar.exe was supposed to be a keyword, I tried to make it one, changing my config file to this:

...
<KeyWords>
   <KeyWord Name="FooBar"> C:\path\to\foo\foobar.exe </KeyWord>
</KeyWords>
...
<ShellSync>
        <Application> FooBar </Application>
        <Arguments> C:\foobar </Arguments>
</ShellSync>
...

With the new config file, a dump is generated, but my PostCommand is not running afterward. I get the following error in the ADPlus log:

...
0:004> * Post-commands
0:004> C:\path\to\foo\foobar.exe
Address expression missing from ':\path\to\foo\foobar.exe'
0:004> g
...

Note that the drive name, C, is being stripped off in the Address expression missing line.

Does anyone have any ideas why my PostCommand isn't running? Documentation for ADPlus is sparse, but I'm following the config file format given in adplus.doc which is part of the Microsoft debugger package. I've tried various combinations of quotes and backslashes around my PostCommand, but it is still possible that I'm not quoting or escaping something properly. The example in adplus.doc does not have any quotes or escape characters.


Solution

  • I was able to solve this by changing the config file to:

    ... 
    <KeyWords> 
       <KeyWord Name="FooBar"> .shell -i- C:\path\to\foo\foobar.exe C:\foobar</KeyWord> 
    </KeyWords> 
    ... 
    <ShellSync> 
            <Application> FooBar </Application> 
    </ShellSync> 
    ...
    

    C:\foobar is the argument passed into foobar.exe. It didn't work when I tried having the argument in the tag. Alternatively, you can provide arguments in the file specified by -i. -i- does not specify an input file, so I provided the arguments inline.