jdk/test/com/sun/jdi/cds/CDSBreakpointTest.java
author cjplummer
Fri, 05 Jun 2015 13:38:13 -0700
changeset 31452 5f705077cf7a
child 31672 b500fc688bf0
permissions -rw-r--r--
8054386: Allow Java debugging when CDS is enabled Summary: Map archive RW when debugging is enabled Reviewed-by: sspitsyn, iklam, mseledtsov, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31452
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
     1
/*
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
     4
 *
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
     7
 * published by the Free Software Foundation.
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
     8
 *
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    13
 * accompanied this code).
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    14
 *
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    18
 *
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    21
 * questions.
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    22
 */
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    23
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    24
/*
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    25
 * @test
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    26
 * @bug 8054386
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    27
 * @summary java debugging test for CDS
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    28
 * @modules jdk.jdi
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    29
 *          java.base/sun.misc
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    30
 *          java.management
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    31
 *          jdk.jartool/sun.tools.jar
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    32
 * @library /lib/testlibrary
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    33
 * @library ..
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    34
 * @run compile -g ../BreakpointTest.java
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    35
 * @run main CDSBreakpointTest
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    36
 */
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    37
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    38
/*
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    39
 * Launch the JDI BreakpointTest, which will set a debugger breakpoint in
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    40
 * BreakpointTarg. BreakpointTarg is first dumped into the CDS archive,
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    41
 * so this will test debugging a class in the archive.
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    42
 */
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    43
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    44
public class CDSBreakpointTest extends CDSJDITest {
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    45
    static String jarClasses[] = {
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    46
        // BreakpointTarg is the only class we need in the archive. It will
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    47
        // be launched by BreakpointTest as the debuggee application. Note,
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    48
        // compiling BreakpointTest.java above will cause BreakpointTarg to
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    49
        // be compiled since it is also in BreakpointTest.java.
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    50
        "BreakpointTarg",
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    51
    };
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    52
    static String testname = "BreakpointTest";
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    53
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    54
    public static void main(String[] args) throws Exception {
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    55
        runTest(testname, jarClasses);
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    56
    }
5f705077cf7a 8054386: Allow Java debugging when CDS is enabled
cjplummer
parents:
diff changeset
    57
}