Please enable JavaScript to view this site.

Memory Validator Help

 

Specifying the target application

 

The folllowing options let you launch a program (with various startup modes), inject into a running program or wait for a program to start before attaching.

 

 

Launching a program

 

-program

 

Specifies the full file system path of the executable target program to be started by Memory Validator, including any extension.

 

Not compatible with -injectName, -injectID, -waitName or -monitorAService.

 

See -arg below to pass arguments to your program, and -directory to set where it runs.

 

See -programToMonitor to monitor a different program than the program you launch.

 

Examples:

 

-program c:\testbed.exe

-program "c:\new compiler\version2\testbed.exe"

 

 

-programToMonitorEXE

   -programToMonitor

 

-programToMonitor has been replaced by -programToMonitorEXE. -programToMonitor will be honoured to provided backward compatibility.

 

Specifies the full path of the program from which the data is collected, but does not change which process is initially launched. Include the extension.

 

This program will be monitored by Memory Validator only when the program specified using -program starts it.

 

If no path is specified, the first child process that has the same name will be monitored.

 

To monitor any program that is launched specify <<Any>> as the program argument. In batch files and powershell scripts you will need to quote this to get it accepted by the file parser.

 

See -programToMonitorLaunchCount to change which instance of the program is monitored.

 

Only valid in conjunction with -program.

 

Examples:

 

-programToMonitorEXE c:\testbed-child-process.exe

-programToMonitorEXE "c:\new compiler\version2\testbedChildProcess.exe"

-programToMonitorEXE testbed-child-process.exe

-programToMonitorEXE "<<Any>>"

 

-program c:\testbed.exe -programToMonitorEXE c:\testbed-child-process.exe

 

In this last example c:\testbed.exe is launched but not monitored. Only when testbed.exe launches a child process c:\testbed-child-process.exe is that child process monitored.

 

 

-programToMonitorDLL

 

This option provides a qualifying DLL to identify different .Net Core processes, which are typically launched using the same .Net Core runtime. Include the dll extension.

 

Only valid in conjunction with -program and -programToMonitorEXE.

 

Examples:

 

-programToMonitorDLL c:\test\dotNetCoreApp.dll

 

-program c:\testbed.exe -programToMonitorEXE "c:\program files\dotnet\dotnet.exe" -programToMonitorDLL c:\test\dotNetCoreApp.dll

 

In this last example c:\testbed.exe is launched but not monitored. Only when testbed.exe launches a child process c:\program files\dotnet\dotnet.exe to run the application c:\test\dotNetCoreApp.dll is that child process monitored.

 

 

-programToMonitorLaunchCount

 

Specify the nth invocation of the program specified by -programToMonitor which is to have its data collected.

 

Any value which is invalid (including anything less than 1) will default to 1.

 

Only valid in conjunction with -programToMonitor and consequently also -program.

 

Examples:

 

-programToMonitorLaunchCount 1

-programToMonitorLaunchCount 34

 

-program c:\testbed.exe -programToMonitor c:\testbed-child-process.exe -programToMonitorLaunchCount 1

 

In the above example c:\testbed.exe is launched but not monitored. As soon as testbed.exe launches a child process c:\testbed-child-process.exe then that child process monitored.

 

If the value 1 was changed to a 2, then only the second invocation of c:\testbed-child-process.exe would get monitored, with the first invocation being ignored.

 

 

-arg

 

Passes command line arguments to the target program, and can be used multiple times.

 

note To pass quotes along with the string, escape a pair of inner quotes like the example below

 

Only valid with: -program

 

-arg myProgram.exe

-arg "c:\Program Files\myApp\myProgram.exe"

-arg "-in infile -out outfile"
-arg "\"a quoted string\""

 

 

-allArgs

 

Passes the remainder of the command line (after -allArgs) to the program being launched.

 

Unlike -arg above, there is no need to escape the quotes as the content is passed verbatim.

 

Only valid with: -program

 

Example:

 

-allArgs anything put here is passed to the target program "even stuff in quotes" is passed

 

 

-directory

 

Sets the working directory in which the program is executed. If -directory is not specified the program is run in its current directory.

 

Only valid with: -program

 

Examples:

 

-directory c:\development\

-directory "c:\research and development\"

 

 

-environment

 

Environment variables for program, as a series of name/value pairs. Not to be confused with -setenvironment.

 

Use this option once for each environment variable you wish to set.

 

note To pass quotes along with the string, escape a pair of inner quotes like the example below

 

Only valid with: -program

 

Examples:

 

-environment APP_FLAG=ON;

-environment "APP_FAG=ON;"

