-g with -native

Matthew Fluet Matthew Fluet <fluet@CS.Cornell.EDU>
Thu, 9 Nov 2000 10:32:08 -0500 (EST)


If it's possible, the *.n.s files produced by the native backend should be
compiled with the -Wa,--gstabs option to gcc when mlton is invoked with
-g.  Since gcc is mainly a C compiler, it only inserts debugging
information when compiling a .c file; i.e., -g does nothing when compiling
an assembly file.  Compiling with -Wa,--gstabs instructs the assembler to
produce an object file with debug information pointing back to the .s
file.  Unfortunately, you can't just add -Wa,--gstabs to all invocations
of gcc, because then compiled .c files will have two sets (of probably
conflicting) debug information.