hotspot/src/share/vm/utilities/debug.hpp
author trims
Tue, 05 Apr 2011 14:12:31 -0700
changeset 8921 14bfe81f2a9d
parent 8680 f1c414e16a4c
child 11636 3c07b54482a5
permissions -rw-r--r--
7010070: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - second pass Summary: Update the copyright to be 2010 on all changed files in OpenJDK Reviewed-by: ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
8921
14bfe81f2a9d 7010070: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - second pass
trims
parents: 8680
diff changeset
     2
 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5403
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5403
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5403
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_UTILITIES_DEBUG_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_UTILITIES_DEBUG_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
8680
f1c414e16a4c 7014923: G1: code cleanup
tonyp
parents: 8076
diff changeset
    28
#include "prims/jvm.h"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "utilities/globalDefinitions.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    31
#include <stdarg.h>
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    32
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    33
// Simple class to format the ctor arguments into a fixed-sized buffer.
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    34
template <size_t bufsz = 256>
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    35
class FormatBuffer {
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    36
public:
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    37
  inline FormatBuffer(const char * format, ...);
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    38
  inline void append(const char* format, ...);
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    39
  operator const char *() const { return _buf; }
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    40
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    41
private:
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    42
  FormatBuffer(const FormatBuffer &); // prevent copies
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    43
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    44
private:
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    45
  char _buf[bufsz];
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    46
};
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    47
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    48
template <size_t bufsz>
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    49
FormatBuffer<bufsz>::FormatBuffer(const char * format, ...) {
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    50
  va_list argp;
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    51
  va_start(argp, format);
8680
f1c414e16a4c 7014923: G1: code cleanup
tonyp
parents: 8076
diff changeset
    52
  jio_vsnprintf(_buf, bufsz, format, argp);
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    53
  va_end(argp);
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    54
}
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    55
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    56
template <size_t bufsz>
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    57
void FormatBuffer<bufsz>::append(const char* format, ...) {
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    58
  // Given that the constructor does a vsnprintf we can assume that
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    59
  // _buf is already initialized.
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    60
  size_t len = strlen(_buf);
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    61
  char* buf_end = _buf + len;
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    62
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    63
  va_list argp;
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    64
  va_start(argp, format);
8680
f1c414e16a4c 7014923: G1: code cleanup
tonyp
parents: 8076
diff changeset
    65
  jio_vsnprintf(buf_end, bufsz - len, format, argp);
7923
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    66
  va_end(argp);
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    67
}
fc200fcd4e05 6977804: G1: remove the zero-filling thread
tonyp
parents: 7397
diff changeset
    68
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    69
// Used to format messages for assert(), guarantee(), fatal(), etc.
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    70
typedef FormatBuffer<> err_msg;
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    71
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
// assertions
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
#ifdef ASSERT
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    74
#ifndef USE_REPEATED_ASSERTS
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    75
#define assert(p, msg)                                                       \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    76
do {                                                                         \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    77
  if (!(p)) {                                                                \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    78
    report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg);       \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    79
    BREAKPOINT;                                                              \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    80
  }                                                                          \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    81
} while (0)
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    82
#else // #ifndef USE_REPEATED_ASSERTS
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    83
#define assert(p, msg)
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    84
do {                                                                         \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    85
  for (int __i = 0; __i < AssertRepeat; __i++) {                             \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    86
    if (!(p)) {                                                              \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    87
      report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg);     \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    88
      BREAKPOINT;                                                            \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    89
    }                                                                        \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    90
  }                                                                          \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    91
} while (0)
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
    92
