Sign in Join
Wiki copytemporary

IDE Window: Call Stack: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Navigation
22
33[[Main menu|Main Menu]] \> [[Main menu|View]] \> Debug Windows \> Call Stack
44
55## Important
66
77You must [[Debugger Setup|setup the debugger]] and start the project to debug it. Only then this window will be useful.
88
99The output shown on this page is based on the GNU debugger (GDB) which is currently the only debugger Lazarus supports. Its output looks at times like C, not Pascal. Other debuggers may show a more Pascal-like style.
1010
1111## Dialog
1212
1313![](/wiki-images/3/32/Callstack.png)
1414
1515### What is the call stack?
1616
1717The call stack is the stack of function calls. The top line is the current function, the lowest line is the main program.
1818
1919### Source column
2020
2121This column lists the filename of the source file. This information is retrieved from the debug information contained in the executable (or from an external GDB symbol file if you have selected that option). Only those parts of the program explicitly compiled with debug information contain this information.
2222
2323### Line column
2424
2525If the position contains debug information, the source line number will be shown, otherwise only the address pointer in the executable is shown. This line is where the next function was called.
2626
2727**Note**: The line numbering is the numbering at the time the project was last compiled with debug information. If you have subsequently inserted or deleted lines, the numbering will appear to be incorrect.
2828
2929### Function column
3030
3131The mangled name of the procedure or function. The compiler converts Pascal identifiers into names which the gnu tools (designed for C code) can use. For example:
3232
33-` TAPPLICATION__CREATEFORM(0x81fb738, void, (^TAPPLICATION) 0xb7cd0014)`
33+```text
34+ TAPPLICATION__CREATEFORM(0x81fb738, void, (^TAPPLICATION) 0xb7cd0014)
35+```
3436
3537This means:
3638
3739- 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 about classes and objects, the *class.method* is converted to a global function name.
3840- The parameter list depends on the platform and the calling convention. That means the parameter list may be reversed, starting with the rightmost parameter. This is the case in the above example.
3941- The 'Self' parameter is implicit, meaning that you don't write it in the Pascal source, because FPC creates it automatically. This is always the first parameter emitted by the compiler (though invisible in the Pascal source code). Because of the reversed parameter order, Self is shown here as the last parameter. It is of type ^TAPPLICATION and its hexadecimal value is 0xb7cd0014.
4042- The next parameter in Pascal is 'var Reference', which has no type. Therefore it is 'void'.
4143- The last parameter in Pascal is 'InstanceClass: TComponentClass'. Gnu sees this parameter simply as a pointer with the hexadecimal value 0x81fb738.
4244
4345### Tricks
4446
4547Double click on an item to jump to the source.
4648
4749## Toolbar
4850
4951On/Off
5052Enable/Disable updates. Freezes the current content.
5153
5254View Source
5355Jump to selected location in source editor.
5456
5557Current
5658Set the selected frame as source for locals, watches, ...
5759
5860Max \##
5961Set the amount of frames shown in the list
6062
6163More
6264Increases the amount of frames shown in the list
6365
6466Top
6567Set the first shown index to 0
6668
6769Bottom
6870Set the first shown index, so that the bottom of the stack is visible.\
6971E.g. if you show "Max 10" lines, and your app has 55 frames (from the main entry point to the current location), then the window will show frames from index 45 to 54 (54 is the 55th frame - zero based)
7072
7173Edit & Goto selected source line
7274
7375Show the entered index as first frame in the list.\
7476(source line =\> index)
7577
7678Copy all
7779copy to clipboard
7880
7981## Popup menu
8082
8183![](/wiki-images/e/e2/Callstack_popmenu.png)
8284
8385### Show
8486
8587Jump to the current item's source code position.
8688
8789### Set as current
8890
8991Set the selected entry as the current stack frame. Local variables only exist within their own local stack frame. By setting the current frame, you can watch the values of variables in the (local) context of the procedure you have selected.
9092
9193### Copy all
9294
9395Copy the call stack to the clipboard.
9496
9597---
9698*From the Free Pascal wiki, page "IDE Window: Call Stack", as it stood on 2022-09-10 after a change by Martin, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history