debug watches

how can i determine if a watch added via the debugger is a reference to an object?

I am in the process of creating a new debug feature and have added the ability to create watches.

I would like to know if I can determine that an evaluated watch is a reference to an object, so that I could add the ability to show the object details in an object inspector (for example).

Unless you are using nextgen compiler (iOS/Android), there is no way to do so, unfortunately. The debug watch is a Variant that holds the pointer to the object in an Integer (or Int64) format, so it just can't distinguish an integer value from the object.