2

我试图让 ADPlus 运行 PostCommand,但调用失败。

我首先使用的是在旧版本的 ADPlus 中调用 PreCommand 的配置文件。配置文件如下所示:

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

当我使用此配置文件运行 ADPlus 时,我收到以下错误并且没有生成故障转储:

!!! 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

看到它认为 C:\path\to\foo\foobar.exe 应该是一个关键字,我试着把它变成一个关键字,将我的配置文件更改为:

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

使用新的配置文件,会生成转储,但之后我的 PostCommand 没有运行。我在 ADPlus 日志中收到以下错误:

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

请注意,驱动器名称 C 在地址表达式缺失行中被删除。

有谁知道为什么我的 PostCommand 没有运行?ADPlus 的文档很少,但我遵循 adplus.doc 中给出的配置文件格式,它是 Microsoft 调试器包的一部分。我在 PostCommand 周围尝试了各种引号和反斜杠组合,但仍有可能我没有正确引用或转义某些内容。adplus.doc 中的示例没有任何引号或转义字符。

4

1 回答 1

1

我可以通过将配置文件更改为:

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

C:\foobar 是传递给 foobar.exe 的参数。当我尝试在标签中包含参数时它不起作用。或者,您可以在 -i 指定的文件中提供参数。-i- 没有指定输入文件,所以我提供了内联参数。

于 2012-08-31T23:58:53.780 回答