You can debug the IDE, by opening the project ide/lazarus.lpi and then run with F9
You may want to specify an alternative -primary-config-path in "run params" (run menu), but it is not necessary.
Note that unlike other projects, before running with F9, you must ensure you did rebuild the IDE (but do not restart it)
Check that the rebuild replaced the lazarus.exe. In very rare cases it may create a lazarus.new.exe (if previous debugging failed really bad, and locked the exe)
Also ensure that your package has debug info, and that you add debug info ( -gw ) in "Configure build lazarus"
I advice to make your own copy of lazarus.exe, because eventually the lazarus.old.exe may be overridden with a bad copy too.