The MDC instructions for debugging mozilla in XCode are fine but as soon as you try to build Mozilla from XCode, you hit a few obstacles.

Add a new Target of type External Target. For the settings:

Screen shot 2010-06-17 at 11.50.53.png

Note the PATH - needs to point to the MacPorts directory.

Now it will build OK but debugging will fail with a message “”The active architecture i386 is not present in the executable ‘Executable’ which contains x86_64″, but you cannot set the architecture from the menu.

To get around this, edit the project settings and add a user-defined setting: ARCHS with value: x86_64.

Now if I can only figure out why incremental building is not working…

Update 1 - found it in the Build FAQmake -C browser/app … obvious really.

Update 2 - worked out an optimal mozconfig for fast incremental linking and hacking:

. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-debug
mk_add_options MOZ_MAKE_FLAGS="-j4"
ac_add_options --disable-optimize
ac_add_options --disable-tests
ac_add_options --disable-static --disable-libxul
ac_add_options --disable-ipc
export MOZ_DEBUG_SYMBOLS=1
export CFLAGS="-gdwarf-2"
export CXXFLAGS="-gdwarf-2"

disable-static and disable-libxul makes it possible for me to build a single module without having to build the browser or XUL. and enabling debugger flags directly without the full debug build options speeds the link time and does not include a number of tests.