Page 1 of 1

problem debugging structures/unions in MPLAB

Posted: Mon Feb 06, 2012 4:26 pm
by Jerry Messina
I swear this used to work at one point.

I have a structure with the bits of a byte defined as a union:

Code: Select all

public structure struct_bits_t
    b as byte
    _b7   as b.bits(7)
    _b6   as b.bits(6)
    _b5   as b.bits(5)
    _b4   as b.bits(4)
    _b3   as b.bits(3)
    _b2   as b.bits(2)
    _b1   as b.bits(1)
    _b0   as b.bits(0)
end structure

public dim mb as struct_bits_t

mb.b = 0

mb._b7 = 1
mb._b7 = 0

mb._b0 = 1
mb._b0 = 0

mb.b.7 = 1
mb.b.7 = 0

mb.b.0 = 1
mb.b.0 = 0

mb.b = $ff
All of the generated code is right.

I used to be able to add a 'watch' on the structure and see the individual bits change as I single-step.
I can still see the bits, but MPLAB doesn't seem to be "watching" them correctly... it's displaying the wrong contents.
MPLAB won't let me select the watch properties and change it to a single bit, which I think it used to at one point.

SF 2.2.1.4, MPLAB 8.83, and MPASM 5.43

Tried 2.2.1.3 and MPASM 5.42 with similar results. Is this an MPLAB issue?