1#!/bin/bash 2# 3# Copyright 2016 The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17 18def run(ctx, args): 19 agent = "libtiagent.so" if args.O else "libtiagentd.so" 20 plugin = "libopenjdkjvmti.so" if args.O else "libopenjdkjvmtid.so" 21 22 if args.switch_interpreter: 23 # On switch interpreter we are fully capable of providing the full jvmti api so we 24 # have a slightly different expected output. 25 ctx.expected_stdout = ctx.expected_stdout.with_suffix(".interpreter.txt") 26 27 ctx.default_run( 28 args, 29 android_runtime_option=[ 30 f"-Xplugin:{plugin}", "-Xcompiler-option", "--debuggable" 31 ], 32 test_args=[f"agent:{agent}=909-attach-agent"]) 33 34 ctx.default_run( 35 args, 36 android_runtime_option=[ 37 f"-Xcompiler-option", "--debuggable" 38 ], 39 test_args=[f"agent:{agent}=909-attach-agent"]) 40 41 ctx.default_run( 42 args, 43 test_args=[f"agent:{agent}=909-attach-agent"], 44 android_log_tags="*:f") 45 46 ctx.default_run( 47 args, 48 test_args=[f"agent:{agent}=909-attach-agent", "disallow-debugging"], 49 android_log_tags="*:f") 50