annotate jdk/src/jdk.jdwp.agent/share/native/libjdwp/log_messages.h @ 26223:3830bfd8440a

8049226: com/sun/jdi/OptionTest.java test times out again Summary: Don't call jni_FatalError if transport initialization fails Reviewed-by: sspitsyn, sla
author dsamersoff
date Thu, 28 Aug 2014 05:20:02 -0700
parents 3317bb8137f4
children
rev   line source
duke@2 1 /*
alanb@14342 2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
duke@2 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@2 4 *
duke@2 5 * This code is free software; you can redistribute it and/or modify it
duke@2 6 * under the terms of the GNU General Public License version 2 only, as
ohair@5506 7 * published by the Free Software Foundation. Oracle designates this
duke@2 8 * particular file as subject to the "Classpath" exception as provided
ohair@5506 9 * by Oracle in the LICENSE file that accompanied this code.
duke@2 10 *
duke@2 11 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@2 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@2 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@2 14 * version 2 for more details (a copy is included in the LICENSE file that
duke@2 15 * accompanied this code).
duke@2 16 *
duke@2 17 * You should have received a copy of the GNU General Public License version
duke@2 18 * 2 along with this work; if not, write to the Free Software Foundation,
duke@2 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@2 20 *
ohair@5506 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@5506 22 * or visit www.oracle.com if you need additional information or have any
ohair@5506 23 * questions.
duke@2 24 */
duke@2 25
duke@2 26 #ifndef JDWP_LOG_MESSAGES_H
duke@2 27 #define JDWP_LOG_MESSAGES_H
duke@2 28
duke@2 29 /* LOG: Must be called like: LOG_category(("anything")) or LOG_category((format,args)) */
duke@2 30
duke@2 31 void setup_logging(const char *, unsigned);
dsamersoff@26223 32 void finish_logging();
duke@2 33
duke@2 34 #define LOG_NULL ((void)0)
duke@2 35
ohair@13678 36 /* Use THIS_FILE when it is available. */
ohair@13678 37 #ifndef THIS_FILE
ohair@13678 38 #define THIS_FILE __FILE__
ohair@13678 39 #endif
ohair@13678 40
duke@2 41 #ifdef JDWP_LOGGING
duke@2 42
duke@2 43 #define _LOG(flavor,args) \
ohair@13678 44 (log_message_begin(flavor,THIS_FILE,__LINE__), \
duke@2 45 log_message_end args)
duke@2 46
duke@2 47 #define LOG_TEST(flag) (gdata->log_flags & (flag))
duke@2 48
duke@2 49 #define LOG_JVM(args) \
duke@2 50 (LOG_TEST(JDWP_LOG_JVM) ?_LOG("JVM", args):LOG_NULL)
duke@2 51 #define LOG_JNI(args) \
duke@2 52 (LOG_TEST(JDWP_LOG_JNI) ?_LOG("JNI", args):LOG_NULL)
duke@2 53 #define LOG_JVMTI(args) \
duke@2 54 (LOG_TEST(JDWP_LOG_JVMTI)?_LOG("JVMTI",args):LOG_NULL)
duke@2 55 #define LOG_MISC(args) \
duke@2 56 (LOG_TEST(JDWP_LOG_MISC) ?_LOG("MISC", args):LOG_NULL)
duke@2 57 #define LOG_STEP(args) \
duke@2 58 (LOG_TEST(JDWP_LOG_STEP) ?_LOG("STEP", args):LOG_NULL)
duke@2 59 #define LOG_LOC(args) \
duke@2 60 (LOG_TEST(JDWP_LOG_LOC) ?_LOG("LOC", args):LOG_NULL)
duke@2 61 #define LOG_CB(args) \
duke@2 62 (LOG_TEST(JDWP_LOG_CB)?_LOG("CB",args):LOG_NULL)
duke@2 63 #define LOG_ERROR(args) \
duke@2 64 (LOG_TEST(JDWP_LOG_ERROR)?_LOG("ERROR",args):LOG_NULL)
duke@2 65
duke@2 66
duke@2 67 /* DO NOT USE THESE DIRECTLY */
duke@2 68 void log_message_begin(const char *, const char *, int);
duke@2 69 void log_message_end(const char *, ...);
duke@2 70
duke@2 71 #else
duke@2 72
duke@2 73 #define LOG_TEST(flag) 0
duke@2 74
duke@2 75 #define LOG_JVM(args) LOG_NULL
duke@2 76 #define LOG_JNI(args) LOG_NULL
duke@2 77 #define LOG_JVMTI(args) LOG_NULL
duke@2 78 #define LOG_MISC(args) LOG_NULL
duke@2 79 #define LOG_STEP(args) LOG_NULL
duke@2 80 #define LOG_LOC(args) LOG_NULL
duke@2 81 #define LOG_CB(args) LOG_NULL
duke@2 82 #define LOG_ERROR(args) LOG_NULL
duke@2 83
duke@2 84 #endif
duke@2 85
duke@2 86 #define JDWP_LOG_JVM 0x00000001
duke@2 87 #define JDWP_LOG_JNI 0x00000002
duke@2 88 #define JDWP_LOG_JVMTI 0x00000004
duke@2 89 #define JDWP_LOG_MISC 0x00000008
duke@2 90 #define JDWP_LOG_STEP 0x00000010
duke@2 91 #define JDWP_LOG_LOC 0x00000020
duke@2 92 #define JDWP_LOG_CB 0x00000040
duke@2 93 #define JDWP_LOG_ERROR 0x00000080
duke@2 94 #define JDWP_LOG_ALL 0xffffffff
duke@2 95
duke@2 96 #endif