From 59911bd35482f2f3d6545e9f5544b9efdb67887f Mon Sep 17 00:00:00 2001 From: toshihiro Date: Thu, 16 Aug 2007 08:52:09 +0000 Subject: [PATCH] Modified: 1764120 - Variables View doesn't show global vars in class context --- .../phpdt/internal/debug/core/PHPDBGInterface.java | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java index cf17c49..e4e754c 100644 --- a/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java +++ b/net.sourceforge.phpeclipse.debug.core/src/net/sourceforge/phpdt/internal/debug/core/PHPDBGInterface.java @@ -427,7 +427,12 @@ public class PHPDBGInterface { } // get global variables (and assign them to 'main()' stackframe) - Vector globalList = getVariables(DBGStackList[DBGStackList.length - 1], PHPDBGBase.GLOBAL_SCOPE_ID); + int global_scope_id = (DBGStackList.length > 1) ? 2 : PHPDBGBase.GLOBAL_SCOPE_ID; + // DBG 2.13.1 doesn't return Super Globals with GLOBAL_SCOPE_ID in nested stackframes, + // so using 2(most out-standing stack context) instead of GLOBAL_SCOPE_ID. + // Also note that 2.13.1 doesn't return $this in class context. + // (You can inspect $this in Expressions View. And once it is shown, 2.13.1 comes to return $this.) + Vector globalList = getVariables(DBGStackList[DBGStackList.length - 1], global_scope_id); if (!globalList.isEmpty()) { // remove unresolved '$this=?' variable removeUnresolvedThisVar(globalList); -- 1.7.1