Hi everyone,

We've spent a lot of time this work week trying to sort out crashes that only seem to happen when b2g is built with B2G_DEBUG=1.

Looking at nsDebug.h[1], if B2G_DEBUG (and hence DEBUG) are not defined, the following macros evaporate:

142  <http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#142>  
#defineNS_ABORT_IF_FALSE  
<http://mxr.mozilla.org/mozilla-central/ident?i=NS_ABORT_IF_FALSE>(_expr,_msg  
<http://mxr.mozilla.org/mozilla-central/ident?i=_msg>)do{/* nothing */  }while(0)
143  <http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#143>  
#defineNS_WARN_IF_FALSE  
<http://mxr.mozilla.org/mozilla-central/ident?i=NS_WARN_IF_FALSE>(_expr,_msg  
<http://mxr.mozilla.org/mozilla-central/ident?i=_msg>)do{/* nothing */  }while(0)
144  <http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#144>  
#defineNS_PRECONDITION  <http://mxr.mozilla.org/mozilla-central/ident?i=NS_PRECONDITION>(expr  
<http://mxr.mozilla.org/mozilla-central/ident?i=expr>,str  
<http://mxr.mozilla.org/mozilla-central/ident?i=str>)do{/* nothing */  }while(0)
145  <http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#145>  
#defineNS_ASSERTION  <http://mxr.mozilla.org/mozilla-central/ident?i=NS_ASSERTION>(expr  
<http://mxr.mozilla.org/mozilla-central/ident?i=expr>,str  
<http://mxr.mozilla.org/mozilla-central/ident?i=str>)do{/* nothing */  }while(0)
146  <http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#146>  
#defineNS_POSTCONDITION  <http://mxr.mozilla.org/mozilla-central/ident?i=NS_POSTCONDITION>(expr  
<http://mxr.mozilla.org/mozilla-central/ident?i=expr>,str  
<http://mxr.mozilla.org/mozilla-central/ident?i=str>)do{/* nothing */  }while(0)
147  <http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#147>  
#defineNS_NOTYETIMPLEMENTED  
<http://mxr.mozilla.org/mozilla-central/ident?i=NS_NOTYETIMPLEMENTED>(str  
<http://mxr.mozilla.org/mozilla-central/ident?i=str>)do{/* nothing */  }while(0)
148  <http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#148>  
#defineNS_NOTREACHED  <http://mxr.mozilla.org/mozilla-central/ident?i=NS_NOTREACHED>(str  
<http://mxr.mozilla.org/mozilla-central/ident?i=str>)do{/* nothing */  }while(0)
149  <http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#149>  
#defineNS_ERROR  <http://mxr.mozilla.org/mozilla-central/ident?i=NS_ERROR>(str  
<http://mxr.mozilla.org/mozilla-central/ident?i=str>)do{/* nothing */  }while(0)
150  <http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#150>  
#defineNS_WARNING  <http://mxr.mozilla.org/mozilla-central/ident?i=NS_WARNING>(str  
<http://mxr.mozilla.org/mozilla-central/ident?i=str>)do{/* nothing */  }while(0)
151  <http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#151>  
#defineNS_ABORT  <http://mxr.mozilla.org/mozilla-central/ident?i=NS_ABORT>()do{/* 
nothing */  }while(0)
152  <http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#152>  
#defineNS_BREAK  <http://mxr.mozilla.org/mozilla-central/ident?i=NS_BREAK>()do{/* 
nothing */  }while(0)

Similarly, in Assertions.h[2], things like MOZ_ASSERT() evaporate as well.

If you're using these macros, please make sure you have tested your changes with B2G_DEBUG=1 before landing them.

Thanks,
--Mike.

1. http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsDebug.h#142
2. http://mxr.mozilla.org/mozilla-central/source/mfbt/Assertions.h#278

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to