Bug 20253 – bad debug line info for function without epilog

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2019-09-29T18:15:55Z
Last change time
2019-12-20T07:54:14Z
Keywords
DebugInfo, pull
Assigned to
No Owner
Creator
Rainer Schuetze

Comments

Comment #0 by r.sagitario — 2019-09-29T18:15:55Z
This module: string foo(string s1, string s2) { throw new Exception("x"); } built with "dmd -g -m64 test.c" generates an object file with invalid debug line info: ***** SECTION #C *** LINES 0000:00000000-00000086, flags = 0000, fileid = 00000000 2 00000000 4 00000013 fileid = 00000008 2607 00000060 fileid = 00000000 5 00000086 <<<< WARNING >>>> 1 line/addr pairs are out of bounds! *** SYMBOLS (000064) S_UDT: 0x1004, string (000073) S_GPROC32: [0000:00000000], Cb: 00000086, Type: 0x1006, dbginf.foo Parent: 00000000, End: 00000000, Next: 00000000 Debug start: 00000013, Debug end: 00000086 (0000A5) S_REGREL32: rbp+00000010, Type: 0x1007, s2 (0000B6) S_REGREL32: rbp+00000018, Type: 0x1007, s1 (0000C7) S_ENDARG (0000CB) S_END The line info beyond the end of the function can overlap with code of the following function, causing it not to be shown in the debugger.
Comment #1 by dlang-bot — 2019-11-20T20:42:19Z
@rainers created dlang/dmd pull request #10594 "Issue 20253 - bad debug line info for function without epilog (COFF)" fixing this issue: - fix issue 20253 - bad debug line info for function without epilog (COFF) fix size of function by using the actual emitted code offset, not guessing from epilog data do not emit line number for closing brace if the epilog was omitted https://github.com/dlang/dmd/pull/10594
Comment #2 by r.sagitario — 2019-11-21T21:58:42Z
*** Issue 11029 has been marked as a duplicate of this issue. ***
Comment #3 by dlang-bot — 2019-11-26T03:43:17Z
dlang/dmd pull request #10594 "Issue 20253 - bad debug line info for function without epilog (COFF)" was merged into stable: - 6f06db409b4d4d95438d6db263daee43b8612a2e by Rainer Schuetze: fix issue 20253 - bad debug line info for function without epilog (COFF) fix size of function by using the actual emitted code offset, not guessing from epilog data do not emit line number for closing brace if the epilog was omitted https://github.com/dlang/dmd/pull/10594
Comment #4 by dlang-bot — 2019-12-20T07:54:14Z
dlang/dmd pull request #10484 "Merge remote-tracking branch 'upstream/stable' into merge_stable" was merged into master: - c22090b883251ae9db722e59ec83601dbdaf7826 by Rainer Schuetze: fix issue 20253 - bad debug line info for function without epilog (COFF) fix size of function by using the actual emitted code offset, not guessing from epilog data do not emit line number for closing brace if the epilog was omitted https://github.com/dlang/dmd/pull/10484