Mercurial > hg > truffle
comparison src/share/vm/utilities/debug.hpp @ 8506:c3657d00e343
-Merge with tip
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Thu, 21 Mar 2013 14:11:13 +0100 |
parents | 86b4965f0c9a b8f261ba79c6 |
children | b9a918201d47 |
comparison
equal
deleted
inserted
replaced
8505:dee7c8b578c7 | 8506:c3657d00e343 |
---|---|
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; |