Sign in Join
Wiki copytemporary

Debugger Status: what changed

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

OldNewLine
11This is based on Lazarus 2.0
22
3-## Contents
3+#### Available Debuggers
44
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
5+**GNU Debugger (gdb)**
126
13-#### Available Debuggers
7+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
148
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
9+**GNU Debugger through SSH (gdb)**
2910
11+Allows to launch GDB over an ssh connection for remote debugging. This has however some serious limitations. Package: LazDebuggerGdbmi
12+
13+**GNU remote debugger (gdbserver)**
14+
15+Remote debugger using GdbServer (part of the gdb suite). Package: LazDebuggerGdbmi
16+
17+**LLDB Debugger (Alpha)**
18+
19+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
20+
21+**LLDB Debugger (with fpdebug)**
22+
23+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
24+
25+**[[FpGdbmiDebugger|GNU Debugger (with fpdebug)]]**
26+
27+Using GDB for stepping/breakpoints/... and FpDebug for watches. Package: LazDebuggerFPGdbmi
28+
29+**[[FpDebug]] / [[LazDebuggerFp|LazDebuggerFp - integrated Dwarf debugger]]**
30+
31+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
32+
3033[![Note-icon.png](/wiki-images/b/be/Note-icon.png)](</File:Note-icon.png>)
3134
3235**Note:**
3336
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.
37+ * For the [[GDB]] and [[LLDB]] 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.
3538 * [[FpDebug|FpDebugger]] currently only works for Windows and Linux
3639 * 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".
3740
3841#### Availability (OS/Platform)
3942
4043OS/Platform | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
4144---|---|---|---|---|---|---|---
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 |
45+Linux | Y | Y | Y | Y | Depends on availability · of a stable LLDB | Y |
46+Mac | Depends on availability · of a stable · and codesigned GDB | ? | ? | ? | Y | N |
47+Windows | Y | Y | Y | Y | Depends on availability · of a stable LLDB | Y |
4948
5049
5150
5251#### Start/Stop
5352
5453Feature | Key | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
5554---|---|---|---|---|---|---|---|---
5655Run | F9 | Y | Y | Y | Y | Y | Y |
5756Run 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
5857Run to line at cursor | | Y | Y | Y | Y | N | Y | Lazarus 2.2 and higher
5958Attach | | Y | Y | Y | Y | ? | Lazarus 2.2 and higher |
6059Detach | | Y | Y | Y | Y | ? | Lazarus 2.2 and higher |
6160Stop | 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)
61+Reset Debugger | | Y | Y | Y | Y | Y | Y | Kill/Stop · Restart the external debugger (gdb/lldb)
6462Debugger stopped dialog when app exits | | Y | Y | Y | Y | Y | Y | Configurable
6563Run without debugging | Ctrl+⇧ Shift+F9 | Y | Not debugger specific
6664
6765#### Execution Control
6866
6967Feature | Key | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
7068---|---|---|---|---|---|---|---|---
7169Continue (Run) | F9 | Y | Y | Y | Y | Y | Y |
7270Step over line | F8 | Y | Y | Y | Y | Y | Y |
7371Step 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.
72+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. · It will *step* *over* any recursive calls of the procedure, therefore not stopping at the line during recursion.
7673Run to line at cursor | | Y | Y | Y | Y | N | Y | Only Lazarus 2.2 and higher
7774Step out (of current function) | ⇧ Shift+F8 | Y | Y | Y | Y | Y | Y |
7875Step over asm | Alt+F8 | Y | Y | Y | Y | Y | Y |
7976Step into asm | Alt+F7 | Y | Y | Y | Y | Y | Y |
8077Smart 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
8178Pause | | 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).
79+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. · [![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.
80+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. · Win32 and other OS structured exception handling are not supported (Ignored exceptions will turn Stepping into Running).
81+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. · Win32 and other OS structured exception handling are not supported (Ignored exceptions will turn Stepping into Running).
8882Executable/Code line indicators | | Y | Y | Y | Y | Y | Y | Blue dots in the gutter indicate lines with debug info.
8983
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).
84+**Breakpoints / None-breaking breakpoints / Auto-continue breakpoints / Disabled breakpoints**
85+
86+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).
9287A none-breaking breakpoint will perform those extra tasks, but not pause your app.
9388An 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
9489A 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.
90+
91+**Stepping and breakpoints / exceptions**
92+
93+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
94+
95+**Stepping and none-breaking-breakpoints / Ignored-exceptions**
96+
97+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.
9998This feature relies heavily on FPC implementation details. Thus it may not work with newer FPC versions.
10099
101100#### Breakpoints / Exceptions
102101
103102Feature | Key | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
104103---|---|---|---|---|---|---|---|---
105104Breakpoint on Source Line | F5 | Y | Y | Y | Y | Y | Y |
106105Breakpoint 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)
106+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)
108107Conditional 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.
108+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.
110109Ignore exception by class | | Y | Y | Y | Y | Y | Y | Configurable for each project
111110Break/Watch-point overview Window | Ctrl+Alt+B | Y | Y | Y | Y | Y | Y |
112111TODO: .... Document Breakpoint properties | | . | . | . | . | . | . |
113112TODO: .... Document Breakpoint actions | | . | . | . | . | . | . |
114113
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.
114+**GdbMi+Ssh**
117115
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+
118118#### Data
119119
120120Feature | Key | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
121121---|---|---|---|---|---|---|---|---
122122Watches | Ctrl+Alt+W | Y | Y | Y | Y | Y | Y |
123123Locals | Ctrl+Alt+L | Y | Y | Y | Y | Y | Y |
124124Stack | Ctrl+Alt+S | Y | Y | Y | Y | Y | Y |
125125Threads | Ctrl+Alt+T | Y | Y | Y | Y | Y | Y | Running State indicator may not be accurate
126126Inspect | 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 |
127+Evaluate / Modify | Ctrl+F7 | Y | Y | Y | Y | ? | Only Evaluate · No Modify |
129128Disassembler | Ctrl+Alt+D | Y | Y | Y | Y | ? | Partial |
130129Watch/Inspect Class Properties | | N | N | N | N | N | N | Using "DWARF" properties that refer directly to a field (no getter method) are shown.
131130Watch/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
131+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. · The debugger can detect the real class of the instance (e.g. a TButton) and show all details
134132Tooltip / Hint | | Y | Y | Y | Y | Y | Y |
135133Tooltip / Hint => Auto-deref pointer | | Y | Y | Y | Y | Y | Y |
136134Tooltip / Hint => Use Instance Class | | Y | Y | Y | Y | Y | Y |
137135Paste value into Watches window | | Y | Y | Y | Y | Y | Y | Paste directly into watches window, no need to press "Add new watch"
138136Drag/Drow value from source-editor to Watches window | | Y | Y | Y | Y | Y | Y |
139-TODO: .... Document Watches properties | | . | . | . | . | . | . |
140-
137+TODO: .... Document Watches properties | | . | . | . | . | . | . |
141138
142139#### Other
143140
144141Feature | Key | GdbMi | GdbMi+Ssh | GdbServer | GdbMi+FpDebug | Lldb+FpDebug | Fp-Debugger | Comments
145142---|---|---|---|---|---|---|---|---
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-
143+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.
144+History - Import / Export | | Y | Y | Y | Y | Y | Y | Save your debug results for later review. · Or send them to a co-worker for feedback · 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.
154145Event 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-
146+View internal debug output | | Y | Y | Y | Y · partly | ? | Not applicable | View communication with the external debugger. For troubleshooting
147+Cross debugging 32<>64bit | | Y | Y | Y | Y · Win-64bit IDE can debug 32 bit target | ? | Y · Win-64bit IDE can debug 32 bit target | Gdb-based: Requires Gdb for target-bitness to be installed, and the "LazGDeBugControl.exe" (included in Lazarus) · Fp-Debugger: Not tested on Linux / For Windows, requires Lazarus 2.2
165148Remote 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
149+Edit source code while debugging | | Y | Y | Y | Y | Y | Y | Fully working source editor (with code completion), while debugging · Editor keeps track of inserted/deleted lines, so breakpoints can be set to correct location
170150
171151---
172152*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