Difference between revisions of "IDE Window: Call Stack"

From Lazarus wiki
Jump to navigationJump to search
Line 26: Line 26:
 
   TAPPLICATION__CREATEFORM(0x81fb738, void, (^TAPPLICATION) 0xb7cd0014)
 
   TAPPLICATION__CREATEFORM(0x81fb738, void, (^TAPPLICATION) 0xb7cd0014)
  
Means:
+
This means:
  
 
+
* The mangled function name is TAPPLICATION__CREATEFORM, which is the TApplication.CreateForm procedure of the LCL unit forms.pp. Because pascal is case insensitive and the gnu tools are case sensitive, FPC converts the name to uppercase. Because the gnu tools don't know classes and objects, the ''class.method'' is converted to a global function name.
* First comes the function name and its address: TApplication.CreateForm at address 0x81fb738
+
* Then parameter list depends on the platform and the calling convention. That means the parameter list can be reversed, starting with the rightmost parameter. This is the case in the above example.
* Then follows the parameter list. Depending on the platform and the calling convention, the parameters can be ordered reversed.
+
* The 'Self' parameter is implicit. That means, you don't write it in the pascal source, and FPC creates it automatically. This is always the first parameter. Because of the reverse order, it is shown as the last parameter. It is of type ^TAPPLICATION and its hexadecimal value is 0xb7cd0014.
* 'void' means a parameter without type. Here: ''var Reference''
+
* The next parameter in pascal is 'var Reference', which has no type. Therefore it is 'void'.
* (^TAPPLICATION) 0xb7cd0014
+
* The last parameter in pascal is 'InstanceClass: TComponentClass'. The parameter is on gnu level just a pointer and has the hexadecimal value 0x81fb738.

Revision as of 16:26, 17 July 2006

Important

This page is under construction. It may contain wrong information and must be confirmed/repaired by Marc.

You must setup the debugger and start the project to debug it. Only then the breakpoints are useful.

What is the call stack?

The call stack is the stack of function calls. The top line is the current function, the lowest line is the main program.

Source

This is the filename of the source. This information is retrieved from the debugging information contained in the executable. Only those parts of the program compiled with gnu debugger information contains such information.

Line

If the position contains gnu debugger information, the source line will be shown, otherwise only the address pointer in the executable is shown.

Note: The line is the line at compile time. If you inserted/deleted lines, they will not be accurate.

Function

The mangled name of the procedure/function. The compiler converts the pascal identifiers into names, useable by the gnu tools. For example:

 TAPPLICATION__CREATEFORM(0x81fb738, void, (^TAPPLICATION) 0xb7cd0014)

This means:

  • The mangled function name is TAPPLICATION__CREATEFORM, which is the TApplication.CreateForm procedure of the LCL unit forms.pp. Because pascal is case insensitive and the gnu tools are case sensitive, FPC converts the name to uppercase. Because the gnu tools don't know classes and objects, the class.method is converted to a global function name.
  • Then parameter list depends on the platform and the calling convention. That means the parameter list can be reversed, starting with the rightmost parameter. This is the case in the above example.
  • The 'Self' parameter is implicit. That means, you don't write it in the pascal source, and FPC creates it automatically. This is always the first parameter. Because of the reverse order, it is shown as the last parameter. It is of type ^TAPPLICATION and its hexadecimal value is 0xb7cd0014.
  • The next parameter in pascal is 'var Reference', which has no type. Therefore it is 'void'.
  • The last parameter in pascal is 'InstanceClass: TComponentClass'. The parameter is on gnu level just a pointer and has the hexadecimal value 0x81fb738.