Thread overview | |||||
---|---|---|---|---|---|
|
December 22, 2013 Re: Generating assembly from dmd | ||||
---|---|---|---|---|
| ||||
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. |
December 22, 2013 Re: Generating assembly from dmd | ||||
---|---|---|---|---|
| ||||
On Sun, Dec 22, 2013 at 07:04:54AM -0800, H. S. Teoh wrote: > 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 ... Also, using the -g switch here may help, by including information that lets objdump figure out which identifiers are being referenced by hexadecimal addresses in the program (i.e., 'call std.stdio.writeln+0x123' as opposed to 'call 0x123456'). > 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 -- The fact that anyone still uses AOL shows that even the presence of options doesn't stop some people from picking the pessimal one. - Mike Ellis |
December 22, 2013 Re: Generating assembly from dmd | ||||
---|---|---|---|---|
| ||||
On 22/12/13 16:15, H. S. Teoh wrote:
> On Sun, Dec 22, 2013 at 07:04:54AM -0800, H. S. Teoh wrote:
>> This is what I do:
>>
>> dmd -oprogram mod1.d mod2.d ...
>
> Also, using the -g switch here may help, by including information that
> lets objdump figure out which identifiers are being referenced by
> hexadecimal addresses in the program (i.e., 'call
> std.stdio.writeln+0x123' as opposed to 'call 0x123456').
>
>
>> 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.
> [...]
Thanks muchly :-)
|
Copyright © 1999-2021 by the D Language Foundation