[MLton-devel] debugging native assembly and line numbers

Stephen Weeks MLton@mlton.org
Wed, 31 Jul 2002 16:25:30 -0700


> The problem is that -Wa,--gstabs option applies to gcc's underlying call
> to as.  When you pass gcc a .S file, it runs cpp on the .S to produce a
> temporary .s file (with __LINE__ expanded), which is what is passed to as. 
> So, you end up with an executable whose debugging info is tied to the (now
> deleted) temporary .s file.  If you compile a .S file with gcc -S, it
> pipes the cpp-ed version to stdout (as opposed to producing a .s file). 

The only thing I can think of is to do the output redirection
ourselves, which doesn't sound too bad.

> I don't know of any way of fooling as or gcc into doing what we want.
> If your stuck, you could try compiling with -debug false -stop g, run each
> .S file through gcc -S > .s, then finish compiling with 
> -debug true X.c X.s.  Then you ought to be able to debug (relative to the
> .s file).

Thanks.  I just compiled -debug false, got the line number, then
compiled -debug true.


-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel