Re: DLang/Wiki/'Hello World'/Run Code/Disassembly

2016-10-21 Thread cym13 via Digitalmars-d-learn

On Friday, 21 October 2016 at 19:27:59 UTC, cym13 wrote:

On Friday, 21 October 2016 at 19:03:30 UTC, DLearner wrote:

[...]


That's a problem about the debugger/disassembler that you use, 
not about D.


We can't do anything else to help as you give no information. 
See my post:

- I gave the exact source code
- I gave the compiler that I used with all its flags
- I explained what tool I used to analyse it, what I was 
analysing exactly and how
- At each step I gave the exact output of the tools with 
potential errors


This means this is reproducible. Anybody can try it at home and 
check for himself that it works.


There is *no way* to fix a bug that we can't reproduce, and 
there is *no way* to reproduce it unless we have all the 
informations stated above.


Apologies, I didn't understand that you put all that in the title.


Re: DLang/Wiki/'Hello World'/Run Code/Disassembly

2016-10-21 Thread cym13 via Digitalmars-d-learn

On Friday, 21 October 2016 at 19:03:30 UTC, DLearner wrote:

On Friday, 21 October 2016 at 09:07:35 UTC, cym13 wrote:

On Friday, 21 October 2016 at 08:58:50 UTC, DLearner wrote:

[...]


What makes you think that? It's hard to tell if you don't give 
any information.



I pressed the 'Run' button and got the 'Hello World'.
I pressed the 'Disassembly' button and got...nothing.


That's a problem about the debugger/disassembler that you use, 
not about D.


We can't do anything else to help as you give no information. See 
my post:

- I gave the exact source code
- I gave the compiler that I used with all its flags
- I explained what tool I used to analyse it, what I was 
analysing exactly and how
- At each step I gave the exact output of the tools with 
potential errors


This means this is reproducible. Anybody can try it at home and 
check for himself that it works.


There is *no way* to fix a bug that we can't reproduce, and there 
is *no way* to reproduce it unless we have all the informations 
stated above.


Re: DLang/Wiki/'Hello World'/Run Code/Disassembly

2016-10-21 Thread Daniel Kozak via Digitalmars-d-learn

Dne 21.10.2016 v 21:03 DLearner via Digitalmars-d-learn napsal(a):


On Friday, 21 October 2016 at 09:07:35 UTC, cym13 wrote:

On Friday, 21 October 2016 at 08:58:50 UTC, DLearner wrote:

[...]


What makes you think that? It's hard to tell if you don't give any 
information.



I pressed the 'Run' button and got the 'Hello World'.
I pressed the 'Disassembly' button and got...nothing.


Okey so some page does not work correctly, and you think this? Wow :D
you should try one of these this pages
http://asm.dlang.org
http://d.godbolt.org


Re: DLang/Wiki/'Hello World'/Run Code/Disassembly

2016-10-21 Thread DLearner via Digitalmars-d-learn

On Friday, 21 October 2016 at 09:07:35 UTC, cym13 wrote:

On Friday, 21 October 2016 at 08:58:50 UTC, DLearner wrote:

[...]


What makes you think that? It's hard to tell if you don't give 
any information.



I pressed the 'Run' button and got the 'Hello World'.
I pressed the 'Disassembly' button and got...nothing.



Re: DLang/Wiki/'Hello World'/Run Code/Disassembly

2016-10-21 Thread cym13 via Digitalmars-d-learn

On Friday, 21 October 2016 at 08:58:50 UTC, DLearner wrote:
Code ran with expected output, but Disassembly seemed to go in 
a loop?


What makes you think that? It's hard to tell if you don't give 
any information.


Let's do that! I'll use only naive flags and all and use radare2 
to
disassemble the main D function which is _Dmain (the entry point 
has to

launch the runtime etc... we aren't very interested in that):

$ cat >test.d <│   0x08077e73  b9d02b0a08 mov ecx, 
str.Hello_World_;

"Hello World!" @ 0x80a2bd0
│   0x08077e78  b80c00 mov eax, 0xc
│   0x08077e7d  51 push ecx
│   0x08077e7e  50 push eax
│   0x08077e7f  e80400 call
sym._D3std5stdio16__T7writelnTAyaZ7writelnFNfAyaZv
│   0x08077e84  31c0   xor eax, eax
│   0x08077e86  5d pop ebp
└   0x08077e87  c3 ret

No loop. Not even a jump. I'm in x86 so arguments are simply 
pushed on the

stack. No brainer.