Code Listing?

Don Clugston dac at nospam.com.au
Mon Nov 13 00:37:42 PST 2006


Jarrett Billingsley wrote:
> "John" <johnkirollos at yahoo.com> wrote in message 
> news:ej5jsm$1r9l$1 at digitaldaemon.com...
>> Jarrett,
>>
>> C++ for example can generated asm code listing. It's useful in
>> debugging, code optimization, and for me, it's interesting in
>> learning the language by seeing how the compiler generates the code.
>>
>> There is nothing that prevents D from having such feature, as it
>> generates directly executable code and does not rely on a VM.
> 
> Then ask for Walter to add it to DMD.  There's no reason why it doesn't have 
> it other than he didn't think about it, or he didn't think it necessary.
> 
>> obj2asm coming with DMD is a Linux executable? What about a windows
>> equivalent?
> 
> Man, it would be nice.  But the Windows version of obj2asm is available from 
> Digital Mars as well -- in the $15 extended utilities package.  I'm not 
> entirely sure why Walter distributes the Linux version for free.
> 
> As far as disassembling the individual object files, you'd probably have 
> luck using Borland tools to do so, as DMD uses the OMF object format.  But 
> for fully compiled EXEs or DLLs, you can try the Microsoft DUMPOBJ utility, 
> if you can get your hands on it.  It works well.
> 
> Failing all of that, you can use a debugger to step through your program and 
> look at the assembly listing on the fly.  It's not all at once, but hey.

The Open Watcom compiler tools work with DMD.
Also DDL is becoming a good alternative to DUMPOBJ.




More information about the Digitalmars-d-learn mailing list