forked from iains/gcc-14-branch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR modula2/114565 progress trace would be useful to isolate ICE for u…
…sers This patch introduces the internal option -fm2-debug-trace= which can be given a comma separated list of filter terms. Currently it allows: all,line,token,quad. The patch allows users to trace the progress of cc1gm2 so that source which causes an ICE can be reduced. Once PR113836 is complete it is expected that the trace information will be written to file. gcc/m2/ChangeLog: PR modula2/114565 * gm2-compiler/M2GenGCC.mod (CodeStatement): Test GetDebugTraceQuad before calling DisplayQuad. * gm2-compiler/M2LexBuf.mod (NumberIO): Import CardToStr. (GetToken): Test GetDebugTraceToken before writing the token number or token line. * gm2-compiler/M2Options.def (SetDebugTraceQuad): Rename to (SetM2DebugTraceFilter): ...this. (SetDebugTraceAPI): Remove. (GetDebugTraceQuad): New procedure function. (GetDebugTraceTree): Ditto. (GetDebugTraceToken): Ditto. (GetDebugTraceLine): Ditto. (GetDebugFunctionLineNumbers): Ditto. * gm2-compiler/M2Options.mod (DebugFunctionLineNumbers): New boolean variable. (DebugTraceQuad): Ditto. (DebugTraceTree): Ditto. (DebugTraceLine): Ditto. (DebugTraceToken): Ditto. (errors1): New procedure. (SetDebugTraceQuad): Remove. (SetM2DebugTraceFilter): New procedure implemented. (SetM2DebugTrace): Ditto. (GetDebugTraceQuad): Ditto. (GetDebugTraceToken ): Ditto. (GetDebugTraceLine): Ditto. (SetDebugTraceLine): Remove. * gm2-compiler/M2Quads.mod (GenQuadOTrash): Test GetDebugTraceQuad and call DisplayQuad. (GenQuadOTypetok): Ditto. * gm2-compiler/SymbolTable.mod: Replace DebugFunctionLineNumbers with GetDebugFunctionLineNumbers. * gm2-gcc/init.cc (_M2_M2LangDump_init): Add prototype. (init_PerCompilationInit): Add call. * gm2-gcc/m2misc.cc (m2misc_cerror): New function. (m2misc_error): Ditto. * gm2-gcc/m2misc.def (error): New procedure. (cerror): Ditto. * gm2-gcc/m2misc.h (m2misc_cerror): New prototype. (m2misc_error): Ditto. * gm2-gcc/m2options.h (M2Options_SetDebugTraceQuad): New prototype. (M2Options_SetDebugTraceAPI): Remove. (M2Options_GetDebugTraceToken): New prototype. (M2Options_GetDebugTraceLine): Ditto. (M2Options_SetDebugFunctionLineNumbers): Ditto. (M2Options_GetDebugFunctionLineNumbers): Ditto. (M2Options_SetM2DebugTraceFilter): Ditto. * gm2-lang.cc (gm2_langhook_init_options): Remove OPT_fdebug_trace_quad case. Remove OPT_fdebug_trace_api case. Add OPT_fm2_debug_trace_ case. * lang.opt (fm2-debug-trace): New option. (fdebug-trace-api): Remove. (fdebug-trace-quad): Remove. * m2.flex (m2flex_M2Error): Check s for NULL. (skipnewline): New function. (consumeLine): Call traceline. Signed-off-by: Gaius Mulley <[email protected]>
- Loading branch information
Gaius Mulley
committed
Apr 2, 2024
1 parent
871bb5a
commit 1bafa6a
Showing
14 changed files
with
285 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.