Arguments to debugWrapper script

Nov 21, 2011 at 10:07 PM

Hi, I think the debugWrapper script is going to be useful to me. Would anyone be able to explain these two parameters to the script?

@REM  ^%~2 = command line arguments including tempate name if needed. I.E. "/C:search" TemplateFile.txt
@REM  ^%~3 = Temple file to process.

What is a template file supposed to be, and which parameter number should it be? Which parameter number should the input file, that causes an application crash, be? I'm a bit confusion by the repetition of "template" in parameters 2 and 3.

Thanks for the help!

Coordinator
May 3, 2012 at 5:32 PM
Edited May 3, 2012 at 5:40 PM

I hope the following example helps clarify the issue.

debuggerWrapper.cmd takes 5 arguments

  1. The program to debug
  2. The command line to the program
  3. The path to the file being tested  
    •  This is needed because not all programs consume a file from the command line. Without this argument it would not be possible to copy the file to the repro location when a crash occurred.
  4. Max Time in seconds to debug the program
  5. The directory to save crashes and repro files too

In this example lets say you want to test the string literal search functionality of findstr.exe. The command line to this this is "findstr.exe /C:string filename". You have created a file named:\Files\TemplateFile.txt that you want to use as the file. If the debuggerWrapper detects a problem you want the files saved to c:\repro. To Run this scenario you would use the following command line.

  1. commandline : %systemdir%\system32\findstr.exe
  2. arguments : "/C:string C:\Files\TemplateFile.txt"
    • Notice the quotes encasing the entire commandline, you may need to escape quotes if they are required by the program.
  3. path to file :  C:\File\TempalteFile.txt
  4. timeout : 5
  5. save path :  C:\repro

Put it all together and you get

DebuggerWrapper.cmd %systemdir%\system32\findstr.exe "/C:string C:\Files\TemplateFile.txt" C:\File\TempalteFile.txt 5 C:\repro