comparison src/share/vm/utilities/debug.hpp @ 8151:b8f261ba79c6

Minimize diff to plain HotSpot version.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 07 Mar 2013 21:00:29 +0100
parents 679e6584c177
children c3657d00e343
comparison
equal deleted inserted replaced
8150:b66f831ac5ab 8151:b8f261ba79c6
27 27
28 #include "prims/jvm.h" 28 #include "prims/jvm.h"
29 #include "utilities/globalDefinitions.hpp" 29 #include "utilities/globalDefinitions.hpp"
30 30
31 #include <stdarg.h> 31 #include <stdarg.h>
32
33 #ifdef GRAAL
34 // Scopes a value that may be of interest in a crash log.
35 class DebugScopedValue {
36 protected:
37 DebugScopedValue *_parent;
38 const char* _file;
39 int _line;
40 public:
41 DebugScopedValue(const char* file, int line);
42 ~DebugScopedValue();
43 void print(outputStream* st);
44 virtual void print_on(outputStream* st) = 0;
45 DebugScopedValue* parent() { return _parent; }
46 };
47
48 class DebugScopedScalar : DebugScopedValue {
49 private:
50 void* _value;
51 public:
52 DebugScopedScalar(const char* file, int line, void* v) : DebugScopedValue(file, line), _value(v) {}
53 void print_on(outputStream* st);
54 };
55 #define DS_SCALAR(val) DebugScopedScalar __dss__(__FILE__, __LINE__, (void*) val)
56 #define DS_SCALAR1(name, val) DebugScopedScalar name(__FILE__, __LINE__, (void*) val)
57 #else
58 #define DS_SCALAR(name) do {} while (0)
59 #define DS_SCALAR1(name, val) do {} while (0)
60 #endif
61 32
62 // 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.
63 class FormatBufferBase { 34 class FormatBufferBase {
64 protected: 35 protected:
65 char* _buf; 36 char* _buf;