[MLton-devel] stabs vs dwarf2

Stephen Weeks MLton@mlton.org
Thu, 31 Oct 2002 09:35:24 -0800


In doing self compiles with a newer version of as, I noticed that it
now gives warnings on assembly files with more than 2^16 lines.  A
self compile generates a couple such files.  So, I decided to try
compiling with dwarf instead of stabs.  I wasn't able to get it
working.  I can compile fine, but gdb doesn't completely work on the
executable.  Here's what a normal compile looks like

MLton starting
   Compile SML starting
      pre codegen starting
      pre codegen finished in 9.10 + 0.00 (0% GC)
      x86 code gen starting
      x86 code gen finished in 2.21 + 0.00 (0% GC)
   Compile SML finished in 11.31 + 0.00 (0% GC)
   Compile C starting
      gcc -S -g -I/home/sweeks/mlton/src/build/bin/../lib/self/include -O1 -o \
          /tmp/fileEbMRCn.s z.c
   Compile C finished in 0.17 + 0.00 (0% GC)
   Assemble starting
      gcc -g -c -o z.o /tmp/fileEbMRCn.s
      gcc -Wa,--gstabs -c -o z.0.o z.0.s
   Assemble finished in 0.15 + 0.00 (0% GC)
   Link starting
      gcc -g -o z z.o z.0.o -L/home/sweeks/mlton/src/build/bin/../lib/self \
          -lmlton-gdb -lm /usr/lib/libgmp.a
   Link finished in 0.10 + 0.00 (0% GC)
MLton finished in 11.73 + 0.00 (0% GC)

After this I can run gdb on the executable and set breakpoints in z.c
or in z.0.s.

Here's what a compile with dwarf2 looks like.

MLton starting
   Compile SML starting
      pre codegen starting
      pre codegen finished in 9.07 + 0.00 (0% GC)
      x86 code gen starting
      x86 code gen finished in 2.16 + 0.00 (0% GC)
   Compile SML finished in 11.23 + 0.00 (0% GC)
   Compile C starting
      gcc -S -gdwarf-2 -I/home/sweeks/mlton/src/build/bin/../lib/self/include \
          -O1 -o /tmp/fileEbMRCn.s z.c
   Compile C finished in 0.17 + 0.00 (0% GC)
   Assemble starting
      gcc -gdwarf-2 -c -o z.o /tmp/fileEbMRCn.s
      gcc -Wa,--gdwarf2 -c -o z.0.o z.0.s
   Assemble finished in 0.08 + 0.00 (0% GC)
   Link starting
      gcc -gdwarf-2 -o z z.o z.0.o \
          -L/home/sweeks/mlton/src/build/bin/../lib/self -lmlton-gdb -lm \
          /usr/lib/libgmp.a
   Link finished in 0.09 + 0.00 (0% GC)
MLton finished in 11.57 + 0.00 (0% GC)

After this, when I run gdb, I can set breakpoints in z.c, but not in
z.0.s.  Any ideas on what I might be doing wrong?


-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel