# HG changeset patch # User Jan Vrany # Date 1551173270 0 # Node ID 71baafd9bbcbea93c0adecc2a0cc1414a35bfde8 # Parent e7bd05df3d6b154b588daf120e652c567c103810 Clean up `GDBVariable(Object) >> #value` and `#valueString` The distionction was hard to understand, confusing and largelu unnecessary. This commit removes `#valueString` and leaves only `#value` with explanatory comment. diff -r e7bd05df3d6b -r 71baafd9bbcb GDBVariable.st --- a/GDBVariable.st Mon Feb 25 17:55:20 2019 +0000 +++ b/GDBVariable.st Tue Feb 26 09:27:50 2019 +0000 @@ -110,13 +110,29 @@ ! value + "Retun an up-to-date pretty-printed string representation of this variable's value." + | vobj | + "/ The code below tries to avoid creating an varobj if + "/ possible since creation of varobj might be costly. + "/ + "/ THerefore we check whether `value` instvar (cached + "/ string representation) is not nil and varobj is nil + "/ (i.e., has not yet been created). If so, return + "/ cached `value` without creating varobj. Otherwise, + "/ create varobj and ask it for a value. + + varobj == VarobjUnavailable ifTrue:[ ^ value ]. + (varobj isNil and: [value notNil]) ifTrue:[ ^ value ]. + vobj := self varobj. - ^ vobj notNil ifTrue:[ vobj value ] ifFalse: [ value ]. + vobj notNil ifTrue:[ ^ vobj value ]. + + ^ self class classResources string:'' "Created: / 27-02-2015 / 23:37:10 / Jan Vrany " - "Modified: / 05-07-2018 / 12:02:43 / Jan Vrany " + "Modified: / 27-02-2019 / 16:58:43 / Jan Vrany " ! visualizer: aString diff -r e7bd05df3d6b -r 71baafd9bbcb GDBVariableObject.st --- a/GDBVariableObject.st Mon Feb 25 17:55:20 2019 +0000 +++ b/GDBVariableObject.st Tue Feb 26 09:27:50 2019 +0000 @@ -250,12 +250,15 @@ ! value + "Retun an up-to-date pretty-printed string representation of this varobj's value." + changed value. "/ to force update if necessary self isValid ifFalse:[ ^ self class classResources string: '' ]. self inScope ifFalse:[ ^ self class classResources string: '' ]. ^ value "Modified: / 12-02-2018 / 22:00:44 / Jan Vrany " + "Modified (comment): / 25-02-2019 / 14:36:49 / Jan Vrany " ! valueFormatted: aGDBOutputFormat