Description
Hi, I found a bug using MingW, GDB and Qt Creator on Windows.
When creating an compile-time C-style bitmask constant like the following:
#include <stdio.h> #define BLA (1 << 0) #define BLA2 (1 << 1) void main(void) { const unsigned int data = BLA | BLA2; if(data & BLA) {printf("BLA");} if(data & BLA2) {printf("BLA2");} printf("%d", data); }
It gives the correct result at runtime. However, hovering the constant BLA2 at debug time while stopping at an break point displays the wrong value 0x0010 instead of 0b0010 which would correctly evaluate to 2. So using that value 0x0010 (because for some reason BLA2 is not usable in GDB watches) would always give an incorrect result (which is by no means correct) but I don't really get how Qt Creator gets that value. Looking at the assembly in GCC it does an simpleĀ and $0x2,%eax so I am wondering how that value gets provided to the IDE.