[Issue 15432] Win64: bad code offset in debug line number info

2017-08-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432

--- Comment #8 from github-bugzi...@puremagic.com ---
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/399b12d8d6feaf43ced88c2559404f29ab70c496
fix issue 15432: Win64: bad code offset in debug line number info

https://github.com/dlang/dmd/commit/a7867ca72bf51a6db9e3ed44428e142a21d3de75
Merge pull request #6979 from rainers/issue15432

--


[Issue 15432] Win64: bad code offset in debug line number info

2017-08-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432

--- Comment #7 from github-bugzi...@puremagic.com ---
Commits pushed to newCTFE at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/399b12d8d6feaf43ced88c2559404f29ab70c496
fix issue 15432: Win64: bad code offset in debug line number info

https://github.com/dlang/dmd/commit/a7867ca72bf51a6db9e3ed44428e142a21d3de75
Merge pull request #6979 from rainers/issue15432

--


[Issue 15432] Win64: bad code offset in debug line number info

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 15432] Win64: bad code offset in debug line number info

2017-07-26 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432

--- Comment #6 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/399b12d8d6feaf43ced88c2559404f29ab70c496
fix issue 15432: Win64: bad code offset in debug line number info

pinhole optimization should not yield different results if run twice

https://github.com/dlang/dmd/commit/a7867ca72bf51a6db9e3ed44428e142a21d3de75
Merge pull request #6979 from rainers/issue15432

fix issue 15432: Win64: bad code offset in debug line number info
merged-on-behalf-of: Rainer Schuetze <rain...@users.noreply.github.com>

--


[Issue 15432] Win64: bad code offset in debug line number info

2017-07-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432

Rainer Schuetze  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #5 from Rainer Schuetze  ---
https://github.com/dlang/dmd/pull/6979

--


[Issue 15432] Win64: bad code offset in debug line number info

2017-07-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432

--- Comment #4 from Rainer Schuetze  ---
Here's a further reduction:

///
void call15432(string col) {}

int test15432() // line 8
{
call15432(null);
return 0;
}
///

dumpbin:
_D7testpdb9test15432FZi:
  : 55 pushrbp
  0001: 48 8B EC   mov rbp,rsp
  0004: 48 83 EC 10sub rsp,10h
  0008: 48 C7 45 F0 00 00  mov qword ptr [rbp-10h],0
00 00
  0010: 48 C7 45 F8 00 00  mov qword ptr [rbp-8],0
00 00
  0018: 48 8D 4D F0lea rcx,[rbp-10h]
  001C: 48 83 EC 20sub rsp,20h
  0020: E8 00 00 00 00 call_D7testpdb9call15432FAyaZv
  0025: 48 83 C4 20add rsp,20h
  0029: 31 C0  xor eax,eax
  002B: 48 8B E5   mov rsp,rbp
  002E: 5D pop rbp
  002F: C3 ret

cvdump
(https://github.com/Microsoft/microsoft-pdb/blob/master/cvdump/cvdump.exe):
*** LINES
  8  10 0008 11 0029 12 002A

You could get the offset to the line number before a stack address, but the
return adress is still in the preceding line because there is some cleanup code
after the call. In this code, the bad adress is even after the line with
"return".

Enumerating the line number info is possible in test/runnable/testpdb.d, but a
test will have to check specific code to be generated. At least, I don't have
an idea what to test for instead.

--


[Issue 15432] Win64: bad code offset in debug line number info

2017-07-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432

Vladimir Panteleev  changed:

   What|Removed |Added

   Keywords||symdeb
 CC||dlang-bugzilla@thecybershad
   ||ow.net

--- Comment #3 from Vladimir Panteleev  ---
I reproduced this with 2.074.1.

Detailed steps to reproduce (without assuming prior knowledge):

1. You need:
  - dumpbin.exe (Visual Studio or Windows SDK)
  - dumplines.exe (build from source from https://github.com/rainers/cv2pdb,
install Visual D from https://github.com/dlang/visuald/releases, or download
stand-alone binary I compiled from
https://dump.thecybershadow.net/3d28f947dd7aeeb30325935bc2463d5d/dumplines.exe)

2. Save code to test.d
3. Run: dmd -g -m64 -c test.d 
4. Run: dumpbin.exe /DISASM test.obj > test.asm
5. Run: dumplines.exe test.obj > test-lines.txt
6. In test-lines.txt, note the offsets (Off 0x### numbers) for the _Dmain
function (should be the first in the file)
7. In test.asm, note the offsets (first column of hex numbers) for the
instructions for the _Dmain function (should be the first in the file)

If there are any offsets in test-lines.txt's _Dmain which do not appear in
test.asm's _Dmain, then it is an instance of this bug.

A self-contained example would be nice. Would it be possible to reproduce this
issue e.g. by throwing an exception and looking at the stack trace for an
address not mapped to a line number OSLT?

--


[Issue 15432] Win64: bad code offset in debug line number info

2015-12-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432

yazan.dab...@gmail.com changed:

   What|Removed |Added

 CC||yazan.dab...@gmail.com

--- Comment #1 from yazan.dab...@gmail.com ---
I understand that you are talking about the debug symbols, right? If so, the
following is not the cause of this bug.

This bug reminded me of a change I made in the stack trace addresses generation
(https://github.com/D-Programming-Language/druntime/commit/8822115bc8d52fa61c15cef38fe77349f18747b9)
that I did not test the effect of on Windows.

I made this change so that the addresses coming from the stack trace point
before the return address (i.e. to point at the call instruction even though it
most probably won't point at the start of it). I don't know if the address to
line handler on Windows produces correct mappings for such addresses.

--


[Issue 15432] Win64: bad code offset in debug line number info

2015-12-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15432

--- Comment #2 from Rainer Schuetze  ---
Yes, I'm referring to the debug information generated by dmd, so libraries
cannot cause this.

--