[MLton-user] experimental release 20051109
Wesley W. Terpstra
wesley@terpstra.ca
Tue, 15 Nov 2005 10:30:35 +0100
(Should this thread be moved to the developer list?)
On Nov 15, 2005, at 6:45 AM, Florian Weimer wrote:
> GCC is permitted to duplicate asm statements. 8-(
This seems quite reasonable...
In fact, it's surprising that the labels haven't been
duplicated before; gcc inlines too.
> I'm not sure how to fix this, maybe using a special section for the
> profiling label addresses is the proper approach.
These labels are just needed to trace the IP back to
the source SML code, right? They make the giant
lookup table, used on a clock tick?
Can't we take a page from cpp, ie: put directives
into the C source that specify the profile label?
#define ProfileLabel(l) # l "/tmp/magic-mlton-profile-label.sml"
If the files were compiled with '-g', you'd have debug
information which told you the 'line number', which
in this case would be the ProfileLabel. I don't know
how hard/portable reading debug info is, though.
Actually, doing this would be really cool anyways!
If every output C line tracked where it came from
in the actual SML source, you could run the program
via gdb and actually see the SML line being executed.
The most cool would be if the debug info could also
describe what variables are in scope and where to
read them. I need to read about debug info sections...
This is probably too much for the next release, though.