-environment "APP_COMMS=ON; APP_DEBUG=OFF;"
-environment "APP_MSG=\"A quoted string with spaces\";"
 

 

-dataCollectType

 

Specifies the type of data collection that you want. Native, .Net or mixed mode (both native and .Net).

 

Valid with -program and -monitorAService.

 

Examples:

 

 -dataCollectType native

 -dataCollectType dotNet

 -dataCollectType mixedMode

 

 

-stdin

 

Specifies a file to be read and piped to the standard input of the application being tested.

 

If the filename contains spaces, the filename should be quoted.

 

An error occurs if the file does not exist. See -ignoreMissingStdin to avoid this error.

 

Examples:

 

-stdin c:\settings\input.txt

-stdin "c:\reg tests settings\input.txt"

 

 

-stdout

 

Specifies a file to be written with data piped from the standard output of the application being tested.

 

If the filename contains spaces, the filename should be quoted.

 

An error occurs if the file does not exist. See -ignoreMissingStdout to avoid this error.

 

Examples:

 

-stdout c:\settings\output.txt

-stdout "c:\reg tests results\output.txt"

 

 

-ignoreMissingStdin

 

If this flag is specified and the file specified by -stdin does not exist, no error is reported.

 

 

-ignoreMissingStdout

 

If this flag is specified and the file specified by -stdout does not exist, no error is reported.

 

 

Target program startup modes

 

-createProcessStartupThread

-normalStartupThread

-idleStartupThread

-suspendStartupThread

-pauseStartupThread

-noSuspendInStubDuringAttach

 

All these options are obsolete and will be ignored if present on command lines or in command files.

 

 

Injecting into a program

 

-injectName

 

Sets the name of the process for Memory Validator to attach to.

 

Not compatible with -program, -injectID, -waitName or -monitorAService.

 

Examples:

 

-injectName c:\testbed.exe

-injectName "c:\new compiler\version2\testbed.exe"

 

 

-injectID

 

Sets the numeric id of a process for Memory Validator to attach to.

 

Not compatible with -program, -injectName, -waitName or -monitorAService.

 

Example:

 

-injectID 1032

 

 

Waiting for a program

 

-waitNameEXE

   -waitName

 

-waitName has been replaced by -waitNameEXE. -waitName will be honoured to provided backwards compatibility.

 

Sets the name of a process that Memory Validator will wait for.

 

When the named process starts Memory Validator will attach to the process.

 

Not compatible with -program, -injectName, -injectID or -monitorAService.

 

Examples:

 

-waitNameEXE c:\testbed.exe

-waitNameEXE "c:\new compiler\version2\testbed.exe"

 

 

-waitNameDLL

 

Sets the name of a process DLL that Memory Validator will wait for.

 

When the named process starts Memory Validator will attach to the process.

 

Examples:

 

-waitNameDLL c:\dotNetApp.dll

-waitNameDLL "c:\new compiler\version2\dotNetApp.dll"

 

 

For use with -waitNameEXE when you want to wait for .Net Core applications.

 

-waitNameEXE "c:\program files\dotnet\dotnet.exe" -waitNameDLL "c:\testApps\dotNetCoreApp\release\dotNetCoreApp.dll"

 

 

Monitoring a service

 

-monitorAService

 

Sets the full file system path of a service including any extension.

 

Memory Validator will wait for the service to start and attach to it.

 

Not compatible with -program, -injectName, -injectID or -waitName.

 

Examples:

 

-monitorAService c:\service.exe

-monitorAService "c:\new compiler\version2\service.exe"

 

 

.Net Core specific arguments

 

-dotNetCoreArg

 

Specifies and argument to pass to the .Net Core runtime. You can specify -dotNetCoreArg as many times as you need to pass as many arguments as you need.

 

See this Microsoft document for the list of .Net Core runtime configuration options https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet#runtime-options.

 

Use this argument with -program.

 

Examples:

 

 -dotNetCoreArg "--roll-forward LatestPatch"

 -dotNetCoreArg "--runtimeconfig ./configUnitTest.json"

 

-dotNetCoreLaunchType

 

Specifies the type of program being launched by the .Net Core runtime. You can specify -dotNetCoreLaunchType once. If specified more than once, the last definition is used.

 

Use this argument with -program.

 

Examples:

 

 -dotNetCoreLaunchType SelfContained

 -dotNetCoreLaunchType FrameworkDependent

 

 

Data Collection

 

-collectData

 

Enables or disables the collection of flow tracing data

 

Examples:

 

 -collectData:On

 -collectData:Off

 

 

-collectStdout

 

Enables or disables the collection of standard output (stdout)

 

Examples:

 

 -collectStdout:On

 -collectStdout:Off