Fixes bugs:#4034.
NULL pointer dereference crash fix in dwFindFileIndex() (src/SDCCdwarf2.c:1594-1599):
Using --c1mode with --debug would crash with SIGSEGV because fullSrcFileName was NULL when reading from stdin. Fixed by adding a fallback to "<stdin>" when the filename is unavailable.
New --c1mode-src <file> CLI option (src/SDCCmain.c):
Allows specifying the original source filename for DWARF debug info when using --c1mode (preprocessed input via stdin). Without this, DWARF output had no file reference when --c1mode was used.
DWARF generation crash for _BitInt types (src/SDCCdwarf2.c:2569-2588):
Using --debug with C23 _BitInt(N) types would crash with FATAL error "unhandled base type _BitInt(N)" because dwTagFromType() was missing a case for V_BITINT/V_BITINTBITFIELD. Fixed by adding proper DWARF type tag generation (DW_TAG_base_type with DW_AT_bit_size).
Test coverage added:
support/regression/tests/bug-4034.c: Exercises various _BitInt types (signed/unsigned, different widths, bitfields) with --debug flag forced via EXTRA_COMPILE_HACK in Makefile.in. Pre-fix this would crash during DWARF generation; post-fix it compiles and runs successfully.
support/regression/test-c1mode-debug.py: Platform-independent Python script (works on Windows) that directly tests --c1mode --debug (piping source through stdin) and --c1mode-src <file> option. Pre-fix both would crash; post-fix both pass.
Wired test-c1mode-debug into make test-ports dependency chain so it runs automatically during the regression suite.
ChangeLog:
The changes to SDCC itself look good to me. But I'm not a Python programmer, so I'd like to get the opinion of someone who knows Python (used for the test) before the patch goes in.