Sign in Join
Wiki copytemporary

Debugger Status: what changed

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

Title: Debugger Status

OldNewLine
1+This is based on Lazarus 2.0
2+
3+## Contents
4+
5+ * 1 Available Debuggers
6+ * 2 Availability (OS/Platform)
7+ * 3 Start/Stop
8+ * 4 Execution Control
9+ * 5 Breakpoints / Exceptions
10+ * 6 Data
11+ * 7 Other
12+
13+#### Available Debuggers
14+
15+GNU Debugger (gdb)
16+ The first debugger that was supplied with Lazarus. This debugger uses GDB as backend. The IDE performs translations between gdb's none Pascal-ish interface and the interface provided by the IDE. Package: LazDebuggerGdbmi
17+GNU Debugger through SSH (gdb)
18+ Allows to launch GDB over an ssh connection for remote debugging. This has however some serious limitations. Package: LazDebuggerGdbmi
19+GNU remote debugger (gdbserver)
20+ Remote debugger using GdbServer (part of the gdb suite). Package: LazDebuggerGdbmi
21+LLDB Debugger (Alpha)
22+ A basic LLDB based backend. This is a prove of concept implementation. The IDE displays **raw** LLDB output (no translation, no clean-up...) and there are no plans to add translation of the LLDB output. For using LLDB on Pascal applications the "LLDB Debugger (with fpdebug)" should be used. Package: LazDebuggerLldb
23+LLDB Debugger (with fpdebug)
24+ This debugger uses LLDB as a backend. In order to display Pascal-style results, it uses the "fpdebug" engine to show locals/watches. LLDB is used to control stepping, breakpoint and execution. For reading data LLDB is used to read the raw memory only. Package: LazDebuggerFPLldb
25+[[FpGdbmiDebugger|GNU Debugger (with fpdebug)]]
26+ Using GDB for stepping/breakpoints/... and FpDebug for watches. Package: LazDebuggerFPGdbmi
27+[[FpDebug]] / [[LazDebuggerFp|LazDebuggerFp - integrated Dwarf debugger]]
28+ A new debugger completely implemented in Pascal. This debugger implements the Dwarf standard (currently 2 and 3 are partly implemented). It has special implementations added to interpret info provided by FPC. It can currently be used on Windows and Linux (very basic support for MacOS). Package: LazDebuggerFP
29+
30+[![Note-icon.png](/wiki-images/b/be/Note-icon.png)](</File:Note-icon.png>)
31+
32+**Note:**
33+
34+ * For the [[GDB]] and [LLDB](</index.php?title=LLDB&action=edit&redlink=1> "LLDB \(page does not exist\)") based debugger, support is indicated based on the assumption that your version of GDB supports this. Support indication is generally based on current GDB/LLDB for mainstream OS.
35+ * [[FpDebug|FpDebugger]] currently only works for Windows and Linux
36+ * The "LLDB Debugger (Alpha)" is not included below. It is a by-product of the "LLDB+FpDebug". It is not actively developed/maintained, other than what is needed for "LLDB+FpDebug".
37+
38+#### Availability (OS/Platform)
39+
40+OS/Platform | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
41+---|---|---|---|---|---|---|---
42+Linux | Y | Y | Y | Y | Depends on availability
43+of a stable LLDB | Y |
44+Mac | Depends on availability
45+of a stable
46+and codesigned GDB | ? | ? | ? | Y | N |
47+Windows | Y | Y | Y | Y | Depends on availability
48+of a stable LLDB | Y |
49+
50+
51+
52+#### Start/Stop
53+
54+Feature | Key | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
55+---|---|---|---|---|---|---|---|---
56+Run | F9 | Y | Y | Y | Y | Y | Y |
57+Run to first line (Step) | F7 / F8 | Y | Y | Y | Y | ? | N | For GUI apps the first line is in the code generated by the IDE
58+Run to line at cursor | | Y | Y | Y | Y | N | Y | Lazarus 2.2 and higher
59+Attach | | Y | Y | Y | Y | ? | Lazarus 2.2 and higher |
60+Detach | | Y | Y | Y | Y | ? | Lazarus 2.2 and higher |
61+Stop | Ctrl+F2 | Y | Y | Y | Y | Y | Y |
62+Reset Debugger | | Y | Y | Y | Y | Y | Y | Kill/Stop
63+Restart the external debugger (gdb/lldb)
64+Debugger stopped dialog when app exits | | Y | Y | Y | Y | Y | Y | Configurable
65+Run without debugging | Ctrl+⇧ Shift+F9 | Y | Not debugger specific
66+
67+#### Execution Control
68+
69+Feature | Key | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
70+---|---|---|---|---|---|---|---|---
71+Continue (Run) | F9 | Y | Y | Y | Y | Y | Y |
72+Step over line | F8 | Y | Y | Y | Y | Y | Y |
73+Step into line | F7 | Y | Y | Y | Y | Y | Y |
74+Step (over) to line at cursor | F4 | Y | Y | Y | Y | N | Y | "STEP OVER" - This works only within the current procedure. It will go to the selected line, or stop if the current procedure is left.
75+It will *step* *over* any recursive calls of the procedure, therefore not stopping at the line during recursion.
76+Run to line at cursor | | Y | Y | Y | Y | N | Y | Only Lazarus 2.2 and higher
77+Step out (of current function) | ⇧ Shift+F8 | Y | Y | Y | Y | Y | Y |
78+Step over asm | Alt+F8 | Y | Y | Y | Y | Y | Y |
79+Step into asm | Alt+F7 | Y | Y | Y | Y | Y | Y |
80+Smart source or asm stepping (over/into) | | Y | Y | Y | Y | Y | Y | Assign one key (one for "over", one for "into") that acts as source-line or asm stepping, depending on window focus
81+Pause | | Y | depends on gdb, mostly "No" | Y | Y | Y | Y |
82+Step: steps over "none breaking" breakpoint | | Y | Y | Y | Y | ? | Lazarus 2.0 or 2.2 ? | Any "step" command will continue to its step-end after a "none breaking" Breakpoints. This is a Breakpoint that has its break property turned off. It may record a snapshot, log a message, or enable/disable other breakpoints.
83+[![Warning-icon.png](/wiki-images/b/b2/Warning-icon.png)](</File:Warning-icon.png>) **Warning:** The "auto-continue" (time based) function may not return to stepping, but instead "run/continue" execution.
84+Step: steps over ignored exceptions | | Y | Y | Y | Y | ? | Lazarus 2.2 | Only for standard fpc exception handling. And (Lazarus 2.2) SEH on Win64.
85+Win32 and other OS structured exception handling are not supported (Ignored exceptions will turn Stepping into Running).
86+Source-Step: steps from except to finally or except | | Y | Y | Y | Y | ? | Lazarus 2.2 | Only for standard fpc exception handling. And (Lazarus 2.2) SEH on Win64.
87+Win32 and other OS structured exception handling are not supported (Ignored exceptions will turn Stepping into Running).
88+Executable/Code line indicators | | Y | Y | Y | Y | Y | Y | Blue dots in the gutter indicate lines with debug info.
89+
90+Breakpoints / None-breaking breakpoints / Auto-continue breakpoints / Disabled breakpoints
91+ A breakpoint usually pauses your app, in addition it can perform tasks like logging a message (debugger event log), dumping data to the log, taking a snapshot (debugger history).
92+A none-breaking breakpoint will perform those extra tasks, but not pause your app.
93+An auto-continue breakpoint will pause your app (and perform any other action) for a given amount of milliseconds (during which you can use the pause button, to pause permanently), after that it will continue your app. It usually continues using "Run", therefore loosing any current single-step action
94+A disabled breakpoint will do nothing. It is as if it does not exist.
95+Stepping and breakpoints / exceptions
96+ If any debugger pauses the target-app at a breakpoint or exception while single stepping, then the single-step is lost. The breakpoint/exception may be in a deeply nested called function, and you cannot continue the single-step. I.e. there is no build in way to get back to the function where you started your step, and finish this step. For this you need to go through the callstack yourself and find the start location and use breakpoints
97+Stepping and none-breaking-breakpoints / Ignored-exceptions
98+ Most/All? debugger backends can in this case continue to the position where the single-step would have ended. (This may be limited for asm stepping). In case of an exception the single step will end at the next finally or except. "Next" from the point of view of the step-command. I.e., any finally inside a "stepped over function" will be stepped over, but any finally on the same level as the step began will be used as end point. If there is none on the same level, then the next outer will be used.
99+This feature relies heavily on FPC implementation details. Thus it may not work with newer FPC versions.
100+
101+#### Breakpoints / Exceptions
102+
103+Feature | Key | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
104+---|---|---|---|---|---|---|---|---
105+Breakpoint on Source Line | F5 | Y | Y | Y | Y | Y | Y |
106+Breakpoint on Assembler Line | | Y | Y | Y | Y | Y | Y |
107+Watchpoint / Breakpoint Data | | Y | Y | Y | Y | ? | Partial | Amount/Size is limited by architecture Intel based systems usually have 4 Watchpoints, each with a max size of 32 bit (64 bit on 64bit CPU)
108+Conditional Break/Watch-point | | (Y) | (Y) | (Y) | (Y) | ? | Y | GDB based debuggers are limited to GDB's understanding of the conditional expression
109+Enable/Disable Break/Watch-point according to program flow | | Y | Y | Y | Y | Y | Y | Enable/Disable a breakpoint (or a group of) when execution passes through a pre-defined point in your code. So you can setup that the debugger will only break/skip-breaking, when the code is called in a specific order, or from a specific outer subroutine.
110+Ignore exception by class | | Y | Y | Y | Y | Y | Y | Configurable for each project
111+Break/Watch-point overview Window | Ctrl+Alt+B | Y | Y | Y | Y | Y | Y |
112+TODO: .... Document Breakpoint properties | | . | . | . | . | . | . |
113+TODO: .... Document Breakpoint actions | | . | . | . | . | . | . |
114+
115+GdbMi+Ssh
116+ Some functionality depends on the ability to use "Pause". If "Pause" does not work, break/watch-points can not be changed/added/removed while the target app is running. Only when the target app pauses at a breakpoint (or for other reasons), then can changes be made.
117+
118+#### Data
119+
120+Feature | Key | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
121+---|---|---|---|---|---|---|---|---
122+Watches | Ctrl+Alt+W | Y | Y | Y | Y | Y | Y |
123+Locals | Ctrl+Alt+L | Y | Y | Y | Y | Y | Y |
124+Stack | Ctrl+Alt+S | Y | Y | Y | Y | Y | Y |
125+Threads | Ctrl+Alt+T | Y | Y | Y | Y | Y | Y | Running State indicator may not be accurate
126+Inspect | Alt+F5 | Y | Y | Y | Y | Y | Y | View members in property Grid. Double-click to inspect members
127+Evaluate / Modify | Ctrl+F7 | Y | Y | Y | Y | ? | Only Evaluate
128+No Modify |
129+Disassembler | Ctrl+Alt+D | Y | Y | Y | Y | ? | Partial |
130+Watch/Inspect Class Properties | | N | N | N | N | N | N | Using "DWARF" properties that refer directly to a field (no getter method) are shown.
131+Watch/Inspect Function calls | | N | N | N | N | N | N |
132+Use Instance type/class | | Y | Y | Y | Y | Y | Y | By default the debugger shows variables according to their declared type/class. "Sender: TObject" will only show as TObject.
133+The debugger can detect the real class of the instance (e.g. a TButton) and show all details
134+Tooltip / Hint | | Y | Y | Y | Y | Y | Y |
135+Tooltip / Hint => Auto-deref pointer | | Y | Y | Y | Y | Y | Y |
136+Tooltip / Hint => Use Instance Class | | Y | Y | Y | Y | Y | Y |
137+Paste value into Watches window | | Y | Y | Y | Y | Y | Y | Paste directly into watches window, no need to press "Add new watch"
138+Drag/Drow value from source-editor to Watches window | | Y | Y | Y | Y | Y | Y |
139+TODO: .... Document Watches properties | | . | . | . | . | . | . |
140+
141+
142+#### Other
143+
144+Feature | Key | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
145+---|---|---|---|---|---|---|---|---
146+History | Ctrl+Alt+H | Y | Y | Y | Y | Y | Y | Allow to review Watches/Locals/Stack from when your app was previously paused. This does not restore the state of the application. It only allows to view the value that the debugger evaluated previously.
147+History - Import / Export | | Y | Y | Y | Y | Y | Y |
148+
149+ * Save your debug results for later review.
150+ * Or send them to a co-worker for feedback
151+ * Combined with "snapshot" taking breakpoints, you can send a prepared project (watches/breakpoints set) to a co-worker, have them run the project in the debugger, and return the result to you.
152+
153+
154+Event log | Ctrl+Alt+V | Y | Y | Y | Y | Y | Y |
155+View internal debug output | | Y | Y | Y | Y
156+partly | ? | Not applicable | View communication with the external debugger. For troubleshooting
157+Cross debugging 32<>64bit | | Y | Y | Y | Y
158+Win-64bit IDE can debug 32 bit target | ? | Y
159+Win-64bit IDE can debug 32 bit target |
160+
161+ * Gdb-based: Requires Gdb for target-bitness to be installed, and the "LazGDeBugControl.exe" (included in Lazarus)
162+ * Fp-Debugger: Not tested on Linux / For Windows, requires Lazarus 2.2
163+
164+
165+Remote debugging | | N | Y | Y | N | N | N |
166+Edit source code while debugging | | Y | Y | Y | Y | Y | Y |
167+
168+ * Fully working source editor (with code completion), while debugging
169+ * Editor keeps track of inserted/deleted lines, so breakpoints can be set to correct location
170+
171+---
172+*From the Free Pascal wiki, page "Debugger Status", as the Internet Archive kept it on 2020-11-23, last changed on 2020-10-13. 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