-
Notifications
You must be signed in to change notification settings - Fork 296
[BUG] Enumerations values are always shown as unsigned integers in the watch window #455
Copy link
Copy link
Closed
Labels
BugA report of unintended or broken behavior.A report of unintended or broken behavior.DebuggerPertains to the debugger.Pertains to the debugger.
Description
Expected: The watch window should respect the sign of the underlying integral type.
Observed behavior:
- MSVC Build: (refers to the example program compiled with MSVC)
- Raddbg: Fails to display the tag and does not respect the sign of the underlying integer on negative values.
- RemedyBG: Display the correct tag and respects the sign of the underlying integer.
- CLANG Build: (refers to the example program compiled with CLANG)
- Raddbg: Displays the correct tag in all cases but treats all values as unsigned.
- RemedyBG: Shows the correct sign but fails to display the tag for negative values.
Similar issue: #233
Debugger version 0.9.15 ALPHA - Apr 10 2025 [33326a8]
Example program
// main.c
#include <stdint.h>
#include <windows.h>
enum MyEnum {
MY_ENUM_NEGATIVE = -1,
MY_ENUM_POSITIVE = 1,
};
enum MyEnum_S32 : int32_t {
MY_ENUM_S32_NEGATIVE = -1,
MY_ENUM_S32_POSITIVE = 1,
};
int main(void) {
enum MyEnum my_enum_negative = MY_ENUM_NEGATIVE;
enum MyEnum my_enum_positive = MY_ENUM_POSITIVE;
if (my_enum_negative < 0) {
OutputDebugString("my_enum_negative is negative.\n");
} else {
OutputDebugString("my_enum_negative is positive.\n");
}
enum MyEnum_S32 my_enum_s32_negative = MY_ENUM_S32_NEGATIVE;
enum MyEnum_S32 my_enum_s32_positive = MY_ENUM_S32_POSITIVE;
if (my_enum_s32_negative < 0) {
OutputDebugString("my_enum_s32_negative is negative.\n");
} else {
OutputDebugString("my_enum_s32_negative is positive.\n");
}
return 0;
}MVSC build
Build command: cl main.c /Zi
Compiler version: Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34809 for x64
Note: In the MSVC build the enum "MyEnum_S32" is commented out bacause fixed-width enums are only supported in CLANG.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA report of unintended or broken behavior.A report of unintended or broken behavior.DebuggerPertains to the debugger.Pertains to the debugger.