#endif // #ifndef USE_REPEATED_ASSERTS
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
// This version of assert is for use with checking return status from
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
// library calls that return actual error values eg. EINVAL,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
// ENOMEM etc, rather than returning -1 and setting errno.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
// When the status is not what is expected it is very useful to know
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
// what status was actually returned, so we pass the status variable as
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
// an extra arg and use strerror to convert it to a meaningful string
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
// like "Invalid argument", "out of memory" etc
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   101
#define assert_status(p, status, msg)                                        \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   102
do {                                                                         \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   103
  if (!(p)) {                                                                \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   104
    report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed",             \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   105
                    err_msg("error %s(%d) %s", strerror(status),             \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   106
                            status, msg));                                   \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   107
    BREAKPOINT;                                                              \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   108
  }                                                                          \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   109
} while (0)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
// Do not assert this condition if there's already another error reported.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
#define assert_if_no_error(cond,msg) assert((cond) || is_error_reported(), msg)
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   113
#else // #ifdef ASSERT
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  #define assert(p,msg)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  #define assert_status(p,status,msg)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  #define assert_if_no_error(cond,msg)
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   117
#endif // #ifdef ASSERT
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
// guarantee is like assert except it's always executed -- use it for
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   120
// cheap tests that catch errors that would otherwise be hard to find.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
// guarantee is also used for Verify options.
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   122
#define guarantee(p, msg)                                                    \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   123
do {                                                                         \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   124
  if (!(p)) {                                                                \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   125
    report_vm_error(__FILE__, __LINE__, "guarantee(" #p ") failed", msg);    \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   126
    BREAKPOINT;                                                              \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   127
  }                                                                          \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   128
} while (0)
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   129
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   130
#define fatal(msg)                                                           \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   131
do {                                                                         \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   132
  report_fatal(__FILE__, __LINE__, msg);                                     \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   133
  BREAKPOINT;                                                                \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   134
} while (0)
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   135
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   136
// out of memory
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   137
#define vm_exit_out_of_memory(size, msg)                                     \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   138
do {                                                                         \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   139
  report_vm_out_of_memory(__FILE__, __LINE__, size, msg);                    \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   140
  BREAKPOINT;                                                                \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   141
} while (0)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   143
#define ShouldNotCallThis()                                                  \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   144
do {                                                                         \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   145
  report_should_not_call(__FILE__, __LINE__);                                \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   146
  BREAKPOINT;                                                                \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   147
} while (0)
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   148
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   149
#define ShouldNotReachHere()                                                 \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   150
do {                                                                         \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   151
  report_should_not_reach_here(__FILE__, __LINE__);                          \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   152
  BREAKPOINT;                                                                \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   153
} while (0)
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   154
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   155
#define Unimplemented()                                                      \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   156
do {                                                                         \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   157
  report_unimplemented(__FILE__, __LINE__);                                  \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   158
  BREAKPOINT;                                                                \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   159
} while (0)
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   160
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   161
#define Untested(msg)                                                        \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   162
do {                                                                         \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   163
  report_untested(__FILE__, __LINE__, msg);                                  \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   164
  BREAKPOINT;                                                                \
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   165
} while (0);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
// error reporting helper functions
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   168
void report_vm_error(const char* file, int line, const char* error_msg,
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   169
                     const char* detail_msg = NULL);
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   170
void report_fatal(const char* file, int line, const char* message);
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   171
void report_vm_out_of_memory(const char* file, int line, size_t size,
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   172
                             const char* message);
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   173
void report_should_not_call(const char* file, int line);
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   174
void report_should_not_reach_here(const char* file, int line);
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   175
void report_unimplemented(const char* file, int line);
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   176
void report_untested(const char* file, int line, const char* message);
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   177
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
void warning(const char* format, ...);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
8076
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7923
diff changeset
   180
// out of shared space reporting
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7923
diff changeset
   181
enum SharedSpaceType {
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7923
diff changeset
   182
  SharedPermGen,
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7923
diff changeset
   183
  SharedReadOnly,
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7923
diff changeset
   184
  SharedReadWrite,
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7923
diff changeset
   185
  SharedMiscData
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7923
diff changeset
   186
};
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7923
diff changeset
   187
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7923
diff changeset
   188
void report_out_of_shared_space(SharedSpaceType space_type);
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7923
diff changeset
   189
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
// out of memory reporting
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
void report_java_out_of_memory(const char* message);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
// Support for self-destruct
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
bool is_error_reported();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
void set_error_reported();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
5403
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   197
/* Test assert(), fatal(), guarantee(), etc. */
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   198
NOT_PRODUCT(void test_error_handler(size_t test_num);)
6b0dd9c75dde 6888954: argument formatting for assert() and friends
jcoomes
parents: 1
diff changeset
   199
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
void pd_ps(frame f);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
void pd_obfuscate_location(char *buf, size_t buflen);
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   202
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   203
#endif // SHARE_VM_UTILITIES_DEBUG_HPP