With a 2-byte file, containing the bytes 10 32, and this template:
BitfieldDisablePadding();
struct S {
ubyte x : 4;
};
S s;
S s;
The variables tab will say that s[0] starts at 0x0, which is expected, and that s[1] starts at 0x1, which is not expected. However, the values are correct, with s[0].x being 0 and s[1].x being 1. Setting the start addresses to Local will show s[1].x starting at -1.
With this template:
BitfieldDisablePadding();
struct S {
ubyte x : 4;
} s[2];
The value of s[0].x is still 0, but the value of s[1].x is now 2.
And finally, with this template:
BitfieldDisablePadding();
struct S {
ubyte x : 4;
} s[4];
The error Template passed end of file. will be shown.
The expectation is that, for the first and second templates, the start addresses for s[0] and s[1] will both be 0x0, and for the third template, 4 s objects will be created, with the first two starting at 0x0 and having the values 0 and 1, and the last two starting at 0x1 and having the values 2 and 3.