Sign in Join
Wiki copytemporary

GDB Debugger Tips: what changed

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

OldNewLine
11## Introduction
22
33Lazarus comes with [[GDB]] as default debugger. From Lazarus 2.0 onwards, this default has changed to LLDB on MacOs.
44
55- This page is for Lazarus 1.0 and newer. For older versions see \[ previous version of this page\]
6-- <u>Note on GDB 7.5</u>: GDB 7.5 is not supported by the released 1.0. Fixes to support it were made in 1.1.
6+- Note on GDB 7.5: GDB 7.5 is not supported by the released 1.0. Fixes to support it were made in 1.1.
77
88## See also
99
1010### Setup (GDB and LLDB)
1111
1212To get the best possible results, you must ensure that your IDE and Project are both correctly configured.
1313
1414See [[Debugger Setup]] how to set up the IDE and your project in order to use the debugger.
1515
1616[Setup Video Tutorial](http://www.youtube.com/watch?v=cf4G06k2YL8)
1717
1818### Other
1919
2020- [[Debugger Console App|Debugging console applications]]
2121- [[Debugger Status|Overview and Status of debugger-backends in Lazarus]]
2222
2323## General
2424
2525### Debug Info Type (GDB and LLDB)
2626
2727> **Note:** Those setting apply only to the project or package to which they are set. If changing settings in either project or package options, it should be ensured that this is done for **all** packages and the project.\
2828> Otherwise your project will have mixed debug info, which can lead to a degraded debug experience.\
2929> The setting can be applied to project and packages using [[IDE Window: Compiler Options|Additions and Overrides]]
3030
31-> **Note:** When compiling <b><u>32Bit</u></b> apps (native or cross) FPC defaults to "Stabs" (At least on some OS). It is recommended to change your configuration to "Dwarf".
31+> **Note:** When compiling 32Bit apps (native or cross) FPC defaults to "Stabs" (At least on some OS). It is recommended to change your configuration to "Dwarf".
3232
3333For 64 bit applications, FPC supports only "Dwarf". (Older FPC also support "Stabs", but that is not recommended)
3434
35-<table>
36-
37-<tr valign="top">
38-
39-<td>
40-
4135### Stabs (only GDB)
4236
43-</td>
44-
45-<td>
46-
4737-g or -gs
4838
4939You should only use if your gdb version does not support dwarf. There are very few other cases where you need it.
5040
5141You may need it with "var param" (param by ref) procedure foo(var a: integer); However the IDE deals with this in 99% of all cases.
5242
5343The LLDB based debugger does not support Stabs
5444
55-</td>
56-
57-</tr>
58-
59-<tr valign="top">
60-
61-<td>
62-
6345#### Dwarf (GDB and LLDB)
6446
65-</td>
66-
67-<td>
68-
6947##### Dwarf 2 (-gw)
7048
7149This sets the format to Dwarf2. This is the most basic dwarf setting.
7250
7351##### Dwarf 2 with sets (-gw -godwarfsets)
7452
7553This setting adds the ability to inspect sets: "type TFoo=set of (a,b,c);". This is borrowed from the Dwarf 3 specs, but supported by most versions of GDB (any GDB from version 7 upwards should do).
7654
7755**`This is the recommended setting.`**` `
7856
7957##### Dwarf 3 (-gw3)
8058
8159Dwarf 3 can encode additional info for some types (such as strings and arrays). It also preserves the case of identifiers in the debug info.
8260
83-However there are still issues with the produced debug info. Some info may be incorrectly encoded, and other is not understood by GDB. In some cases this can lead to <u>gdb crashing</u>. This setting can be used, when using the FpDebug based debugger (add on package for the IDE)
84-
85-</td>
86-
87-</tr>
88-
89-<tr valign="top">
90-
91-<td>
61+However there are still issues with the produced debug info. Some info may be incorrectly encoded, and other is not understood by GDB. In some cases this can lead to gdb crashing. This setting can be used, when using the FpDebug based debugger (add on package for the IDE)
9262
9363#### Differences
9464
95-</td>
96-
97-<td>
98-
9965This list is in no way complete:
10066
10167- dwarf allows some properties (those directly mapped to a field)
10268- stabs (and modern gdb) can do -gp (preserve the case of symbols, instead of getting the all caps stuff).
10369- stabs has problems with some class type casts. The IDE fixes that in some cases. (Only affects gdb 7.0 and up) [1](http://bugs.freepascal.org/view.php?id=19920)
10470
105-</td>
106-
107-</tr>
108-
109-</table>
110-
11171### Inspecting data types (Watch/Hint)
11272
113-<table>
114-
115-<tr valign="top">
116-
117-<td>
118-
11973#### Strings
12074
121-</td>
122-
123-<td>
124-
12575GDB does not know the Pascal string data type. The type information GDB returns does not currently allow for the IDE to differentiate between a PChar (index is 0 based) or a String (index is 1 based).
12676
12777As a Result "mystring\[10\]" could be the 10th char in a string, or 11th in a PChar.
12878
12979Because the IDE cannot be sure which one applies, it will show both. The 2 results will be prefixed String/PChar.
13080
131-</td>
132-
133-</tr>
134-
135-<tr valign="top">
136-
137-<td>
138-
13981#### Properties
14082
141-</td>
142-
143-<td>
144-
14583Currently the debugger does not support any method execution. Therefore only properties that refer directly to a variable can be inspected. (This only works if using dwarf)
14684
14785``` pascal
14886TFoo = Class
14987private
15088 FBar: Integer;
15189 function GetValue: Integer;
15290public
15391 property Bar: Integer read FBar; // Can be inspected (if Dwarf is used)
15492 property Value: Integer read GetValue; // Can *not* be inspected
15593end;
15694```
15795
158-</td>
159-
160-</tr>
161-
162-<tr valign="top">
163-
164-<td>
165-
16696#### Nested Procedures / Function
16797
168-</td>
169-
170-<td>
171-
17298``` pascal
17399procedure SomeObject.Outer(NumText: string);
174100var
175101 OuterVarInScope: Integer;
176102
177103procedure Nested;
178104var
179105 I: Integer;
180106begin
181107 WriteLn(OuterVarInScope);
182108end;
183109
184110var
185111 OuterVarOutsideScope: Integer;
186112
187113begin
188114 Nested;
189115end;
190116```
191117
192118If you step into "Nested", then the IDE allows you to inspect variables from both stack frames.
193119
194120This is you can inspect: I, OuterVarInScope, NumText (without having to change the current stack frame, in the stack window)
195121
196122However there are some caveats:
197123
198124You can also inspect: OuterVarOutsideScope. That is against Pascal scoping rules. This only matters if you have several nested levels, and they all contain a variable of the same name, but the Pascal scoping would hide the variable from the middle frame. Then you get to see the wrong value.
199125
200126You cannot evaluate statements across the 2 frames: "OuterVarnScope-I" does not work.
201127
202128> **Warning:** You may see a wrong value. If there is in any other unit a global (or otherwise visible to GDB scoping rules) variable, with the same name as the local var from the outer frame, then that global var will be shown. There is no warning for that. The safe way is to explicitly select the outer stack frame in which the local var is defined, and check the value.
203129
204-</td>
205-
206-</tr>
207-
208-<tr valign="top">
209-
210-<td>
211-
212130#### Arrays
213131
214-</td>
215-
216-<td>
217-
218132``` pascal
219133array [x..y] of Integer;
220134```
221135
222136shows as chars, instead of int. Only gdb 7.2 or up seems to handle it correctly.
223137
224138Additionally there may be issues when using arrays of (unnamed) records.
225139
226140Dynamic Arrays will only show a limited amount of their data. As of Lazarus 1.1 the limit can be specified.
227141
228-</td>
229-
230-</tr>
231-
232-<table>
233-
234142If Watches/Hint values are not displaying correctly disable REGVARS. Set -OoNOREGVAR in "Custom Options".
235143
236144### Specifying GDB disassembly flavor
237145
238146GDB allows one to specify the assembly flavor (intel or AT&T style) to be used when displaying assembly code. If one wants to change to a specific flavor this can be changed in the AssemblerStyle property in Lazarus's debugger options for GDB (feature available from Lazarus 2.0). Alternatively (and the only way to achieve this from inside Lazarus in older versions before Lazarus 2.0) one can specify this option by passing the *set disassembly-flavor* instruction to [Debugger_Startup_options](/wiki-images/5/5d/Media%3ADbg_setup_options2.png). Several syntax variations can be used (depending on GDB version), a few variations are shown below:
239147
240148` -ex "set disassembly-flavor intel"`\
241149` --eval-command="set disassembly-flavor intel"`\
242150` -eval-command="set disassembly-flavor intel"`\
243151` --eval-command "set disassembly-flavor intel"`
244152
245153Note that it may be necessary to reset the debugger *(Run \| Reset Debugger)* before GDB will load with the new setting.
246154
247155## Windows
248156
249157### Environment and Unicode / None-Latin based locale
250158
251159GDB in combination with Lazarus can have issues, if your environment (such as Username, or PATH, or ...) contain none Latin chars.
252160
253161This is not an issue with any particular GDB version. Rather it depends on how GDB was build. To work correctly under Lazarus GDB needs to have been build using Cygwin.
254162
255163There are several builds available provided by the Lazarus team. Some of them are build with Cygwin. For 64bit: <https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Alternative%20GDB/>
256164
257165For 32bit the builds have not yet been tested. <https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Alternative%20GDB/>
258166
259167### Console output for GUI application
260168
261169On Windows, the IDE does not have the "Debugger - Console output" window. This is because console applications open their own console window. GUI applications by default have no console. In order to have a console for a GUI application, the compiler settings must be changed (Project options / Compiler Options / Config and Target / Win32 Gui Application: -WC / -WG)
262170
263171### Debugging applications with Administrative privileges
264172
265173On Windows Vista+, in Project Options setting the manifest file permissions for the program to "as Administrator" will run the program with Administrator privileges. If your IDE is not running as Administrator, debugging will appear to start ok, the program will show in the tasklist, but its GUI will not show.
266174
267175So please be aware that you have to match privilege level between the IDE (and gdb) and the applicationt to be debugged.
268176
269177## Win 64 bit
270178
271179- Requires Lazarus 1.0+ (with FPC 2.6+)
272180- Advised to use dwarf
273181
274182### Using 32 bit Lazarus on 64 bit Windows
275183
276184Alternatively it is possible to debug applications as 32 bit applications (using the 32bit version of gdb). Once successfully debugged:
277185
278186- the app can then be cross-compiled to 64 bit, or
279187- a 2nd Lazarus installation can be used (using a different configuration --primary-config-path option from the 32 bit Lazarus)
280188
281189When installing the 32 bit Lazarus, ensure you change configuration so the correct 32 bit FPC and GDB are used.
282190
283191### More Win 64 bit problems and solutions
284192
285193See also <http://forum.lazarus.freepascal.org/index.php/topic,13188.0/topicseen.html>
286194
287195## Win CE
288196
289197### Debugger does not find any source files
290198
291199Menu: "Tools" Page: "Debugger"/"Generic" Field: "Additional search path"
292200
293201Put your the drive letter of your project directory in this field.
294202
295203## Linux
296204
297205### Known Problems
298206
299207- There might be issues on at least some CPUs when using an old version of gdb (e.g. SPARC, with gdb 6.4 as supplied by Debian "Etch"). In particular, background threads might lock up even if the program appears to run correctly standalone.
300208- If your program appears to lock up at start up, go to Tools / Options / Debugger / General and set DisableLoadSymbolsForLibraries=True
301209
302210## macOS
303211
304212With the release of macOS 10.14 (Mojave) in 2018, **gdb** was replaced by *[[lldb]]*', and is no longer supported.
305213
306214This section is a first approach to collect information about known issues and workarounds. The information provided here depends a lot on feedback from macOS users.
307215
308216From Lazarus 2.0 onwards the IDE has an LLDB based debugger. The GDB based debugger can also be used, but requires a lot of work building and code-signing the gdb binary and is not supported.
309217
310218### Known Problems (GDB)
311219
312220#### Debugging 32 bit app on 64 bit architecture
313221
314222It is possible and maybe sometime necessary to debug a 32 bit exe on a 64 bit system.
315223
316224This is only possible with Lazarus 0.9.29 rev 28640 and up.
317225
318226#### TimeOuts (64 Bit only)
319227
320228It appears that certain commands are not correctly (or incompletely) processed by gdb 6.3.50. Normally GDB finishes each command with a "\<gdb\>" prompt for the next command. But the version provided by apple sometimes fails to do this. In this case the IDE will have to use a timeout to avoid waiting forever.
321229
322230This has been observed with:
323231
324232- Certain Watch expressions (at least if the watched variable was not available in the current selected function)
325233- Handling an Exception
326234- Inserting breakpoints (past unit end / none code location)
327235
328236It cannot be guaranteed:
329237
330238- that GDB will not later return some results from such a command
331239- that GDB's internal state is still valid
332240
333241The prompt displayed for timeouts can be switched off in the debugger config.
334242
335243Warn On Timeout
336244True/False. Auto continue, after a timeout, do not show a warning.
337245
338246TimeOutForEval
339247Set in milliseconds, how long until a timeout detection is triggered (the detection itself may take some more time.)
340248
341249You may need to "RESET" the debugger after those changes are made
342250
343251More info see here:
344252
345253- [<http://bugs.freepascal.org/view.php?id=19262#c47944>](http://bugs.freepascal.org/view.php?id=19262#c47944)
346254- <http://bugs.freepascal.org/view.php?id=21653>
347255
348256An alternative solution seems to be to use a newer version of GDB (see below).
349257
350258#### Hardware exceptions under macOS
351259
352260When a hardware exception occurs under macOS, such as an invalid pointer access (SIGSEGV) or an integer division-by-zero on Intel processors, the debugger will catch this exception at the Mach level. Normally, the system translates these Mach exceptions into Unix-style signals where the FPC run time library handles them. The debugger is however unable to propagate Mach exceptions in this way.
353261
354262The practical upshot is that it is impossible under macOS to continue a program in the debugger once a hardware exception has been triggered. This is not FPC-specific, and cannot be fixed by us.
355263
356264### Using Alternative Debuggers (GDB)
357265
358266You can install GDB 7.1 (or later) using MacPorts, fink or homebrew.
359267
360268The following observations have been made:
361269
362270- GDB 7.1 seems to have issues with the stabs debug info from fpc.
363271
364272
365-<b>Make sure you select <u>"generate dwarf debug information (-gw)"</u> on the linking tab of the <u>project options</u></b>
273+Make sure you select "generate dwarf debug information (-gw)" on the linking tab of the project options
366274
367275**Watch out for the linker warnings about "unknown stabs"**
368276
369277
370278If you still have problems ensure that no code at all, is compiled with stabs. Your LCL may contain stabs, and this will end up in your app, even if you compile the app with -gw. So you may have to recompile your LCL with -gw (or without any debug info). Same for any other unit, package, rtl, .... that may have stabs
371279
372280**Even with those rules followed, GDB does not always work with fpc compiled apps.**
373281
374282Those observations may be incomplete or wrong, please update them, if you have more information.
375283
376284Lazarus Version 1.0 to 1.0.12
377285
378286In the debugger options configure
379287
380288` EncodeCurrentDirPath = gdfeNone`\
381289` EncodeExeFilename = gdfeNone`
382290
383-And you must use <u>"run param"</u> to specify the actual executable inside the app-bundle ( project.app/Content/MacOS/project or similar)
291+And you must use "run param" to specify the actual executable inside the app-bundle ( project.app/Content/MacOS/project or similar)
384292
385293In Lazarus Version 1.0.14 to 1.2 and up those steps should no longer be required.
386294
387295### Xcode 5
388296
389297Since Mavericks 10.9, Xcode 5 no longer installs gdb by default and not globally.
390298
391299- For 10.9 you can install an old Xcode 4 in parallel. This is not supported by Apple, so it might break with one of the next versions.
392300
393301- You can compile and install gdb. See [[GDB on OS X Mavericks or newer and Xcode 5 or newer]].
394302
395303Please see [issue 25157 on mantis](http://bugs.freepascal.org/view.php?id=25157)
396304
397305- <http://forum.lazarus.freepascal.org/index.php/topic,22529.0.html> - about installing Xcode 4.3
398306- <http://forum.lazarus.freepascal.org/index.php/topic,22328.0.html> - install gdb
399307
400308Thread "\[Lazarus\] Help: macOS Problems" on
401309
402310- <http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-November/thread.html#84126>
403311- <http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-October/thread.html#84095>
404312
405313### Frozen UI with GDB
406314
407315To start a program from the shell you need to run "open \<program1\>.app", direct access to ./program1 will not give you access to the UI. To get gdb working from inside your IDE you have to specify this path as run parameter. Choose from menu Run \> Run parameter and enter the full path at host application. For instance, /User/\<yourid\>/sources/myproject/project1.app/Content/MacOS/project1
408316
409317### Links
410318
411319- macOS comes with a lot of useful tools for debugging and profiling. Just start /Developer/Applications/Instruments.app and try them out.
412320
413321## FreeBSD
414322
415323### FreeBSD 11
416324
417325The system-provided gdb is ancient (version 6.1.1 in FreeBSD 11.4) and does not work well with Lazarus.
418326
419327You can install a newer gdb from the ports tree, e.g.
420328
421329``` bash
422330cd /usr/ports/devel/gdb
423331make -DBATCH install clean
424332```
425333
426334The new gdb is located in "/usr/local/bin/gdb".
427335
428336### FreeBSD 12
429337
430338The system-provided gdb is ancient (version 6.1.1 in FreeBSD 12.3) and it does not work well with Lazarus.
431339
432340You can install a newer gdb from the ports tree, e.g.
433341
434342``` bash
435343cd /usr/ports/devel/gdb
436344make -DBATCH install clean
437345```
438346
439347The new gdb is located in "/usr/local/bin/gdb".
440348
441349It may need the following project option ("Project Options" dialog):
442350
443351- "Use external debug symbols file" is off
444352
445353### FreeBSD 13
446354
447355FreeBSD 13.0 has removed the ancient gdb from the base system and replaced it with [[lldb]].
448356
449357You can still install a recent gdb from the ports tree.
450358
451359## Using a translated GDB (non-English responses from GDB)
452360
453361- This applies only to Lazarus *before* 1.2 or *before* 1.0.14.\
454362 This is no longer needed.
455363
456364The IDE expects responses in English. If GDB is translated this may affect how well the IDE can use it.
457365
458366In many cases it will still work, but with limits, such as:
459367
460368- No Message or Class for exceptions
461369- No live update of threads, while app is running
462370- Debugger error reported, after the app is stopped (at end of debugging)
463371- other ...
464372
465373Please read the entire thread: [[http://forum.lazarus.freepascal.org/index.php/topic,20756.msg120720 http://forum.lazarus.freepascal.org/index.php/topic,20756.msg120720]]
466374
467375Try to run lazarus with
468376
469377` export LANG=en_US.UTF-8`\
470378` lazarus`
471379
472380## Known Problems / Errors reported by the IDE
473381
474-<table>
475-
476-<tr valign="top">
477-
478-<th style="text-align:left">
479-
480382Message    
481383
482-</th>
483-
484-<th style="text-align:left">
485-
486384OS
487385
488-</th>
489-
490-<th style="text-align:left">
491-
492386Description
493387
494-</th>
495-
496-<th style="text-align:left; min-width:40%">
497-
498388 
499389
500-</th>
501-
502-</tr>
503-
504-<tr valign="top">
505-
506-<td colspan="3">
507-
508390### During startup program exited normally
509391
510-</td>
511-
512-<td>
513-
514392 
515393
516-</td>
517-
518-</tr>
519-
520-<tr valign="top">
521-
522-<td>
523-
524394 
525395
526-</td>
527-
528-<td>
529-
530396**All**
531397
532-</td>
533-
534-<td colspan="2">
535-
536398In rare cases the IDE displays the message "During startup program exited normally". This message appears when the debugged application is closed. If this happens no breakpoints in the app will have been triggered, and the app will have run as if no debugger was present.
537399
538400This error can happen for various reasons. There are at least 2 known:
539401
540402- certain position independent exe (PIE) : GDB fails to relocate certain breakpoints that Lazarus uses to start the exe (this is before any user breakpoints are set)
541403- certain dll/so libraries, that define the same symbols as the main exe.
542404
543405There may be more. The 2nd only happens on repeated runs of the debugger.
544406
545407The IDE tries to work around those, but it does not always succeed. It is likely that in cases where it currently fails, this must be worked around by user set config (see below).
546408
547409Even if you can work around, please consider to send a logfile: #Log_info_for_debug_session
548410
549-<b>Ways to work around: (all on the options / debugger page)</b>
411+Ways to work around: (all on the options / debugger page)
550412
551413- In case 2 only: #gdb.exe_has_stopped_working
552414
553415Lazarus 1.2.2 and before
554416go to the debugger options and in the field "debugger_startup_options" enter:\
555417--eval-command="set auto-solib-add off"
556418
557419Lazarus 1.2.4 and higher
558420go to the debugger options and set the field "DisableLoadSymbolsForLibraries" to "True"
559421
560422This can only be used, if you do not debug within libraries (if you have not written your own lib)
561423
562424- In Case 2 only: Check "reset debugger after each run"
563425
564426It will add a very slight increase to the time it takes to start the debugger, as gdb must be reloaded each time.
565427
566428- In all cases:
567429
568430Try any of the values available for "InternalStartBreak" (in the property grid of the options)
569431
570-</td>
571-
572-</tr>
573-
574-<tr valign="top">
575-
576-<td colspan="3">
577-
578432### SIGFPE
579433
580-</td>
581-
582-<td>
583-
584434 
585435
586-</td>
587-
588-</tr>
589-
590-<tr valign="top">
591-
592-<td>
593-
594436 
595437
596-</td>
597-
598-<td>
599-
600438**All**
601439
602-</td>
603-
604-<td colspan="2">
605-
606440SIGFPE is a floating point unit exception.
607441
608442Source: [[http://forum.lazarus.freepascal.org/index.php/topic,21586.0.html forum thread]]
609443
610444SIGFPE exceptions are raised on the next FPU instruction; therefore the error line you get from Lazarus may be off/incorrect.
611445
612446Delphi, and thus Freepascal, have a non standard FPEMask. A lot of C libraries don't use exceptions to check FPU problems but inspect the FPU status.
613447
614448Workaround: try changing the mask with [SetExceptionMask](http://www.freepascal.org/docs-html/rtl/math/setexceptionmask.html) as early as possible in your program:
615449
616450``` pascal
617451uses math;
618452...
619453 SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide,
620454 exOverflow, exUnderflow, exPrecision])
621455```
622456
623457If you think there is something wrong in the FPC code, you can use the [\$SAFEFPUEXCEPTIONS](http://www.freepascal.org/docs-html/prog/progsu69.html) directive. This will add a FWAIT after every store of a FPU value to memory. Most FPC float and double operations end with storing the result somewhere in memory so the outcome is that the debugger stops on the correct FPC line. FWAIT is a nop for the FPU but will cause an exception to be raised immediately instead of somewhere down your code. It is not done per default because it slows down floating point operations a lot.
624458
625-</td>
626-
627-</tr>
628-
629-<tr valign="top">
630-
631-<td colspan="3">
632-
633459### Error 193 (Error creating process / Exe not found)
634460
635-</td>
636-
637-<td>
638-
639461 
640462
641-</td>
642-
643-</tr>
644-
645-<tr valign="top">
646-
647-<td>
648-
649463 
650464
651-</td>
652-
653-<td>
654-
655465**Windows**
656466
657-</td>
658-
659-<td colspan="2">
660-
661467For details see [here](http://bugs.freepascal.org/view.php?id=18238). This issue has been observed under Win XP and appears to be caused by Windows itself. The issue occurs if the path to your app has a space, and a 2nd path/file exists, with a name identical to the part of the path before the space, e.g.:
662468
663469
664470Your app: C:\test folder\project1.exe
665471
666472Some file: C:\test
667473
668-</td>
669-
670-</tr>
671-
672-<tr valign="top">
673-
674-<td colspan="3">
675-
676474### SigSegV - even with new, empty application
677475
678-</td>
679-
680-<td>
681-
682476 
683477
684-</td>
685-
686-</tr>
687-
688-<tr valign="top">
689-
690-<td>
691-
692478 
693479
694-</td>
695-
696-<td>
697-
698480**Windows**
699481
700-</td>
701-
702-<td colspan="2">
703-
704482Note
705-In <u>most</u> cases SigSegV is simply an error in your code.
483+In most cases SigSegV is simply an error in your code.
706484
707485The following applies only, if you get a SigSegv, even with a new empty application (empty form, and no modifications made to unit1).
708486
709487A SigSegV sometimes can be caused by an incompatibility between GDB and some other products. It is not known if this is a GDB issue or caused by the other product. There is no indication that any of the products listed is in any way at fault. The information provided may only apply to some versions of the named products:
710488
711489Comodo firewall
712490<http://forum.lazarus.freepascal.org/index.php/topic,7065.msg60621.html#msg60621>
713491
714492BitDefender
715493enable game mode
716494
717-</td>
718-
719-</tr>
720-
721-<tr valign="top">
722-
723-<td colspan="3">
724-
725495### SigSegV - and continue debugging
726496
727-</td>
728-
729-<td>
730-
731497 
732498
733-</td>
734-
735-</tr>
736-
737-<tr valign="top">
738-
739-<td>
740-
741499 
742500
743-</td>
744-
745-<td>
746-
747501**Windows**, **Mac**
748502
749-</td>
750-
751-<td colspan="2">
752-
753503<http://sourceware.org/bugzilla/show_bug.cgi?id=10004>
754504
755505<http://forum.lazarus.freepascal.org/index.php/topic,18121.msg101798.html#msg101798>
756506
757-</td>
758-
759-</tr>
760-
761-<tr valign="top">
762-
763-<td colspan="3">
764-
765507### On Windows Open/Save/File or System Dialog cause gdb to crash
766508
767509See next entry "gdb.exe has stopped working"
768510
769511Or download the "alternative GDB" 7.7.1 (Win32) from the Lazarus SourceForge site.
770512
771513### "Step over" steps into function (Win 64)
772514
773-</td>
774-
775-<td>
776-
777515 
778516
779-</td>
780-
781-</tr>
782-
783-<tr valign="top">
784-
785-<td>
786-
787517 
788518
789-</td>
790-
791-<td>
792-
793519**Windows 64**
794520
795-</td>
796-
797-<td colspan="2">
798-
799521Sometimes pressing F8 does not step over a function, but steps into it.
800522
801523It is possible to continue with F8, and sometimes GDB will step back into the calling function, after 1 or 2 further steps (stepping over the remainder of the function).
802524
803525In Lazarus 2.0 a workaround was added, but needs to be enabled. Go to Tools \> Options \> Debugger and enable (in the property grid) "FixIncorrectStepOver".
804526
805-<tr valign="top">
806-
807-<td colspan="3">
808-
809527### gdb.exe has stopped working / SigSegv with Open/Close Dlg
810528
811-</td>
812-
813-<td>
814-
815529 
816530
817-</td>
818-
819-</tr>
820-
821-<tr valign="top">
822-
823-<td>
824-
825531 
826532
827-</td>
828-
829-<td>
830-
831533**Windows**
832534
833-</td>
834-
835-<td colspan="2">
836-
837535GDB itself has crashed. This will be due to a bug in gdb, and may not be fixable in Lazarus. Still it may be worth submitting info (see section "Reporting Bugs" below). Maybe Lazarus can avoid calling the failing function.
838536
839537There is one already known situation. GDB (6.6 to 7.4 (latest at the time of testing)) may crash while your app is being started, or right after your app stopped. This happen while the libraries (DLL) for your app are loaded (watch the "[[IDE Window: Debug Output|Debug output]]" window).
840538
841539Lazarus 1.2.2 and before
842540go to the debugger options and in the field "debugger_startup_options" enter:\
843541--eval-command="set auto-solib-add off"
844542
845543Lazarus 1.2.4 and higher
846544go to the debugger options and set the field "DisableLoadSymbolsForLibraries" to "True"
847545
848546This can only be used, if you do not debug within libraries (if you have not written your own lib) ![](/wiki-images/a/a9/Gdb_start_opt_nolib.png)
849547
850-</td>
851-
852-</tr>
853-
854-<tr valign="top">
855-
856-<td colspan="3">
857-
858548### internal-error: clear_dangling_display_expressions
859549
860-</td>
861-
862-<td>
863-
864550 
865551
866-</td>
867-
868-</tr>
869-
870-<tr valign="top">
871-
872-<td>
873-
874552 
875553
876-</td>
877-
878-<td>
879-
880554**Windows, maybe other**
881555
882-</td>
883-
884-<td colspan="2">
885-
886556At the end of the debug session, the debugger reports:
887557
888558`internal-error: clear_dangling_display_expressions: `\
889559`` Assertion `objfile->pspace == solib->pspace' failed. ``
890560
891561This is an error in gdb, and sometimes solved by
892562
893563Lazarus 1.2.2 and before
894564go to the debugger options and in the field "debugger_startup_options" enter:\
895565--eval-command="set auto-solib-add off"
896566
897567Lazarus 1.2.4 and higher
898568go to the debugger options and set the field "DisableLoadSymbolsForLibraries" to "True"
899569
900570This can only be used, if you do not debug within libraries (if you have not written your own lib)
901571
902-</td>
903-
904-</tr>
905-
906-<tr valign="top">
907-
908-<td colspan="3">
909-
910572### "PC register is not available" ("SuspendThread failed. (winerr 5)")
911573
912-</td>
913-
914-<td>
915-
916574 
917575
918-</td>
919-
920-</tr>
921-
922-<tr valign="top">
923-
924-<td>
925-
926576 
927577
928-</td>
929-
930-<td>
931-
932578**Windows**
933579
934-</td>
935-
936-<td colspan="2">
937-
938580GDB may fail with this message. This is due to [<http://sourceware.org/bugzilla/show_bug.cgi?id=14018>](http://sourceware.org/bugzilla/show_bug.cgi?id=14018) If you get this issue you may want to downgrade to GDB 7.2
939581
940-</td>
941-
942-</tr>
943-
944-<tr valign="top">
945-
946-<td colspan="3">
947-
948582### Cannot insert breakpoint
949583
950-</td>
951-
952-<td>
953-
954584 
955585
956-</td>
957-
958-</tr>
959-
960-<tr valign="top">
961-
962-<td>
963-
964586 
965587
966-</td>
967-
968-<td>
969-
970588**All**
971589
972-</td>
973-
974-<td colspan="2">
975-
976-<b>For breakpoints with negative numbers</b> Please see: <http://forum.lazarus.freepascal.org/index.php/topic,10317.msg121818.html#msg121818>
590+For breakpoints with negative numbers Please see: <http://forum.lazarus.freepascal.org/index.php/topic,10317.msg121818.html#msg121818>
977591
978592You may also want to try:
979593
980594Lazarus 1.2.2 and before
981595go to the debugger options and in the field "debugger_startup_options" enter:\
982596--eval-command="set auto-solib-add off"
983597
984598Lazarus 1.2.4 and higher
985599go to the debugger options and set the field "DisableLoadSymbolsForLibraries" to "True"
986600
987601This can only be used, if you do not debug within libraries (if you have not written your own lib)
988602
989-<b>For breakpoints with positive numbers</b> This may happen due to incorrect [[Debugger Setup]]. Ensure smart linking is disabled. It usually means that the breakpoint is in a procedure that is not called, and not included in your exe.
603+For breakpoints with positive numbers This may happen due to incorrect [[Debugger Setup]]. Ensure smart linking is disabled. It usually means that the breakpoint is in a procedure that is not called, and not included in your exe.
990604
991605On Windows, if it happens despite correct setup, then add -Xe (external linker) to the custom options.
992606
993-</td>
994-
995-</tr>
996-
997-</table>
998-
999607## Reporting Bugs
1000608
1001609- Did you verify your [[Debugger Setup]]?
1002610- Did you try Dwarf and Stabs
1003611
1004612### Check existing Reports
1005613
1006614Please check each of the following links
1007615
1008616- [Search Mantis for category "debugger"](http://bugs.freepascal.org/search.php?project_id=0&category=Debugger&status_id%5B%5D=10&status_id%5B%5D=20&status_id%5B%5D=30&status_id%5B%5D=40&status_id%5B%5D=50&status_id%5B%5D=80&sticky_issues=on&sortby=last_updated&dir=DESC&per_page=250&hide_status_id=-2)
1009617- [Search Mantis for text "debugger"](http://bugs.freepascal.org/search.php?project_id=1&search=debugger&category%5B%5D=-&category%5B%5D=Compiler&category%5B%5D=Converter&category%5B%5D=Custom+Drawn&category%5B%5D=Database&category%5B%5D=Database+Components&category%5B%5D=Documentation&category%5B%5D=FCL&category%5B%5D=FPSpreadsheet&category%5B%5D=FV&category%5B%5D=Free+Vision&category%5B%5D=IDE&category%5B%5D=Installer&category%5B%5D=LCL&category%5B%5D=LazDataDesktop&category%5B%5D=LazReport&category%5B%5D=Misc&category%5B%5D=OnGuard&category%5B%5D=Other&category%5B%5D=Packages&category%5B%5D=Patch&category%5B%5D=Printer&category%5B%5D=RTL&category%5B%5D=TAChart&category%5B%5D=Utilities&category%5B%5D=Virtual+Treeview&category%5B%5D=Web+site&category%5B%5D=Website&category%5B%5D=Widgetset&category%5B%5D=glscene&category%5B%5D=lNet&category%5B%5D=rx&status_id%5B%5D=10&status_id%5B%5D=20&status_id%5B%5D=30&status_id%5B%5D=40&status_id%5B%5D=50&status_id%5B%5D=80&sticky_issues=on&sortby=last_updated&dir=DESC&per_page=250&hide_status_id=-2)
1010618- [Search Mantis for text "gdb"](http://bugs.freepascal.org/search.php?project_id=1&search=gdb&category%5B%5D=-&category%5B%5D=Compiler&category%5B%5D=Converter&category%5B%5D=Custom+Drawn&category%5B%5D=Database&category%5B%5D=Database+Components&category%5B%5D=Documentation&category%5B%5D=FCL&category%5B%5D=FPSpreadsheet&category%5B%5D=FV&category%5B%5D=Free+Vision&category%5B%5D=IDE&category%5B%5D=Installer&category%5B%5D=LCL&category%5B%5D=LazDataDesktop&category%5B%5D=LazReport&category%5B%5D=Misc&category%5B%5D=OnGuard&category%5B%5D=Other&category%5B%5D=Packages&category%5B%5D=Patch&category%5B%5D=Printer&category%5B%5D=RTL&category%5B%5D=TAChart&category%5B%5D=Utilities&category%5B%5D=Virtual+Treeview&category%5B%5D=Web+site&category%5B%5D=Website&category%5B%5D=Widgetset&category%5B%5D=glscene&category%5B%5D=lNet&category%5B%5D=rx&status_id%5B%5D=10&status_id%5B%5D=20&status_id%5B%5D=30&status_id%5B%5D=40&status_id%5B%5D=50&status_id%5B%5D=80&sticky_issues=on&sortby=last_updated&dir=DESC&per_page=250&hide_status_id=-2)
1011619- [Search Mantis for text "dwarf"](http://bugs.freepascal.org/search.php?project_id=0&search=dwarf&category%5B%5D=-&category%5B%5D=Compiler&category%5B%5D=Converter&category%5B%5D=Custom+Drawn&category%5B%5D=Database&category%5B%5D=Database+Components&category%5B%5D=Documentation&category%5B%5D=FCL&category%5B%5D=FPSpreadsheet&category%5B%5D=FV&category%5B%5D=Free+Vision&category%5B%5D=IDE&category%5B%5D=Installer&category%5B%5D=LCL&category%5B%5D=LazDataDesktop&category%5B%5D=LazReport&category%5B%5D=Misc&category%5B%5D=OnGuard&category%5B%5D=Other&category%5B%5D=Packages&category%5B%5D=Patch&category%5B%5D=Printer&category%5B%5D=RTL&category%5B%5D=TAChart&category%5B%5D=Utilities&category%5B%5D=Virtual+Treeview&category%5B%5D=Web+site&category%5B%5D=Website&category%5B%5D=Widgetset&category%5B%5D=glscene&category%5B%5D=lNet&category%5B%5D=rx&status_id%5B%5D=10&status_id%5B%5D=20&status_id%5B%5D=30&status_id%5B%5D=40&status_id%5B%5D=50&status_id%5B%5D=80&sticky_issues=on&sortby=last_updated&dir=DESC&per_page=250&hide_status_id=-2)
1012620- [Search Mantis for text "stabs"](http://bugs.freepascal.org/search.php?project_id=0&search=stabs&category%5B%5D=-&category%5B%5D=Compiler&category%5B%5D=Converter&category%5B%5D=Custom+Drawn&category%5B%5D=Database&category%5B%5D=Database+Components&category%5B%5D=Documentation&category%5B%5D=FCL&category%5B%5D=FPSpreadsheet&category%5B%5D=FV&category%5B%5D=Free+Vision&category%5B%5D=IDE&category%5B%5D=Installer&category%5B%5D=LCL&category%5B%5D=LazDataDesktop&category%5B%5D=LazReport&category%5B%5D=Misc&category%5B%5D=OnGuard&category%5B%5D=Other&category%5B%5D=Packages&category%5B%5D=Patch&category%5B%5D=Printer&category%5B%5D=RTL&category%5B%5D=TAChart&category%5B%5D=Utilities&category%5B%5D=Virtual+Treeview&category%5B%5D=Web+site&category%5B%5D=Website&category%5B%5D=Widgetset&category%5B%5D=glscene&category%5B%5D=lNet&category%5B%5D=rx&status_id%5B%5D=10&status_id%5B%5D=20&status_id%5B%5D=30&status_id%5B%5D=40&status_id%5B%5D=50&status_id%5B%5D=80&sticky_issues=on&sortby=last_updated&dir=DESC&per_page=250&hide_status_id=-2)
1013621
1014622### Bugs in GDB
1015623
1016-<table class="wikitable">
1017-
1018-<tr valign="top">
1019-
1020-<th>
1021-
1022624Description
1023625
1024-</th>
1025-
1026-<th>
1027-
1028626OS
1029627
1030-</th>
1031-
1032-<th>
1033-
1034628GDB Version(s)
1035629
1036-</th>
1037-
1038-<th>
1039-
1040630Reference
1041631
1042-</th>
1043-
1044-</tr>
1045-
1046-<tr valign="top">
1047-
1048-<td>
1049-
1050632win64 crash with bad dwarf2 symbols
1051633
1052-</td>
1053-
1054-<td>
1055-
1056634win64
1057635
1058-</td>
1059-
1060-<td>
1061-
1062636GDB 7.4 (maybe higher)
1063637
1064-</td>
1065-
1066-<td>
1067-
1068638<http://sourceware.org/bugzilla/show_bug.cgi?id=14014>
1069639
1070-</td>
1071-
1072-</tr>
1073-
1074-<tr valign="top">
1075-
1076-<td>
1077-
1078640Debuggee doesn't see environment variables set with set environment
1079641
1080-</td>
1081-
1082-<td>
1083-
1084642win
1085643
1086-</td>
1087-
1088-<td>
1089-
1090644Solved in GDB 7.4
1091645
1092-</td>
1093-
1094-<td>
1095-
1096646<http://sourceware.org/bugzilla/show_bug.cgi?id=10989>
1097647
1098-</td>
1099-
1100-</tr>
1101-
1102-<tr valign="top">
1103-
1104-<td>
1105-
1106648Win32 fails to continue with "winerr 5" (pc register not available)\
1107649*apparently* not present in 7.0 to 7.2
1108650
1109-</td>
1110-
1111-<td>
1112-
1113651win
1114652
1115-</td>
1116-
1117-<td>
1118-
1119653GDB 7.3 and up (maybe 6.x too)\
1120654Appears to be fixed in 7.7.1
1121655
1122-</td>
1123-
1124-<td>
1125-
1126656<http://sourceware.org/bugzilla/show_bug.cgi?id=14018>
1127657
1128-</td>
1129-
1130-</tr>
1131-
1132-<tr valign="top">
1133-
1134-<td>
1135-
1136658Wrong array index with dwarf
1137659
1138-</td>
1139-
1140-<td>
1141-
1142660*
1143661
1144-</td>
1145-
1146-<td>
1147-
1148662GDB 7.3 to 7.5 (maybe 7.6.0)\
1149663fixed in 7.6.1
1150664
1151-</td>
1152-
1153-<td>
1154-
1155665<http://sourceware.org/bugzilla/show_bug.cgi?id=15102>
1156666
1157-</td>
1158-
1159-</tr>
1160-
1161-<tr valign="top">
1162-
1163-<td>
1164-
1165667GDB crashes, if trying to inspect or watch resourcestrings\
1166668only tested on win32, not known for other platforms only, if using dwarf
1167669
1168-</td>
1169-
1170-<td>
1171-
1172670*
1173671
1174-</td>
1175-
1176-<td>
1177-
1178672GDB 7.0 to 7.2.xx
1179673
1180-</td>
1181-
1182-<td>
1183-
1184-</td>
1185-
1186-</tr>
1187-
1188-<tr valign="top">
1189-
1190-<td>
1191-
1192674Records (especially: pointer to record) may be mistaken for classes/objects\
1193675The data/values appear to be displayed correct / further tests pending\
1194676This also affect the ability to inspect shortstring\
1195677You can workaround this by manually typecasting.
1196678
1197-</td>
1198-
1199-<td>
1200-
1201679*
1202680
1203-</td>
1204-
1205-<td>
1206-
1207681GDB 7.6.1 and up (tested and failing up to GDB 8.1)
1208682
1209-</td>
1210-
1211-<td>
1212-
1213683<https://sourceware.org/bugzilla/show_bug.cgi?id=16016>
1214684
1215-</td>
1216-
1217-</tr>
1218-
1219-<tr valign="top">
1220-
1221-<td>
1222-
1223685Object variables (Members) of the current methods class (self.xxx) cannot be watched/inspected\
1224686To work around use upper case or prefix with self.
1225687
1226-</td>
1227-
1228-<td>
1229-
1230688*
1231689
1232-</td>
1233-
1234-<td>
1235-
1236690GDB 7.7 up to 7.9.0 (incl)\
1237691Workaround present in Lazarus 1.4 and up
1238692
1239-</td>
1240-
1241-<td>
1242-
1243693<https://sourceware.org/bugzilla/show_bug.cgi?id=17835>
1244694
1245-</td>
1246-
1247-</tr>
1248-
1249-<tr valign="top">
1250-
1251-<td>
1252-
1253695gdb cannot continue after SIGFPE or SIGSEGV happen on windows
1254696
1255-</td>
1256-
1257-<td>
1258-
1259697win
1260698
1261-</td>
1262-
1263-<td>
1264-
1265699*
1266700
1267-</td>
1268-
1269-<td>
1270-
1271701<https://sourceware.org/bugzilla/show_bug.cgi?id=10004>
1272702
1273-</td>
1274-
1275-</tr>
1276-
1277-<tr valign="top">
1278-
1279-<td>
1280-
1281703GDB truncates values for "const x = qword(...)"
1282704
1283-</td>
1284-
1285-<td>
1286-
1287705Win 64 bit\
1288706maybe others
1289707
1290-</td>
1291-
1292-<td>
1293-
1294708Fixed in GDB 7.7 and up, maybe fibed between 7.3 and 7.7
1295709
1296-</td>
1297-
1298-<td>
1299-
1300-</td>
1301-
1302-</tr>
1303-
1304-<tr valign="top">
1305-
1306-<td>
1307-
1308710GDB error for inspecting interfaces (IUnknown etc)
1309711
1310-</td>
1311-
1312-<td>
1313-
1314-</td>
1315-
1316-<td>
1317-
1318712DWARF 3
1319713
1320-</td>
1321-
1322-<td>
1323-
1324714<https://sourceware.org/bugzilla/show_bug.cgi?id=25101>
1325715
1326-</td>
1327-
1328-</tr>
1329-
1330-<tr valign="top">
1331-
1332-<td>
1333-
1334716GDB can not display structures (e.g. class) with dyn array inside
1335717
1336-</td>
1337-
1338-<td>
1339-
1340-</td>
1341-
1342-<td>
1343-
1344718DWARF 3
1345719
1346-</td>
1347-
1348-<td>
1349-
1350720<https://sourceware.org/bugzilla/show_bug.cgi?id=25102>
1351721
1352-</td>
1353-
1354-</tr>
1355-
1356-<tr valign="top">
1357-
1358-<td>
1359-
1360722GDB crash on ^AnsiString
1361723
1362-</td>
1363-
1364-<td>
1365-
1366-</td>
1367-
1368-<td>
1369-
1370724DWARF 3
1371725
1372-</td>
1373-
1374-<td>
1375-
1376726<https://sourceware.org/bugzilla/show_bug.cgi?id=25103>
1377727
1378-</td>
1379-
1380-</tr>
1381-
1382-</table>
1383-
1384728### Issues with GDB 7.5.9 or 7.6
1385729
1386730There are various reports (not confirmed) for different platforms about crashes in gdb 7.5.9 or 7.6.
1387731
1388732It is highly recommended not to use those versions.
1389733
1390734- <http://bugs.freepascal.org/view.php?id=24401>
1391735- <http://forum.lazarus.freepascal.org/index.php/topic,20756.msg120842.html#msg120842>
1392736- <http://sourceware.org/bugzilla/show_bug.cgi?id=15453>
1393737
1394738### Create a new Report (GDB and LLDB)
1395739
1396740If you have at any time in the past updated, changed, reinstalled your Lazarus then please check the "Options" dialog ("Environment" or "Tools" Menu) for the version of GDB and FPC used. They may still point to old settings.
1397741
1398742#### Basic Information
1399743
1400744- Your Operating system and Version
1401-- Your CPU (Intel, Power, ...) <b>32 or 64 bit</b>
745+- Your CPU (Intel, Power, ...) 32 or 64 bit
1402746- Version of
1403747 - Lazarus (Latest Release or SVN revision) (Include setting used to recompile LCL, packages or IDE (if a custom compile Lazarus is used))
1404748 - FPC, if different from default. Please check the "Options" dialog ("Environment" or "Tools" Menu)
1405749 - GDB, please check the "Options" dialog ("Environment" or "Tools" Menu)
1406750- Compiler Settings: (Menu: "Project", "Project Options", indicate all settings you used )
1407751 - Page "Code generation"
1408752
1409753
1410754
1411755Optimization settings (-O???): Level (-O1 / ...) Other (-OR -Ou -Os) (Please always test with all optimizations disabled, and -O1)
1412756
1413757#### Log info for debug session
1414758
1415759
1416760Start Lazarus with the following options:
1417761
1418762` --debug-log=LOG_FILE  --debug-enable=DBG_CMD_ECHO,DBG_STATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DEBUG,DBGMI_TYPE_INFO,DBG_ERRORS`
1419763
1420764:;On Windows: you need to create a shortcut to the Lazarus exe (like the one on Desktop) and edit it's properties. Add " --debug-log=C:\laz.log --debug-enable=..." to the command line.
1421765
1422766:;On Linux: start Lazarus from a shell and append " --debug-log=/home/yourname/laz.log --debug-enable=..." to the command line
1423767
1424768:;On Mac/OSX:start Lazarus from a shell /path/to/lazarus/lazarus.app/Contents/MacOS/lazarus --debug-log=/path/to/yourfiles/laz.log --debug-enable=...
1425769
1426770Attach the log file after reproducing the error.
1427771
1428-If you cannot generate a log file, you may try to open the "Debug output" window (from menu "View" -\> "Ide Internals").<b>You must open this before you run your app (F9)</b>. And then run your app. Once the error occurs, copy, zip, and attach the content of the "debug output" window.
772+If you cannot generate a log file, you may try to open the "Debug output" window (from menu "View" -\> "Ide Internals").You must open this before you run your app (F9). And then run your app. Once the error occurs, copy, zip, and attach the content of the "debug output" window.
1429773
1430774## Running the test-case
1431775
1432776If you run a different version of GDB you may want to run the test case. Please note, that not all tests have yet the correct expectations for each possible setup. Therefore some tests may fail on some systems.
1433777
1434778The debugger test are in the directory:
1435779
1436780- Lazarus 1.2.x: debugger\test\Gdbmi\\
1437781- Lazarus 1.3 and up: components\lazdebuggergdbmi\test\\
1438782
1439783In the below the 1.3 path is used. If using 1.2.x substitute as appropriate.
1440784
1441785One time setup
1442786
1443787Create directory components\lazdebuggergdbmi\test\Logs: Optional, but helps keeping test result in one place
1444788
1445789Create config files: in components\lazdebuggergdbmi\test\\
1446790
1447791
1448792copy fpclist.txt.sample to fpclist.txt
1449793
1450794copy gdblist.txt.sample to gdblist.txt
1451795
1452796open the 2 txt files and edit the path to fpc/gdb, also edit the version (the test may run different test, for different versions). It is possible to specify more than one gdb/fpc
1453797
1454798Running the test
1455799
1456800- Open project: components\lazdebuggergdbmi\test\TestGdbmi.lpi
1457801- Lazarus 1.2.x only: Rebuild the IDE with option "Clean" (Menu Tools: "Configure build IDE" / Restart is not needed). If this is skipped, compilation of the project may fail. Once compilation failed, ALL *.ppu/*.o files in debugger\test must be deleted by hand.
1458802- Run the project (If a test failed, you may have to delete *.exe files in components\lazdebuggergdbmi\test\TestApps
1459803
1460804See also [[Lazarus Debugger Implementation|Lazarus Debugger Implementation#Testcases (Backend)]]
1461805
1462806## Links
1463807
1464808### External Links
1465809
1466810- [Official GDB site](https://www.gnu.org/software/gdb/)
1467811
1468812### Experimental Debuggers in Pascal
1469813
1470814Those are work in progress:
1471815
1472816- <http://sourceforge.net/projects/duby/>
1473817- <https://github.com/graemeg/fpdebug>
1474818- [[FpDebug]] in Lazarus/components/fpdebug and debugger/components/fpgdbmidebugger [blog](http://lazarus-dev.blogspot.co.uk/2014/05/de-bug-wars-new-hope.html) [[FpGdbmiDebugger]], LazDebuggerFpLldb and LazDebuggerFP
1475819
1476820- <http://forum.lazarus.freepascal.org/index.php/topic,22252.0.html>
1477821
1478822### Related forum topics
1479823
1480824- [Issues (crash) with gdb 7.6.2 on arch linux](http://forum.lazarus.freepascal.org/index.php/topic,23221.0.html)
1481825- [About the LLDB based debugger](https://forum.lazarus.freepascal.org/index.php/topic,42869.0.html)
1482826
1483827---
1484828*From the Free Pascal wiki, page "GDB Debugger Tips", as it stood on 2022-05-28 after a change by Trev, 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).*
1485829Category: Debugging

Back to history