From df6cb282937e5f804686ebbc952ae9f2290d93c7 Mon Sep 17 00:00:00 2001 From: Tamas Berghammer Date: Fri, 29 Jan 2016 12:07:00 +0000 Subject: Add flag to "am start" to enable native debugging Specifying the new flag will enable several features in the runtime required by the native debugger to debug Java and C++ code at the same time. The enabled features: * Force JIT (never use the interpreter) * Debug info generation * Disbale some optimizations Change-Id: Iaf5ab649715a0c274bd1b0fc64e483705da53cd0 --- cmds/am/src/com/android/commands/am/Am.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmds') diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index ba93b2a2cafe..8187468805c3 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -121,7 +121,7 @@ public class Am extends BaseCommand { PrintWriter pw = new PrintWriter(out); pw.println( "usage: am [subcommand] [options]\n" + - "usage: am start [-D] [-W] [-P ] [--start-profiler ]\n" + + "usage: am start [-D] [-N] [-W] [-P ] [--start-profiler ]\n" + " [--sampling INTERVAL] [-R COUNT] [-S]\n" + " [--track-allocation] [--user | current] \n" + " am startservice [--user | current] \n" + @@ -180,6 +180,7 @@ public class Am extends BaseCommand { "\n" + "am start: start an Activity. Options are:\n" + " -D: enable debugging\n" + + " -N: enable native debugging\n" + " -W: wait for launch to complete\n" + " --start-profiler : start profiler and send results to \n" + " --sampling INTERVAL: use sample profiling with INTERVAL microseconds\n" + @@ -473,6 +474,8 @@ public class Am extends BaseCommand { public boolean handleOption(String opt, ShellCommand cmd) { if (opt.equals("-D")) { mStartFlags |= ActivityManager.START_FLAG_DEBUG; + } else if (opt.equals("-N")) { + mStartFlags |= ActivityManager.START_FLAG_NATIVE_DEBUGGING; } else if (opt.equals("-W")) { mWaitOption = true; } else if (opt.equals("-P")) { -- cgit v1.2.3-59-g8ed1b