Bug 21658 – Debugger is reading enums with EnumBaseType incorrectly

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2021-02-23T01:25:13Z
Last change time
2024-12-13T19:14:51Z
Keywords
backend, DebugInfo, pull
Assigned to
No Owner
Creator
alexanderheistermann
Moved to GitHub: dmd#19876 →

Comments

Comment #0 by alexanderheistermann — 2021-02-23T01:25:13Z
Basic example: enum X : ubyte { A, B, C } void main() { X x = X.A; } it reads x as an ubyte type instead of a enum type
Comment #1 by r.sagitario — 2021-02-23T22:03:09Z
Even though dmd emits the debug info for the enum declaration, it declares the variable as an ubyte: (000044) S_GPROC32: [0000:00000000], Cb: 00000013, Type: 0x1005, D main Parent: 00000000, End: 00000000, Next: 00000000 Debug start: 00000008, Debug end: 0000000E (000072) S_ENDARG (000076) S_REGREL32: rbp+FFFFFFF8, Type: T_UCHAR(0020), x (000086) S_END LDC works correctly, and Mago displays the enumerator value as expected
Comment #2 by dlang-bot — 2021-03-13T21:00:32Z
@12345swordy created dlang/dmd pull request #12274 "Fix issue 21658 Debugger is reading enums with EnumBaseType incorrectly." fixing this issue: - Fix issue 21658 Debugger is reading enums with EnumBaseType incorrectly. https://github.com/dlang/dmd/pull/12274
Comment #3 by alexanderheistermann — 2021-03-25T01:11:52Z
Adding the keyword backend, as it quite clear that the backend is assuming that enums are 32 bit size which isn't always the case.
Comment #4 by dlang-bot — 2021-05-31T19:46:59Z
@12345swordy updated dlang/dmd pull request #12097 "Implementation of Properties." fixing this issue: - Fix issue 21658 Debugger is reading enums with EnumBaseType incorrectly. https://github.com/dlang/dmd/pull/12097
Comment #5 by robert.schadek — 2024-12-13T19:14:51Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19876 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB