jdk/src/share/back/log_messages.h
author ohair
Tue, 11 Sep 2012 13:40:59 -0700
changeset 13678 5c8001201f98
parent 5506 202f599c92aa
child 14342 8435a30053c1
permissions -rw-r--r--
7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__ 7180608: Sort the order of object files when building shared libraries Reviewed-by: ohrstrom, erikj, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#ifndef JDWP_LOG_MESSAGES_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#define JDWP_LOG_MESSAGES_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
/* LOG: Must be called like:  LOG_category(("anything")) or LOG_category((format,args)) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
void setup_logging(const char *, unsigned);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
void finish_logging(int);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#define LOG_NULL ((void)0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
13678
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 5506
diff changeset
    36
/* Use THIS_FILE when it is available. */
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 5506
diff changeset
    37
#ifndef THIS_FILE
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 5506
diff changeset
    38
    #define THIS_FILE __FILE__
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 5506
diff changeset
    39
#endif
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 5506
diff changeset
    40
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
#ifdef JDWP_LOGGING
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    #define _LOG(flavor,args) \
13678
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 5506
diff changeset
    44
                (log_message_begin(flavor,THIS_FILE,__LINE__), \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
                 log_message_end args)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    #define LOG_TEST(flag)  (gdata->log_flags & (flag))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    #define LOG_JVM(args)   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
        (LOG_TEST(JDWP_LOG_JVM)  ?_LOG("JVM",  args):LOG_NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    #define LOG_JNI(args)   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        (LOG_TEST(JDWP_LOG_JNI)  ?_LOG("JNI",  args):LOG_NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    #define LOG_JVMTI(args) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        (LOG_TEST(JDWP_LOG_JVMTI)?_LOG("JVMTI",args):LOG_NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    #define LOG_MISC(args)  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        (LOG_TEST(JDWP_LOG_MISC) ?_LOG("MISC", args):LOG_NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    #define LOG_STEP(args)  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        (LOG_TEST(JDWP_LOG_STEP) ?_LOG("STEP", args):LOG_NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    #define LOG_LOC(args)   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        (LOG_TEST(JDWP_LOG_LOC)  ?_LOG("LOC",  args):LOG_NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    #define LOG_CB(args) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        (LOG_TEST(JDWP_LOG_CB)?_LOG("CB",args):LOG_NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    #define LOG_ERROR(args) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
        (LOG_TEST(JDWP_LOG_ERROR)?_LOG("ERROR",args):LOG_NULL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    /* DO NOT USE THESE DIRECTLY */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    void log_message_begin(const char *, const char *, int);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    void log_message_end(const char *, ...);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    #define LOG_TEST(flag)      0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    #define LOG_JVM(args)       LOG_NULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    #define LOG_JNI(args)       LOG_NULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    #define LOG_JVMTI(args)     LOG_NULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    #define LOG_MISC(args)      LOG_NULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    #define LOG_STEP(args)      LOG_NULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    #define LOG_LOC(args)       LOG_NULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    #define LOG_CB(args)        LOG_NULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    #define LOG_ERROR(args)     LOG_NULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
#define    JDWP_LOG_JVM         0x00000001
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
#define    JDWP_LOG_JNI         0x00000002
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
#define    JDWP_LOG_JVMTI       0x00000004
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
#define    JDWP_LOG_MISC        0x00000008
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
#define    JDWP_LOG_STEP        0x00000010
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
#define    JDWP_LOG_LOC         0x00000020
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
#define    JDWP_LOG_CB          0x00000040
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
#define    JDWP_LOG_ERROR       0x00000080
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
#define    JDWP_LOG_ALL         0xffffffff
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
#endif