comparison src/share/vm/utilities/debug.hpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 4ca6dc0799b6 78bbf4d43a14
children 7848fc12602b
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
23 */ 23 */
24 24
25 #ifndef SHARE_VM_UTILITIES_DEBUG_HPP 25 #ifndef SHARE_VM_UTILITIES_DEBUG_HPP
26 #define SHARE_VM_UTILITIES_DEBUG_HPP 26 #define SHARE_VM_UTILITIES_DEBUG_HPP
27 27
28 #include "utilities/globalDefinitions.hpp"
28 #include "prims/jvm.h" 29 #include "prims/jvm.h"
29 #include "utilities/globalDefinitions.hpp"
30 30
31 #include <stdarg.h> 31 #include <stdarg.h>
32 32
33 // Simple class to format the ctor arguments into a fixed-sized buffer. 33 // Simple class to format the ctor arguments into a fixed-sized buffer.
34 class FormatBufferBase { 34 class FormatBufferBase {
41 41
42 // Use resource area for buffer 42 // Use resource area for buffer
43 #define RES_BUFSZ 256 43 #define RES_BUFSZ 256
44 class FormatBufferResource : public FormatBufferBase { 44 class FormatBufferResource : public FormatBufferBase {
45 public: 45 public:
46 FormatBufferResource(const char * format, ...); 46 FormatBufferResource(const char * format, ...) ATTRIBUTE_PRINTF(2, 3);
47 }; 47 };
48 48
49 // Use stack for buffer 49 // Use stack for buffer
50 template <size_t bufsz = 256> 50 template <size_t bufsz = 256>
51 class FormatBuffer : public FormatBufferBase { 51 class FormatBuffer : public FormatBufferBase {
52 public: 52 public:
53 inline FormatBuffer(const char * format, ...); 53 inline FormatBuffer(const char * format, ...) ATTRIBUTE_PRINTF(2, 3);
54 inline void append(const char* format, ...); 54 inline void append(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
55 inline void print(const char* format, ...); 55 inline void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
56 inline void printv(const char* format, va_list ap); 56 inline void printv(const char* format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
57 57
58 char* buffer() { return _buf; } 58 char* buffer() { return _buf; }
59 int size() { return bufsz; } 59 int size() { return bufsz; }
60 60
61 private: 61 private:
221 void report_should_not_call(const char* file, int line); 221 void report_should_not_call(const char* file, int line);
222 void report_should_not_reach_here(const char* file, int line); 222 void report_should_not_reach_here(const char* file, int line);
223 void report_unimplemented(const char* file, int line); 223 void report_unimplemented(const char* file, int line);
224 void report_untested(const char* file, int line, const char* message); 224 void report_untested(const char* file, int line, const char* message);
225 225
226 void warning(const char* format, ...); 226 void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2);
227 227
228 #ifdef ASSERT 228 #ifdef ASSERT
229 // Compile-time asserts. 229 // Compile-time asserts.
230 template <bool> struct StaticAssert; 230 template <bool> struct StaticAssert;
231 template <> struct StaticAssert<true> {}; 231 template <> struct StaticAssert<true> {};