The Enum variable is supposedly displayed in "Hex", I expected the value to be $FFFFFFFF not -$1 which is basically a decimal value (an interpretation of the hex value $FFFFFFFF).
There is a checkbox (at the end of the radio row) "Unsigned".
I couldn't find docs, but looking through compiler sources it seems that enum are treated as signed.
For numbers there is signedness=auto, which does 2 things: check the type of the variable, and if it is signed, then decide based on dec vs hex.
I didn't add an "auto" for enum, as I considered it less important. So you have to explicitly change it for hex.
I did consider having the full auto/signed/unsigned choice if you switch to the "enum tab" => but then again, I considered it low value, and adding confusion by having another meaning of the "unsigned CHECKBOX" being greyed.
It can currently already be greyed for 2 reason (well one implemented, one planed)
- You select enum and bool, and they have different settings
- You edit settings for several watches at the same time (planed) // You can already edit defaults for locals and watches at the same time
Another thing I may not be understanding correctly is, when the "Name" radio button is selected then only the variable name is displayed, its value is no longer displayed. I don't see how just seeing the variable name without an associated value is useful. Am I missing something there ?
I think it is useful in many cases.
Usually if I look at "Form1.align" and it says clClient => that is all I need. I don't need to know the ordinal value of alClient.
I did just check, and it is however broken => if the value is out of range (and has no name) then it ought to still give a number. (using the default format), something like TAlign(123). That it currently gives empty => bug.
--- EDIT: fixed That also leaves the question, if in case of "both" it should then say "TAlign(123) = $7B" or just "$7B". I think the first.
A short off topic: Such out of range values only should happen as a result of bugs in code. Otherwise the resulting behaviour is undefined (and can change with new versions of fpc). You setting it explicitly to -1 should never be coded... Currently at least "case of {all enum} else" may not enter that "else" block).
And lastly there is a difference between watching an enum-variable and an enum-identifier.
If you watch "e1" => then just name indeed makes no sense. => But I did not add a separate setting for enum-ident in the watch properties => so the option is still shown. And because it is shown there, it is shown everywhere. In the global presets you can give different presets for "enum identifier".
I also still have to check some details when using this with boolean. That is, if the debug info provides enough info...
There is
- bytebool, longbool...
- boolean8, boolean32...
And one of those only has True=1 and False=0 and all others are not true, nor false.
The other has True= anything but 0.
I may be missing something again but, in the snapshot, the presence of the "=" sign seems of little use.
Its just a separator between the 2 forms of the value.
How else to separate them?
Note this is also used in other places, e.g. when you have colors displayed as name: clRed = $.......
Just got the idea that "set of enum" may need a "bitmap" mode. Instead of displaying the list of enum (name or number), show the bitmap as hex or bin.