Author:admin

Date:2008-09-17T13:53:28.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@3 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
jfiat
2008-09-17 13:53:28 +00:00
parent 4fee9356ea
commit 2ee31ab9c7
763 changed files with 36576 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
[[Property:title|Exploring an application dynamic state]]
[[Property:weight|2]]
To view the dynamic state of a debugged application, just stop it at the point where you want to see its context. The debugger tools will automatically be popped up then, yielding the call stack of the application, as well as the state of the objects located in the object tree, which include at least the object corresponding to the level of the call stack where the call stack cursor [[Image:callstack-active-arrow-icon]] is.
To see at which point the features in the call stack have stopped, just click the feature on which you want this information in the call stack. Doing this will change the cursor position in the call stack and display the flat view of the feature in the context tool.
To follow an object state between pauses of the application, pick and drop it into the object tree, which will make it stay in it.
You can also query features dynamically by using the evaluation tool, which can be very useful to have glimpses of the C memory of the system, for instance.
{{seealso| '''See Also''' <br/>
[[Interrupting an application|Pausing an application]] <br/>
[[Callstack tool: Introduction|Call stack tool]] <br/>
[[Objects tool: Introduction|Object tool]] <br/>
[[Expression evaluation: Introduction|Evaluation tool]] }}

View File

@@ -0,0 +1,14 @@
[[Property:title|Handling exceptions]]
[[Property:weight|4]]
It is possible to raise and catch exceptions in Eiffel. Catching exceptions is done by using the rescue keyword. The [[ref:/libraries/base/reference/exceptions_chart|EXCEPTIONS]] class provides helper features to analyze the caught exception and handle it.
The <eiffel>[[ref:/libraries/base/reference/exceptions_chart|EXCEPTIONS]] </eiffel> class also provides ways to raise exception, via its feature [[ref:libraries/base/reference/exceptions_flatshort|raise]] .
When an exception is raised while the application is being debugged, the application stops immediately and the debugger displays the context in which the exception occurred, whether or not the exception is rescued.
{{seealso| '''See Also''': <br/>
[[8 Design by Contract (tm), Assertions and Exceptions|Reference of exceptions]] }}

View File

@@ -0,0 +1,14 @@
[[Property:title|Running and debugging]]
[[Property:weight|4]]
* [[Running an application|Running an application]]
* [[Interrupting an application|Interrupting an application]]
* [[Exploring an application dynamic state|Exploring an application dynamic state]]
* [[Using breakpoints|Using breakpoints]]
* [[Handling exceptions|Handling exceptions]]
* [[Using debug clauses|Using debug clauses]]
* [[Setting the command line arguments|Setting command line arguments]]
* [[Profiling|Profiling]]

View File

@@ -0,0 +1,17 @@
[[Property:title|Interrupting an application]]
[[Property:weight|1]]
There are two ways a debugged application can be interrupted: its execution can be paused, or it can be killed.
Two methods can be used to pause a debugged application:
* The [[Pause an application]] , located in both the debug menu and the project toolbar.
* Breakpoints, which make it easy to stop the application at a precise point.
To kill a debugged application, use the [[Stop a debugged application]] , located in both the debug menu and the project toolbar.
{{seealso| '''See Also''' <br/>
[[Running an application|Running a program]] <br/>
[[Using breakpoints|Using breakpoints]] }}

View File

@@ -0,0 +1,71 @@
[[Property:title|Profiling]]
[[Property:weight|7]]
The profiler is a tool that gives dynamic execution time information. It is very useful to detect which parts of a program need to be optimized most.
To use the profiler, the first thing to do is to enable it.
To enable the profiler:
* Open the [[General Target Options|Project Settings]] dialog.
* In the '''Target''' section, enable '''Profile'''.
* Click '''OK'''.
* You must [[Generating executables|recompile]] your project for the changes to take effect.
By default the profiler will profile the entire program. However it is possible to enable or disable the profiler on certain clusters only. To do this:
* Open the [[Group Options|Project Settings]] dialog.
* In the '''Clusters''' property, check the '''Profile''' boolean value in the clusters where you want the profiler to be enabled.
* Click '''Apply''' or '''OK'''.
* You must [[Generating executables|recompile]] your project for the changes to take effect.
It is also possible to dynamically start and stop the profiler in a program. To do this:
* Create an object of type [[ref:/libraries/base/reference/profiling_setting_chart|PROFILING_SETTING]] .
* Call [[ref:libraries/base/reference/profiling_setting_flatshort|start_profiling]] on this object to start the profiler.
* Call [[ref:libraries/base/reference/profiling_setting_flatshort|stop_profiling]] on this object to stop the profiler.
{{tip| '''Tip''': To profile only part of a program, turn off the profiler at the very beginning of the program, turn it on just before the part of the code that should be profiled, and turn it back off after this section. Typically, it results in the following code: }}
In the root feature:
<code>
local
ps: PROFILING_SETTING
-- Other local variables if necessary.
do
create ps.make
ps.stop_profiling
-- Real program execution.
ps.start_profiling
end</code>
And in the feature(s) that needs to be profiled:
<code></code>
<code>
local
ps: PROFILING_SETTING
-- Other local variables if necessary.
do
create ps.make
ps.start_profiling
-- What needs to be profiled.
ps.stop_profiling
end</code>
{{note| '''Note''': Even if the profiler should only work in certain sections of code, the '''Profiling''' check box of the [[General Target Options|Projects Settings]] dialog must be checked or the '''profile''' option must be set on certain clusters. }}
Once the profiler has been enabled and the program has been recompiled, it is necessary to launch the program.
{{tip| '''Tip''': It is possible to profile debuggable(frozen/melted) executables as well as finalized ones. It is more interesting to profile finalized executables, though, since the execution speed is more representative of what will be obtained by your end users. }}
When the program exits, a file named 'profinfo' should be generated next to it.
All that's left to do is launch the [[Profiler wizard: Introduction|Profiler wizard]] and follow the instructions.
{{seealso| '''See Also''' <br/>
[[Generating executables|Generating executables]] <br/>
[[Running an application|Running a program]] <br/>
[[Tuning a program|Tuning a program]] }}

