Generating assembly from dmd

H. S. Teoh hsteoh at quickfur.ath.cx
Sun Dec 22 07:04:54 PST 2013


On Sun, Dec 22, 2013 at 03:17:42PM +0100, Joseph Rushton Wakeling wrote:
> Hi all,
> 
> Can someone walk me through in a friendly way how to check the
> assembly produced by dmd?  The application in this case is checking
> some new patches to Phobos. It's something I'm not familiar with
> doing in general and particularly not with dmd (which doesn't seem
> to have an assembly-output switch), so I'm hoping someone can advise
> :-)
[...]

This is what I do:

	dmd -oprogram mod1.d mod2.d ...
	objdump -D program | ddemangle > program.asm
	vi program.asm
	# search for symbol, e.g., "writeln". Assuming ddemangle has
	# succesfully demangled the symbol you're looking for (sometimes
	# it doesn't), you can just search for it as-is.


T

-- 
Today's society is one of specialization: as you grow, you learn more
and more about less and less. Eventually, you know everything about
nothing.


More information about the Digitalmars-d-learn mailing list