History log of /external/vogar/src/vogar/commands/VmCommandBuilder.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
96d88e038d269742325394392a1aa98054c9de7b 15-Feb-2016 Neil Fuller <nfuller@google.com> Retry implementing --debuggable

VmCommandBuilder is also used for --mode jvm:
"-Xcompiler-option --debuggable" cannot be inserted there;
the "java" command rejects it.

Bug: 27186214
(cherry-picked from commit 9712658a463c437f5437bcd981e7e6beacac0dc5)

Change-Id: Ic4fab77aed0f6b844aae0ce1c503618bef7ceb5e
/external/vogar/src/vogar/commands/VmCommandBuilder.java
0470a1253fcd6617615849c9aac56689edfe5ee7 15-Feb-2016 Neil Fuller <nfuller@google.com> Pass -Xcompiler-option --debuggable to davlikvm/app_process when debugging

In order to retain certain debug symbols / prevent some optimizations
the extra flags are required (with ART).

Bug: 27186214
Bug: 27064439
(cherry-picked from commit f7d29b2c1f3d7bf695ccff3595548ced0df33652)

Change-Id: Ia354f1928448f0759f66d11f918f4b1bd15f0b7b
/external/vogar/src/vogar/commands/VmCommandBuilder.java
411cb1fb67241125203629229600ecbd821eb9c7 19-Nov-2015 Paul Duffin <paulduffin@google.com> Fix escaping and grouping of arguments to the Target shells

Vogar allows custom arguments to be passed to the classes being
tested. If these contain special shell characters then the
command line used to run the tests may not be correct. e.g. If
the argument was "-Cvm.args=-Xmx256M -Xms256M" (which tells
Caliper to run the benchmark in a process with an initial and
maximum heap size of 256M) then when the command is actually run
by the adb shell they are split into two arguments,
"-Cvm.args=-Xmx256M" and "-Xms256M" which causes Caliper to fail
as the latter is an unrecognized Caliper option.

The solution is to simply escape any special shell characters
with a backslash (\) to ensure that they are treated as literal
characters.

Another bug is that any use of an argument "-c" will result in
all the following arguments being grouped into one, e.g.
fred -c wilma barney betty
will become
fred -c "wilma barney betty"

This behaviour is required when the -c option is part of "sh"
"-c" but not in any other case. This is currently implemented in
Command which is the wrong place as it's a generic class
independent of the Target and the grouping is dependent on the
target shell.

After some investigation it turns out that while grouping isn't
required for AdbTarget and SshTarget like it is for HostTarget
neither does it break anything. Therefore, for simplicity's sake
all targets will group their arguments into one when executing
the command line. That will be done before it is appended to the
targetProcessPrefix().

The escaping and grouping will be done by a new
Target.ScriptBuilder class, instances of which will be created
by a Target.newScriptBuilder() method that will make sure that
the ScriptBuilder returned will be appropriate for the target
shell.

It will provide support for specifying inline environment
variables, a working directory and adding tokens to the command
line. It will escape where necessary, e.g. it will not escape
the environment variable name or assignment but will escape the
value. It will escape all the tokens. When asked to construct an
appropriate command line to execute that script it will group
the script contents into one argument and append it to a target
specific prefix.

VmCommandBuilder will use the new ScriptBuilder to build the
command line that it then passes to Command. It will also be
changed to track environment variables explicitly (will use the
existing but unused env field and method) which it will then
pass onto the ScriptBuilder. Finally, it will track the
workingDirectory as well.

DeviceRuntime and HostRuntime will both change how they use
VmCommandBuilder to make use of the env(String, String) method
and the new workingDirectory(File).

Command will remove the processArgs() method and simply take a
copy of its args.

Added new tests for ScriptBuilder.escape(String) method and
a JUnit 4 TestSuite AllTests that can be used to run all the
tests that currently work within an IDE.

Change-Id: I0351c9fd3fe9d42c1b454251cf78ff74fafb08b2
/external/vogar/src/vogar/commands/VmCommandBuilder.java
f83be5e4273263df2bb9ef609946b911695b3996 02-Dec-2011 jessewilson@google.com <jessewilson@google.com@aa685c63-decc-881d-cd2b-7fa72aad72e1> Use tasks everywhere.

I still need to smash together the 'Run' and 'Vogar' classes; this is an intermediate step on the way to removing miniguice DI from vogar.

git-svn-id: http://vogar.googlecode.com/svn/trunk@263 aa685c63-decc-881d-cd2b-7fa72aad72e1
/external/vogar/src/vogar/commands/VmCommandBuilder.java