[Issue 15432] Win64: bad code offset in debug line number info
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Jul 3 11:37:58 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=15432
--- Comment #4 from Rainer Schuetze <r.sagitario at gmx.de> ---
Here's a further reduction:
///////////////////
void call15432(string col) {}
int test15432() // line 8
{
call15432(null);
return 0;
}
///////////////////
dumpbin:
_D7testpdb9test15432FZi:
0000000000000000: 55 push rbp
0000000000000001: 48 8B EC mov rbp,rsp
0000000000000004: 48 83 EC 10 sub rsp,10h
0000000000000008: 48 C7 45 F0 00 00 mov qword ptr [rbp-10h],0
00 00
0000000000000010: 48 C7 45 F8 00 00 mov qword ptr [rbp-8],0
00 00
0000000000000018: 48 8D 4D F0 lea rcx,[rbp-10h]
000000000000001C: 48 83 EC 20 sub rsp,20h
0000000000000020: E8 00 00 00 00 call _D7testpdb9call15432FAyaZv
0000000000000025: 48 83 C4 20 add rsp,20h
0000000000000029: 31 C0 xor eax,eax
000000000000002B: 48 8B E5 mov rsp,rbp
000000000000002E: 5D pop rbp
000000000000002F: C3 ret
cvdump
(https://github.com/Microsoft/microsoft-pdb/blob/master/cvdump/cvdump.exe):
*** LINES
8 00000000 10 00000008 11 00000029 12 0000002A
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.
--
More information about the Digitalmars-d-bugs
mailing list