First of all: Debugging the compiler will be the lesser worry you have. Fixing the issue will most likely need some understanding of the structures used in the compiler.
If you want to take that on,
https://wiki.freepascal.org/Compiler_development_articles look at stuff like the "FPC internals".
Since you are using FpcUpDeluxe, that should allow you to set he correct arguments for building FPC with debug info:
* for gdb -gw2
* for FpDebug: -gw3
and in any case you likely also want: -gl -Criot
There is a file compiler/ppcx86.lpi which you can open in lazarus and then run in the debugger. Menu Run > Run parameters: for command line
(you may need any of the ppc*.lpi) depending on your target architecture / you should have the ppc already build, and not let the IDE attempt to build it)
Alternatively debug from command line using gdb or lldb.
Whenever my projects are growing larger (15.000 lines of code, approx. 20 forms and frames), I encounter "randomly" compiler crashes. In many cases they only ocure when I do a normal compile (Ctrl-F9), and a "build" (Shift-F9) will then run through.
Which points to ppu loading, or rather to using data loaded from ppu, instead of data generated during the current run of the compiler. One possibility is that some data is not loaded correctly and something is left uninitialized.
If it turns out something that may have been freed => try valgrind.
But now I reached again the state where even "Build" will crash. After the crash, the IDE points either to the last line of a random unit (with a column 50,000 or above), or at some 'interface' definition of an generic object definition.
FPC 3.3.1 (maybe even 3.2.3) had some fixes around ppu loading. But you then need to adapt any code that doesn't compile.
3.2.3 would be preferable as it likely is more stable.
Have you tried to really remove **all** ppu from all folders/packages before the build?
In general such errors have in part been known to be caused by circular unit references (uses in implementation). You may want to try to get rid of them if you can. (I know, easier said ...)
I theoretically know how to raise a bug report, but I would need to upload the whole source code and all the packages etc. into public.
Does anyone have some tips how to debug such a compiler crash by myself?
See above... That is going to be a real deep dive.
Maybe if you capture the crash you get an idea how to extract a small sample for reproduction => I wouldn't bet on it.
Also, submitting an issue may not help at all, if it is already fixed in 3.3.1. Because then whats needed instead is the commit that fixed it, so it can be reviewed if it can be merged to 3.2.3 (if not yet done).
Well, if it is just a commit, afaik ppu loading had major rework done in 3.3.1. (but don't know for sure).
Since you may have to rebuild your FPC anyway, try building with -O-
There is a tiny (extremely slim) chance that it may help.
IIRC (and again, sorry not sure), you need than in "OPT" and "OPTNEW"... Something like
make all LINKSMART=0 CREATESMART=0 OPTIMIZE=0 OPT="-O- -gw3 -gl " OPTNEW="-O- -gw3 -gl "
Adding -g- -gtttt (before the -gl and before the -gw3) may also help. I think its 4 "t" (may be 3). If you have the correct number, it will set uninitialized values to 0/nil => and that may just *hide* the issue (with a real big amount of luck).