diff --git a/mozilla/xpcom/doc/xpcom-code-faq.html b/mozilla/xpcom/doc/xpcom-code-faq.html index ee2b74fbd3a..2994b9b2f3e 100644 --- a/mozilla/xpcom/doc/xpcom-code-faq.html +++ b/mozilla/xpcom/doc/xpcom-code-faq.html @@ -2,7 +2,7 @@
- +XPCOM provides log output. To enable the logging: -setenv NSPR_LOG_MODULES nsComponentManager:5 --Start your application after setting the above environment variables. Debug -log from xpcom would be in the file xpcom.log -
setenv NSPR_LOG_FILE xpcom.logSince components are dynamically loaded only on demand, debugging them -could be a hard. Here are some tips to debugging components. +
+Since components are dynamically loaded only on demand, debugging +them could be a hard. Here are some tips to debugging components.Windows: VC5.0 VC6.0 -
Include your component library in the Project->Settings, Additional -Dll. drop down. After that breakpoints can be enabled.
+Include your component library in the Project->Settings, Additional +Dll. drop down. After that breakpoints can be enabled.Unix: gdb -Let the program run until you are sure that your component -is loaded. Type Control-C. Now all symbols from your component will be -available in gdb. Put your breakpoints and restart the app. Gdb will complain -that it cannot set the breakpoint, and that it is temporarily disabling -it, but when the *.so is loaded, the breakpoint is enabled automatically. -- <Eric Van Der Poel> -I think typing "dir components" (assuming you're in dist/bin) will also +
++Flett>+
+ +- +Let the program run until you are sure that your component is loaded. Type +Control-C. Now all symbols from your component will be available in gdb. +Put your breakpoints and restart the app. Gdb will complain that it cannot +set the breakpoint, and that it is temporarily disabling it, but when the +*.so is loaded, the breakpoint is enabled automatically. - <Eric +Van Der Poel>
++
- +I think typing "dir components" (assuming you're in dist/bin) will also allow you to see the symbols in your stack the first time. - <Alec -Flett>
gdb> set env XPCOM_BREAK_ON_LOAD "necko:rdf"
+
gdb> r
+
This will cause xpcom to break in the debugger after loading any dll +with substrings necko or rdf in them. At this point, +you could instruct the debugger to load the dll symbols and set breakpoint. +
gdb> sha libnecko.so
+
gdb> b nsFunctionInNecko
Just open the appropriate .xSYM file in the debugger; the debugger will target the library when the application is run. - <Simon Fraser>+ +Generating a log from xpcom: +
XPCOM provides log output. To enable the logging: ++ +[unix] ++Start your application after setting the above environment variables. Debug +log from xpcom would be in the file xpcom.log
setenv NSPR_LOG_MODULES nsComponentManager:5 +
setenv NSPR_LOG_FILE xpcom.log +[win] +
set NSPR_LOG_MODULES=nsComponentManager:5 +
set NSPR_LOG_FILE=xpcom.log
xpcom/doc/xpcom-log-analyze.sh +is a script that does analysis of the xpcom log and prints out useful statistics +in html format. Usage is: +xpcom-log-analyze.sh < xpcom.log > xpcom-log.html ++