Author:halw

Date:2009-01-25T23:31:24.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@168 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
halw
2009-01-25 23:31:24 +00:00
parent cd2e30a9d3
commit 2e5166fbbd
11 changed files with 138 additions and 75 deletions

View File

@@ -1,12 +1,12 @@
[[Property:title|Debug output]]
[[Property:weight|2]]
[[Property:uuid|41544c3b-e1f1-53a5-ff63-e63224c32fa3]]
In both grids of the [[Object tool|object tool]], objects are displayed. For virtually all objects, it is possible to display a user-definable string value next to the object address.
For virtually any object displayed in the Object tool, it is possible for the developer to cause the Object tool to display a user-definable string value next to the object address.
In order to have the instances of a class display such a string in the object tool, let the class inherit from the class <eiffel>DEBUG_OUTPUT</eiffel>. Then implement the feature <eiffel>debug_output</eiffel> to craft the string for display. At run-time, the debugger will automatically query this feature on all objects that define it, and then will display the results in the object tool and the [[Expression evaluation|evaluation tool]].
In order to have the instances of a class display such a string in the object tool, make the class an heir to class <eiffel>DEBUG_OUTPUT</eiffel>. Then implement the feature <eiffel>debug_output</eiffel> to return the string to be displayed. At run-time, the debugger will automatically query this feature on all objects that define it, and then will display the results in the object tool and the [[Expression evaluation|evaluation tool]].
{{sample|The <eiffel>NUMERIC</eiffel> class inherits from the <eiffel>DEBUG_OUTPUT</eiffel> one so that it is possible to see the value of *_REF objects without expanding them. }}
{{sample|The numeric *<code>_REF</code> classes inherit (through class <eiffel>NUMERIC</eiffel>) from the class <eiffel>DEBUG_OUTPUT</eiffel> so that it is possible to see immediately the value of *<code>_REF</code> objects in the Object tool. The *<code>_REF</code> classes are reference versions of the basic Eiffel classes such as [[ref:/libraries/base/reference/kernel/integer_chart.xml|INTEGER]] and [[ref:/libraries/base/reference/kernel/classic/double_chart.xml|DOUBLE]]. So, without <eiffel>DEBUG_OUTPUT</eiffel>, if you wanted to see, for example, the value of the [[ref:/libraries/base/reference/kernel/integer_chart.xml|INTEGER]] associated with an instance of [[ref:/libraries/base/reference/kernel/integer_ref_chart.xml|INTEGER_REF]] displayed in the Object tool, you would have expand the reference first.}}
{{tip|If an object has a long string output or an output with carriage returns, for instance, pick-and-drop it to the expanded display command [[Image:debugger-expand-info-icon]] in the object tool. }}