# HG changeset patch # User Lukas Stadler # Date 1389188867 -3600 # Node ID 8ea968b6dba93d17ea811a07a3b0f950b6b7db2e # Parent 43bd3d7254d18bd65c49967f77ea9e80bbfc6cf1 fix handling of sandboxed debug scopes (don't destroy parent flags) diff -r 43bd3d7254d1 -r 8ea968b6dba9 graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java --- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Wed Jan 08 12:51:13 2014 +0100 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Wed Jan 08 14:47:47 2014 +0100 @@ -169,7 +169,7 @@ */ public static Scope scope(String name, Object... context) { if (ENABLED) { - return DebugScope.getInstance().scope(name, false, null, context); + return DebugScope.getInstance().scope(name, null, context); } else { return null; } @@ -198,7 +198,7 @@ public static Scope sandbox(String name, DebugConfig config, Object... context) { if (ENABLED) { DebugConfig sandboxConfig = config == null ? silentConfig() : config; - return DebugScope.getInstance().scope(name, true, sandboxConfig, context); + return DebugScope.getInstance().scope(name, sandboxConfig, context); } else { return null; } diff -r 43bd3d7254d1 -r 8ea968b6dba9 graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java --- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java Wed Jan 08 12:51:13 2014 +0100 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugScope.java Wed Jan 08 14:47:47 2014 +0100 @@ -169,7 +169,7 @@ public void close() { instanceTL.set(parent); - setConfig(parentConfig); + configTL.set(parentConfig); lastClosedTL.set(this); } @@ -236,18 +236,17 @@ * disjoint top level scope. * * @param name the name of the new scope - * @param sandbox specifies if the scope is a child of the current scope or a top level scope - * @param sandboxConfig the configuration to use for a new top level scope (ignored if - * {@code sandbox == false}) + * @param sandboxConfig the configuration to use for a new top level scope, or null if the new + * scope should be a child scope * @param context objects to be appended to the debug context * @return the new scope which will be exited when its {@link #close()} method is called */ @SuppressWarnings("hiding") - public DebugScope scope(String name, boolean sandbox, DebugConfig sandboxConfig, Object... context) { + public DebugScope scope(String name, DebugConfig sandboxConfig, Object... context) { DebugScope newScope = null; - if (sandbox) { + if (sandboxConfig != null) { newScope = new DebugScope(name, name, this, true, context); - setConfig(sandboxConfig); + configTL.set(sandboxConfig); } else { newScope = this.createChild(name, context); } @@ -308,7 +307,7 @@ private RuntimeException interceptException(final Throwable e) { final DebugConfig config = getConfig(); if (config != null) { - try (DebugScope s = scope("InterceptException", false, null, e)) { + try (DebugScope s = scope("InterceptException", null, e)) { return config.interceptException(e); } catch (Throwable t) { return new RuntimeException("Exception while intercepting exception", t);