Following the tutorial on MDN  and with the help of the #developer channel on IRC I was able to build firefox in debug mode.
These are the steps I followed to get the build working:

Install dependencies:

apt-get build-dep firefox
apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm

Create .mozconfig file in the root of your project

. $topsrcdir/browser/config/mozconfig
mkaddoptions MOZOBJDIR=@TOPSRCDIR@/ff-dbg
ac
addoptions –disable-optimize
ac
addoptions –enable-debug
ac
add_options –enable-tests

Then

make -f client.mk build

It took me around 1h 10min to finish the build

To run firefox:

cd ff-dbg/dist/bin
./firefox

For some reason, when I start the browser, after a few seconds it goes to sleep and crashes

Also if I try to run the firefox-bin I get this error: