Fix mini-debug-info generation for apps with wrap.sh script.

Debuggable apps enable mini-debug-info after fork, however, this does not
work with apps with wrap.sh script since they follow different code path.

Enable mini-debug-info generation for those as well.

Bug: 74070426
Test: check that app with wrap.sh generates debug info for JIT now

(cherry picked from commit 28a89370f0)

Merged-In: I489ac3c82bcced8fc0448ed5666f67009cbb043d
Change-Id: I22db2e889e918eb4b64c722289f7c046bb499d1d
This commit is contained in:
David Srbecky
2018-03-21 12:58:00 +00:00
parent ae2f368907
commit b7df58c81f

View File

@@ -115,6 +115,14 @@ public class WrapperInit {
command.append(' ');
command.append(appProcess);
// Generate bare minimum of debug information to be able to backtrace through JITed code.
// We assume that if the invoke wrapper is used, backtraces are desirable:
// * The wrap.sh script can only be used by debuggable apps, which would enable this flag
// without the script anyway (the fork-zygote path). So this makes the two consistent.
// * The wrap.* property can only be used on userdebug builds and is likely to be used by
// developers (e.g. enable debug-malloc), in which case backtraces are also useful.
command.append(" -Xcompiler-option --generate-mini-debug-info");
command.append(" /system/bin --application");
if (niceName != null) {
command.append(" '--nice-name=").append(niceName).append("'");