You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use case is: being in the debugger, stepping through native code, having instances of XxxByReference, e.g. IntByReference. In this case it is in the debugger hard to get the value of the referenced Xxx, since the toString() offered by the instance is inherited from PointerType. So the information one gets offers a lot of information on the internal layout of the referenced object, but it is very hard to simply find the actual value.
We work around this inconvenience regularly by adding temporary code like
IntByReference theInteger = new IntByReference( 313 );
... // Call system api use and modify 'theInteger'.
// Get 'theInteger's value into a local variable.
int tmp = theInteger.getValue();
... // And on it goes.
The proposal is to add a toString()-operation to the XxxByReference-classes in the com.sun.jna.ptr package, each displaying the respective value in hex format. The hex format has the advantage that the sign bits are explicitly visible.
Impact on existing code
As far as we can see this would have no negative consequences, since the object layout of an IntByReference is clear and has no potential for errors if JNA is implemented properly.
The positive consequence is that the value is visible in the debugger on the first glance, without any hassle.
The operation can be implemented as common code so that the functionality is available on all platforms.
This is a request for a new feature.
Description
The use case is: being in the debugger, stepping through native code, having instances of XxxByReference, e.g. IntByReference. In this case it is in the debugger hard to get the value of the referenced Xxx, since the toString() offered by the instance is inherited from PointerType. So the information one gets offers a lot of information on the internal layout of the referenced object, but it is very hard to simply find the actual value.
We work around this inconvenience regularly by adding temporary code like
The proposal is to add a
toString()
-operation to theXxxByReference
-classes in thecom.sun.jna.ptr
package, each displaying the respective value in hex format. The hex format has the advantage that the sign bits are explicitly visible.Impact on existing code
As far as we can see this would have no negative consequences, since the object layout of an IntByReference is clear and has no potential for errors if JNA is implemented properly.
The positive consequence is that the value is visible in the debugger on the first glance, without any hassle.
The operation can be implemented as common code so that the functionality is available on all platforms.
References
The text was updated successfully, but these errors were encountered: