1451N/A * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 553N/A * or visit www.oracle.com if you need additional information or have any 0N/A * @summary Breakpoints on multiple threads have problems. 0N/A * @build TestScaffold VMConnection TargetListener TargetAdapter 0N/A * @run main MultiBreakpointsTest 0N/A * This test runs a debuggee with n threads each of which just loops 0N/A * doing some printlns and calling a method. The debugger sets 0N/A * bkpts on these methods and verifies that they are all hit. 0N/A * The default number of threads is 4. To change it to say 10, 0N/A * pass this to the testcase on the cmd line: 0N/A * The current max allowed value of nthreads is 30. 0N/A * You can also do this, for example, 0N/A * to change the number of times the bkpts are to be hit from 0N/A * the default of 100 to 30. /********** target program **********/ // for (int i = 0; i < nthreads; i++) { // The brute force approach for simplicity - don't use reflection // nor set thread specific bkpts. Use of those features would // make for interesting tests too, and maybe would prove that // we don't really have to bother doing it this dumb way. //final String threadName = "DebuggeeThread: " + num; // For each thread, run until numHits bkpts have been hit for(
int i =
0; i <
nhits; i++ ) {
// This is a tendril from the original jdb test. // It could probably be deleted. /********** test program **********/ /********** event handlers **********/ //bpr.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD); /********** test core **********/ * Get to the top of main() * to determine targetClass and mainThread * resume the target listening for events failure(
"FAILED: Expected " +
nhits +
" breakpoints for thread " +
ii +
" but only got " +
hits[
ii]);
* deal with results of test * if anything has called failure("foo") testFailed will be true println(
"MultiBreakpointsTest: passed");
throw new Exception(
"MultiBreakpointsTest: failed");