[MLton] experimental release 20051109
Matthew Fluet
fluet@cs.cornell.edu
Tue, 15 Nov 2005 09:16:55 -0500 (EST)
> On Nov 15, 2005, at 10:30 AM, Wesley W. Terpstra wrote:
>> 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.
>
> This seems pretty easy, actually! :-)
> Run 'nm -ap' against a binary compiled with '-g'.
>
> You will see the offset in the text segment on the left,
> followed by a 'SLINE' directive whose immediately
> preceding number is the line number of the last SO.
I see nothing like this when I run 'nm -ap' on a simple C program compiled
with '-g'.