Closed Bug 626062 Opened 13 years ago Closed 13 years ago

Building with DEBUG_CC defined causes build error in nsCycleCollector.cpp

Categories

(Core :: XPCOM, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: humph, Unassigned)

References

()

Details

Reading:

https://wiki.mozilla.org/Performance:Leak_Tools#Cycle_Collector_Debugging_.28DEBUG_CC.29

it says:

"The cycle collector debugging code can be enabled by uncommenting the #define DEBUG_CC lines in both xpcom/base/nsCycleCollector.h and xpcom/glue/nsCycleCollectionParticipant.h."

I make the following changes:

diff --git a/xpcom/base/nsCycleCollector.h b/xpcom/base/nsCycleCollector.h
--- a/xpcom/base/nsCycleCollector.h
+++ b/xpcom/base/nsCycleCollector.h
@@ -40,7 +40,7 @@
 
 // NOTE: If you use header files to define DEBUG_CC, you must do so here
 // *and* in nsCycleCollectionParticipant.h
-//#define DEBUG_CC
+#define DEBUG_CC
 
 class nsISupports;
 class nsICycleCollectorListener;
diff --git a/xpcom/glue/nsCycleCollectionParticipant.h b/xpcom/glue/nsCycleCollectionParticipant.h
--- a/xpcom/glue/nsCycleCollectionParticipant.h
+++ b/xpcom/glue/nsCycleCollectionParticipant.h
@@ -42,7 +42,7 @@
 
 // NOTE: If you use header files to define DEBUG_CC, you must do so here
 // *and* in nsCycleCollector.h
-//#define DEBUG_CC
+#define DEBUG_CC
 
 #define NS_CYCLECOLLECTIONPARTICIPANT_IID                                      \
 {                                                   

This is what I get when I try to build:

g++-4.2 -o nsCycleCollector.o -c  -fvisibility=hidden -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DSTATIC_EXPORTABLE_JS_API -DOSTYPE=\"Darwin10.6.0\" -DOSARCH=Darwin -D_IMPL_NS_COM -I/Users/dave/moz/mozilla-central-clean/xpcom/base/../build -I/Users/dave/moz/mozilla-central-clean/xpcom/base -I. -I../../dist/include -I../../dist/include/nsprpub  -I/Users/dave/moz/mozilla-central-clean/objdir-release/dist/include/nspr -I/Users/dave/moz/mozilla-central-clean/objdir-release/dist/include/nss       -fPIC  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -fno-strict-aliasing -fpascal-strings -fno-common -fshort-wchar -pthread -DNO_X11 -pipe  -DNDEBUG -DTRIMMED -g -O3 -fno-omit-frame-pointer   -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MF .deps/nsCycleCollector.pp /Users/dave/moz/mozilla-central-clean/xpcom/base/nsCycleCollector.cpp
/Users/dave/moz/mozilla-central-clean/xpcom/base/nsCycleCollector.cpp: In function ‘PRUint32 nsCycleCollector_collect(nsICycleCollectorListener*)’:
/Users/dave/moz/mozilla-central-clean/xpcom/base/nsCycleCollector.cpp:3464: error: request for member ‘mParams’ in ‘sCollector’, which is of non-class type ‘nsCycleCollector*’
/Users/dave/moz/mozilla-central-clean/xpcom/base/nsCycleCollector.cpp: At global scope:
/Users/dave/moz/mozilla-central-clean/xpcom/base/nsCycleCollector.cpp:1951: warning: ‘hookedMalloc’ defined but not used
I'm 99% certain DEBUG_CC only builds in a debug build...
This was just a build bustage from bug 621258, I checked in a fix.

http://hg.mozilla.org/mozilla-central/rev/50245d5d1bec

I think DEBUG_CC builds in optimized builds too.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.