CommandCommentDelimiter.sh revision 17113:d17577d4839b
1226026Sdelphij#!/bin/sh
2226026Sdelphij
3226026Sdelphij#
4226026Sdelphij# Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
5226026Sdelphij# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6226026Sdelphij#
7226026Sdelphij# This code is free software; you can redistribute it and/or modify it
8226026Sdelphij# under the terms of the GNU General Public License version 2 only, as
9226026Sdelphij# published by the Free Software Foundation.
10226026Sdelphij#
11226026Sdelphij# This code is distributed in the hope that it will be useful, but WITHOUT
12226026Sdelphij# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13226026Sdelphij# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14226026Sdelphij# version 2 for more details (a copy is included in the LICENSE file that
15226026Sdelphij# accompanied this code).
16226026Sdelphij#
17226026Sdelphij# You should have received a copy of the GNU General Public License version
18226026Sdelphij# 2 along with this work; if not, write to the Free Software Foundation,
19226026Sdelphij# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20226026Sdelphij#
21226026Sdelphij# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22226026Sdelphij# or visit www.oracle.com if you need additional information or have any
23226026Sdelphij# questions.
24226026Sdelphij#
25226026Sdelphij
26226026Sdelphij#
27226026Sdelphij#  @test
28226026Sdelphij#  @bug 4507088
29226026Sdelphij#  @summary TTY: Add a comment delimiter to the jdb command set
30226026Sdelphij#  @author Tim Bell
31226026Sdelphij#  @key intermittent
32226026Sdelphij#  @run shell CommandCommentDelimiter.sh
33226026Sdelphij#
34226026Sdelphij
35226026SdelphijcreateJavaFile()
36226026Sdelphij{
37226026Sdelphij    cat <<EOF > $classname.java.1
38226026Sdelphijpublic class $classname {
39226026Sdelphij    public static void main(String args[]) {
40226026Sdelphij        System.out.print  ("Hello");
41226026Sdelphij        System.out.print  (", ");
42226026Sdelphij        System.out.print  ("world");
43226026Sdelphij        System.out.println("!");
44226026Sdelphij    }
45226026Sdelphij}
46226026Sdelphij
47226026SdelphijEOF
48226026Sdelphij}
49226026Sdelphij
50226026Sdelphij# This is called to feed cmds to jdb.
51226026SdelphijdojdbCmds()
52226026Sdelphij{
53226026Sdelphij   #set -x
54226026Sdelphij   cmd stop in $classname.main
55226026Sdelphij   runToBkpt
56226026Sdelphij   cmd step
57226026Sdelphij   cmd \#
58226026Sdelphij   cmd \#foo
59226026Sdelphij   cmd 3 \#blah
60226026Sdelphij   cmd \# connectors
61226026Sdelphij   cmd step
62226026Sdelphij   cmd allowExit cont
63226026Sdelphij}
64226026Sdelphij
65226026Sdelphijmysetup()
66226026Sdelphij{
67226026Sdelphij    if [ -z "$TESTSRC" ] ; then
68226026Sdelphij        TESTSRC=.
69226026Sdelphij    fi
70226026Sdelphij
71226026Sdelphij    for ii in . $TESTSRC $TESTSRC/.. ; do
72226026Sdelphij        if [ -r "$ii/ShellScaffold.sh" ] ; then
73226026Sdelphij            . $ii/ShellScaffold.sh
74226026Sdelphij            break
75226026Sdelphij        fi
76226026Sdelphij    done
77226026Sdelphij}
78226026Sdelphij
79226026Sdelphij# You could replace this next line with the contents
80226026Sdelphij# of ShellScaffold.sh and this script will run just the same.
81226026Sdelphijmysetup
82226026Sdelphij
83226026Sdelphijrunit
84226026SdelphijjdbFailIfPresent "Unrecognized command: '#'.  Try help..." 50
85226026SdelphijjdbFailIfPresent "Available connectors are" 50
86226026Sdelphijpass
87226026Sdelphij