kb3ctd2 at yahoo.com
Sat Nov 11 19:49:42 PST 2006
"John" <johnkirollos at yahoo.com> wrote in message
news:ej5jsm$1r9l$1 at digitaldaemon.com...
> 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
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.
More information about the Digitalmars-d-learn