View File

@@ -0,0 +1,27 @@
[[Property:title|Running an application]]
[[Property:weight|0]]
There are several ways to launch an application. Not all are available depending on the way you compiled your system.
Melted and frozen executables can be debugged. Several methods can be used to launch such an executable:
* The default [[Run and stop at breakpoints]] . It launches the executable located in the EIFGENs/target_name/W_code directory under the project directory. The execution stops whenever a breakpoint is encountered.
* The [[Run without breakpoints]] . It has the same behavior except that the execution won't stop when a breakpoint is met.
* The step commands, which execute only a small part of the program at a time:
** The [[Step into a feature]] , which tries to enter the feature that is about to be called.
** The [[Execute one line at a time]] , which executes one execution line.
** The [[Step out of a feature]] , which launches the application and stops it as soon as the application exits the feature it is stopped in.
{{tip| '''Tip''': All the above commands can be accessed either in the '''Project''' toolbar or in the '''Debug''' menu. <br/>
They can be used either to launch the program or to resume its execution after it has been paused. }}
* It is also possible to select '''Run to breakpoint''' in a [[Breakpoint editing|breakpoint context menu]] to have the application be launched and executed until it reaches the selected execution line.
Finalized executables can also be run, but they are not debuggable and cannot be interrupted. To run a finalized executable, use the [[Run a finalized executable]] , located in the '''Project''' menu and the '''Project''' toolbar.
{{seealso| '''See Also''' <br/>
[[Generating executables|Compiling an executable]] <br/>
[[Using breakpoints|Using breakpoints]] <br/>
[[Interrupting an application|Interrupting an application]] }}

View File

@@ -0,0 +1,14 @@
[[Property:title|Setting the command line arguments]]
[[Property:weight|6]]
To debug a program that uses command line parameters, it is possible to have the debugger call the generated program with certain command line arguments automatically.
To change the command line arguments used when debugging:
* Open the Debug, Debugging Options Dialog
* In this dialog, you can change the current arguments and also store and load argument sets.
* Click '''OK'''.
{{tip| '''Tip''': To get the command line arguments in a program, it is possible to either define the root feature as taking an array of [[ref:/libraries/base/reference/string_8_chart|STRING_8]] objects, or to use the [[ref:/libraries/base/reference/arguments_chart|ARGUMENTS]] class, which provides a lot of functionality linked with command line arguments. }}

View File

@@ -0,0 +1,14 @@
[[Property:title|Using breakpoints]]
[[Property:weight|3]]
To change the status of one breakpoint, it is possible to use the [[Breakpoint editing|breakpoints menu]] , which changes the state of a single breakpoint at a time.
To change the status of several breakpoints at the same time, the easiest way is to use the [[Breakpoint commands|breakpoints-related commands]] , which have actions at feature-scope, class-scope and system-scope.
{{seealso| '''See Also''' <br/>
[[Running an application|Running an application]] <br/>
[[Interrupting an application|Interrupting an application]] <br/>
[[Breakpoints: Introduction|Breakpoints reference]] }}

View File

@@ -0,0 +1,28 @@
[[Property:title|Using debug clauses]]
[[Property:weight|5]]
Eiffel provides ways to add debug code to features to help during their debugging. You may think of it as the well-known C construct: <code></code>
<code>#ifdef MY_DEBUG_FLAG/* Debug code is here */ #endif</code>
The corresponding construct in Eiffel is provided by the debug keyword. It is possible to wrap code inside a debug clause like this:
<code></code>
<code>
debug("MY_DEBUG_FLAG")
-- Debug code is here.
end</code>
It is then possible to enable or disable debug clauses globally.
To modify the debug clauses status:
* Open the [[Debug Options|Project Settings]] dialog.
* In the '''Debug''' section, you can enable/disable the debug clauses.
* Click '''OK'''.
* You must [[Generating executables|recompile]] your project for the changes to take effect.
{{tip| '''Tip''': Debug clauses make it easy to remove all debug messages when finalizing a system. }}