annotate graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugConfig.java @ 16144:af9f3a5f091b

extended Debug API with DebugVerifyHandlers
author Doug Simon <doug.simon@oracle.com>
date Thu, 19 Jun 2014 11:24:16 +0200
parents 0dc0926cf0d8
children f1d839174e71
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
23 package com.oracle.graal.debug;
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
5302
55bf72fafc41 (preliminary) logging to file (-G:LogFile=asdf.txt)
Lukas Stadler <lukas.stadler@jku.at>
parents: 5165
diff changeset
25 import java.io.*;
4363
7462c3600c3a Draft changes to the graph plotting.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4361
diff changeset
26 import java.util.*;
7462c3600c3a Draft changes to the graph plotting.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4361
diff changeset
27
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6584
diff changeset
28 public interface DebugConfig {
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29
5165
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
30 /**
14625
3ab42370f636 removed use of varargs from Debug.log() API
Doug Simon <doug.simon@oracle.com>
parents: 14586
diff changeset
31 * Determines if logging is on in the {@linkplain Debug#currentScope() current debug scope} .
5165
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
32 */
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33 boolean isLogEnabled();
5165
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
34
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
35 /**
13323
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
36 * Determines if logging can be enabled in the current method, regardless of the
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
37 * {@linkplain Debug#currentScope() current debug scope}.
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
38 */
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
39 boolean isLogEnabledForMethod();
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
40
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
41 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6584
diff changeset
42 * Determines if metering is enabled in the {@linkplain Debug#currentScope() current debug
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6584
diff changeset
43 * scope}.
14873
00eb80d735ed removed Debug.printf and added multi-arg versions of Debug.dump
Doug Simon <doug.simon@oracle.com>
parents: 14625
diff changeset
44 *
14586
d2fe05d5cc96 added support for lazy computation of names for use with Debug
Doug Simon <doug.simon@oracle.com>
parents: 13323
diff changeset
45 * @see Debug#metric(CharSequence)
5165
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
46 */
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 boolean isMeterEnabled();
5165
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
48
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
49 /**
15581
0dc0926cf0d8 added -G:TrackMemUse for measuring memory usage within scopes
Doug Simon <doug.simon@oracle.com>
parents: 14873
diff changeset
50 * Determines if memory use tracking is enabled in the {@linkplain Debug#currentScope() current
0dc0926cf0d8 added -G:TrackMemUse for measuring memory usage within scopes
Doug Simon <doug.simon@oracle.com>
parents: 14873
diff changeset
51 * debug scope}.
0dc0926cf0d8 added -G:TrackMemUse for measuring memory usage within scopes
Doug Simon <doug.simon@oracle.com>
parents: 14873
diff changeset
52 *
0dc0926cf0d8 added -G:TrackMemUse for measuring memory usage within scopes
Doug Simon <doug.simon@oracle.com>
parents: 14873
diff changeset
53 * @see Debug#memUseTracker(CharSequence)
0dc0926cf0d8 added -G:TrackMemUse for measuring memory usage within scopes
Doug Simon <doug.simon@oracle.com>
parents: 14873
diff changeset
54 */
0dc0926cf0d8 added -G:TrackMemUse for measuring memory usage within scopes
Doug Simon <doug.simon@oracle.com>
parents: 14873
diff changeset
55 boolean isMemUseTrackingEnabled();
0dc0926cf0d8 added -G:TrackMemUse for measuring memory usage within scopes
Doug Simon <doug.simon@oracle.com>
parents: 14873
diff changeset
56
0dc0926cf0d8 added -G:TrackMemUse for measuring memory usage within scopes
Doug Simon <doug.simon@oracle.com>
parents: 14873
diff changeset
57 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6584
diff changeset
58 * Determines if dumping is enabled in the {@linkplain Debug#currentScope() current debug scope}
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6584
diff changeset
59 * .
14873
00eb80d735ed removed Debug.printf and added multi-arg versions of Debug.dump
Doug Simon <doug.simon@oracle.com>
parents: 14625
diff changeset
60 *
00eb80d735ed removed Debug.printf and added multi-arg versions of Debug.dump
Doug Simon <doug.simon@oracle.com>
parents: 14625
diff changeset
61 * @see Debug#dump(Object, String)
5165
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
62 */
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
63 boolean isDumpEnabled();
5165
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
64
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
65 /**
13323
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
66 * Determines if dumping can be enabled in the current method, regardless of the
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
67 * {@linkplain Debug#currentScope() current debug scope}.
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
68 */
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
69 boolean isDumpEnabledForMethod();
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
70
48e821e409eb Add Debug.isDumpEnabledForMethod() and Debug.isLogEnabledForMethod() use it to diable graph compression and enable guard-id-as-debug-id
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7530
diff changeset
71 /**
16144
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
72 * @see Debug#isVerifyEnabled()
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
73 */
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
74 boolean isVerifyEnabled();
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
75
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
76 /**
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
77 * @see Debug#isVerifyEnabledForMethod()
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
78 */
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
79 boolean isVerifyEnabledForMethod();
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
80
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
81 /**
5620
2a44192a8b24 added support for extending the filtering context of a DebugConfig
Doug Simon <doug.simon@oracle.com>
parents: 5302
diff changeset
82 * Adds an object the context used by this configuration to do filtering.
2a44192a8b24 added support for extending the filtering context of a DebugConfig
Doug Simon <doug.simon@oracle.com>
parents: 5302
diff changeset
83 */
2a44192a8b24 added support for extending the filtering context of a DebugConfig
Doug Simon <doug.simon@oracle.com>
parents: 5302
diff changeset
84 void addToContext(Object o);
2a44192a8b24 added support for extending the filtering context of a DebugConfig
Doug Simon <doug.simon@oracle.com>
parents: 5302
diff changeset
85
2a44192a8b24 added support for extending the filtering context of a DebugConfig
Doug Simon <doug.simon@oracle.com>
parents: 5302
diff changeset
86 /**
2a44192a8b24 added support for extending the filtering context of a DebugConfig
Doug Simon <doug.simon@oracle.com>
parents: 5302
diff changeset
87 * Removes an object the context used by this configuration to do filtering.
14873
00eb80d735ed removed Debug.printf and added multi-arg versions of Debug.dump
Doug Simon <doug.simon@oracle.com>
parents: 14625
diff changeset
88 *
5620
2a44192a8b24 added support for extending the filtering context of a DebugConfig
Doug Simon <doug.simon@oracle.com>
parents: 5302
diff changeset
89 * This should only removes extra context added by {@link #addToContext(Object)}.
2a44192a8b24 added support for extending the filtering context of a DebugConfig
Doug Simon <doug.simon@oracle.com>
parents: 5302
diff changeset
90 */
2a44192a8b24 added support for extending the filtering context of a DebugConfig
Doug Simon <doug.simon@oracle.com>
parents: 5302
diff changeset
91 void removeFromContext(Object o);
2a44192a8b24 added support for extending the filtering context of a DebugConfig
Doug Simon <doug.simon@oracle.com>
parents: 5302
diff changeset
92
2a44192a8b24 added support for extending the filtering context of a DebugConfig
Doug Simon <doug.simon@oracle.com>
parents: 5302
diff changeset
93 /**
14586
d2fe05d5cc96 added support for lazy computation of names for use with Debug
Doug Simon <doug.simon@oracle.com>
parents: 13323
diff changeset
94 * @see Debug#timer(CharSequence)
5165
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
95 */
4394
cf609017d3d4 Fixed warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4363
diff changeset
96 boolean isTimeEnabled();
5165
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
97
6584
a3eb814ea564 added more javadoc to DebugConfig interface
Doug Simon <doug.simon@oracle.com>
parents: 5620
diff changeset
98 /**
a3eb814ea564 added more javadoc to DebugConfig interface
Doug Simon <doug.simon@oracle.com>
parents: 5620
diff changeset
99 * Handles notification of an exception occurring within a debug scope.
14873
00eb80d735ed removed Debug.printf and added multi-arg versions of Debug.dump
Doug Simon <doug.simon@oracle.com>
parents: 14625
diff changeset
100 *
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6584
diff changeset
101 * @return the exception object that is to be propagated to parent scope. A value of
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6584
diff changeset
102 * {@code null} indicates that {@code e} is to be propagated.
6584
a3eb814ea564 added more javadoc to DebugConfig interface
Doug Simon <doug.simon@oracle.com>
parents: 5620
diff changeset
103 */
4477
27c5466afd55 Changes to debug framework.
Andreas Woess <andreas.woess@jku.at>
parents: 4394
diff changeset
104 RuntimeException interceptException(Throwable e);
5165
1c7dd9bb16f9 documentation to show the relationship between DebugConfig and Debug
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
105
6584
a3eb814ea564 added more javadoc to DebugConfig interface
Doug Simon <doug.simon@oracle.com>
parents: 5620
diff changeset
106 /**
16144
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
107 * Gets the modifiable collection of dump handlers registered with this configuration.
6584
a3eb814ea564 added more javadoc to DebugConfig interface
Doug Simon <doug.simon@oracle.com>
parents: 5620
diff changeset
108 */
a3eb814ea564 added more javadoc to DebugConfig interface
Doug Simon <doug.simon@oracle.com>
parents: 5620
diff changeset
109 Collection<DebugDumpHandler> dumpHandlers();
5302
55bf72fafc41 (preliminary) logging to file (-G:LogFile=asdf.txt)
Lukas Stadler <lukas.stadler@jku.at>
parents: 5165
diff changeset
110
55bf72fafc41 (preliminary) logging to file (-G:LogFile=asdf.txt)
Lukas Stadler <lukas.stadler@jku.at>
parents: 5165
diff changeset
111 PrintStream output();
16144
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
112
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
113 /**
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
114 * Gets the modifiable collection of verify handlers registered with this configuration.
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
115 */
af9f3a5f091b extended Debug API with DebugVerifyHandlers
Doug Simon <doug.simon@oracle.com>
parents: 15581
diff changeset
116 Collection<DebugVerifyHandler> verifyHandlers();
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
117 }