Community
Participate
Working Groups
When we use the "display as array" on a non-pointer, we ask gdb to read memory from something that is not an address and it fails. CDI does the same. We can solve this in two ways: 1- only allow Display As Array on pointers (disable if not a pointer) 2- when not a pointer, use the address of the non-pointer instead EDC uses solution #2, but I am not clear if it is a useful thing to do. See bug 306555 comment #24
CDI first checks whether the selected variable is a pointer type, and disables the action "display as array" on non-pointer types. Can we do the same in DSF? The base interface for a variable in both CDI and DSF is the same, i.e. ICastToArray. In DSF, the method canCastToArray() should return true only if gdb reports that this variable is a pointer type. Have attached a patch to the DsfCastToTypeSupport which provides this functionality. Due to this patch, the action "display as array" is now visible only on pointer type variables (as reported by gdb).
Created attachment 205681 [details] "Display as array" should be visible only for pointer type variables