Difference between revisions of "GDB Debugger Tips/ru"
Line 220: | Line 220: | ||
= Linux = | = Linux = | ||
− | == | + | == Известные проблемы == |
− | * | + | * При использовании старой версии GDB могут возникнуть проблемы, по крайней мере, на некоторых процессорах (например, SPARC, с GDB 6.4, поставляемой Debian "Etch"). В частности, фоновые потоки могут блокироваться, даже если программа работает нормально автономно. |
− | * | + | * Если ваша программа блокируется при запуске, перейдите в Tools(Сервис) / Options(Настройки) / Debugger(Отладчик) / General(Общее) и установите <tt>DisableLoadSymbolsForLibraries=True</tt> |
= Mac OS X = | = Mac OS X = |
Revision as of 15:24, 13 June 2019
Вступление
Lazarus поставляется с GDB в качестве отладчика по умолчанию. Начиная с Lazarus 2.0, это значение по умолчанию изменилось на LLDB на MacO.
- Эта страница для Lazarus 1.0 и новее. Для более старых версий см. предыдущая версия этой страницы
- Примечание по GDB 7.5: GDB 7.5 не поддерживается выпущенной версией 1.0. Исправления для поддержки были сделаны в 1.1.
См.также
Установка (GDB и LLDB)
Чтобы получить наилучшие результаты, вы должны убедиться, что ваша IDE и Project правильно настроены.
См. раздел установка отладчика, чтобы настроить IDE и ваш проект для использования отладчика.
Другое
Debugging console applications
Основное
Тип отладочной информации (GDB и LLDB)
Примечание: Эти настройки применяются только к проекту или пакету, для которого они установлены. Если вы изменяете настройки в любом из параметров проекта или пакета, следует убедиться, что это сделано для всех пакетов и проекта.
В противном случае ваш проект будет иметь смешанную информацию отладки, что может привести к ухудшению процесса отладки.
Для 64-битных приложений FPC поддерживает только "Dwarf". (Старые FPC также поддерживают "Stabs", но это не рекомендуется)
Stabs (только GDB) |
-g или -gs Вы должны использовать только если ваша версия GDB не поддерживает [режим] dwarf. Есть очень мало других случаев, когда вам это нужно. Вам может понадобиться это [в случае использования] «var param» (param by ref): procedure foo(var a: integer); Однако IDE имеет дело с этим в 99% всех случаев. Отладчик на основе LLDB не поддерживает [режим] Stabs |
Dwarf (GDB и LLDB) |
Dwarf 2 (-gw)Это устанавливает формат в Dwarf2. Это самая основная настройка dwarf. Dwarf 2 с наборами (-gw -godwarfsets)Этот параметр добавляет возможность проверки наборов: "type TFoo=set of (a,b,c);". Это заимствовано из спецификаций Dwarf 3, но поддерживается большинством версий GDB (любой GDB начиная с версии 7 и выше должен это делать). Это рекомендуемая настройка. Dwarf 3 (-gw3)Dwarf 3 может кодировать дополнительную информацию для некоторых типов (таких как строки и массивы). Это также сохраняет регистр идентификаторов в отладочной информации. Однако все еще есть проблемы с произведенной отладочной информацией. Некоторая информация может быть неправильно закодирована, а другая не понята GDB. В некоторых случаях это может привести к падению gdb. Этот параметр можно использовать при использовании отладчика на основе FpDebug (добавить пакет для IDE)
|
Различия |
Этот список никоим образом не полон:
|
Проверка типов данных (Watch/Hint)
Строки |
GDB не знает тип данных строк Паскаля. Информация о типе, которую возвращает GDB, в настоящее время не позволяет IDE различать PChar (индекс равен 0) и строку (индекс равен 1). В результате "mystring[10]" может быть 10-ым символом в строке или 11-м в PChar Поскольку среда IDE не может быть уверена, какая из них применима, она покажет оба варианта. 2 результата будут иметь префикс String/PChar. |
Свойства |
В настоящее время отладчик не поддерживает выполнение каких-либо методов. Поэтому могут быть проверены только те свойства, которые относятся непосредственно к переменной. (Это работает только при использовании dwarf). TFoo = Class
private
FBar: Integer;
function GetValue: Integer;
public
property Bar: Integer read FBar; // Может быть проверено (если используется Dwarf)
property Value: Integer read GetValue; // *Не* может быть проверен
end; |
Вложенные процедуры / функции |
procedure SomeObject.Outer(NumText: string);
var
OuterVarInScope: Integer;
procedure Nested;
var
I: Integer;
begin
WriteLn(OuterVarInScope);
end;
var
OuterVarOutsideScope: Integer;
begin
Nested;
end; Если вы входите в «Nested», то IDE позволяет вам проверять переменные из обоих стековых фреймов. Это вы можете проверить: I, OuterVarInScope, NumText (без необходимости изменять текущий фрейм стека, в окне стека) Однако есть несколько оговорок: Вы также можете проверить: OuterVarOutsideScope. Это против правил определения границ Паскаля. Это имеет значение, только если у вас есть несколько вложенных уровней, и все они содержат переменную с тем же именем, но область видимости Паскаля скрыла бы переменную из среднего фрейма. Тогда вы увидите неправильное значение. Вы не можете оценить операторы по 2 фреймам: «OuterVarnScope-I» не работает. Предупреждение: Вы можете увидеть неправильное значение. Если в любом другом модуле есть глобальная (или иным образом видимая для правил области действия GDB) переменная с тем же именем, что и локальная переменная из внешнего фрейма, будет показана эта глобальная переменная. Там нет никакого предупреждения для этого. Безопасным способом является явный выбор внешнего стекового фрейма, в котором определен локальный var, и проверка значения.
|
Массивы |
array [x..y] of Integer; показывает как символы, а не int. Только GDB 7.2 или выше, кажется, справиться с этим правильно. Кроме того, могут возникнуть проблемы при использовании массивов (неназванных) записей. Динамические массивы будут показывать только ограниченный объем своих данных. Начиная с Lazarus 1.1, предел может быть указан. |
Указание GDB вида сборки
GDB позволяет указать вид сборки (стиль Intel или AT&T), который будет использоваться при отображении кода сборки. Если кто-то хочет перейти на конкретный вариант, это можно изменить в свойстве AssemblerStyle в параметрах отладчика Lazarus для GDB (функция доступна в Lazarus 2.0). Альтернативно (и единственный способ добиться этого внутри Lazarus в более старых версиях до Lazarus 2.0) можно указать эту опцию, передав команду set disassembly-flavor в Debugger_Startup_options. Можно использовать несколько вариантов синтаксиса (в зависимости от версии GDB), некоторые из которых показаны ниже:
-ex "set disassembly-flavor intel"
--eval-command="set disassembly-flavor intel"
-eval-command="set disassembly-flavor intel"
--eval-command "set disassembly-flavor intel"
Обратите внимание, что может потребоваться сбросить отладчик (Run | Reset Debugger) перед загрузкой GDB с новой настройкой.
Windows
Консольный вывод для GUI-приложений
В Windows в среде IDE нет окна «Отладчик - вывод на консоль». Это потому, что консольные приложения открывают свое собственное окно консоли. Приложения с графическим интерфейсом по умолчанию не имеют консоли. Чтобы иметь консоль для приложения с графическим интерфейсом, необходимо изменить настройки компилятора (Project options(Параметры проекта) / Compiler Options(Параметры компилятора) / Config and Target(Настройка и целевая платформа) / Win32 Gui Application(Графическое приложение Win32): -WC / -WG)
Отладка приложений с правами Администратора
В Windows Vista+ в разделе Project Options(Параметры проекта) при установке разрешений в файле манифеста для программы «от имени Администратора» программа будет запускаться с правами администратора. Если ваша IDE запущена не от имени Администратора, отладка будет запускаться нормально, программа будет отображаться в списке задач, но ее графический интерфейс не будет отображаться.
Поэтому имейте в виду, что вы должны сопоставить уровень привилегий между IDE (и gdb) и приложением, которое необходимо отладить.
Win 64 bit
- Требуется Lazarus 1.0+ (с FPC 2.6+)
- Рекомендуется использовать dwarf
Использование 32-битного Lazarus на 64-битной Windows
В качестве альтернативы можно отлаживать приложения как 32-разрядные приложения (используя 32-разрядную версию GDB). После успешной отладки:
- приложение может быть кросс-скомпилировано до 64 бит или
- можно использовать 2-ую установку Lazarus (используя другую конфигурационную опцию --primary-config-path из 32-битной Lazarus)
При установке 32-битного Lazarus убедитесь, что вы изменили конфигурацию, чтобы использовались правильные 32-битные FPC и GDB.
Больше проблем и решений Win 64 bit
См. также http://forum.lazarus.freepascal.org/index.php/topic,13188.0/topicseen.html
Win CE
Отладчик не находит никаких исходных файлов
Меню: "Tools"(Сервис) Страница: "Debugger"/"Generic" (Отладчик/Общее) Поле: "Additional search path" (Дополнительный путь поиска)
Введите в это поле букву вашего каталога проекта.
Linux
Известные проблемы
- При использовании старой версии GDB могут возникнуть проблемы, по крайней мере, на некоторых процессорах (например, SPARC, с GDB 6.4, поставляемой Debian "Etch"). В частности, фоновые потоки могут блокироваться, даже если программа работает нормально автономно.
- Если ваша программа блокируется при запуске, перейдите в Tools(Сервис) / Options(Настройки) / Debugger(Отладчик) / General(Общее) и установите DisableLoadSymbolsForLibraries=True
Mac OS X
Under OS X you usually install GDB with the Apple developer tools. The version of GDB available at the time of writing is 6.3.50
This section is a first approach to collect information about known issues and workarounds. The information provided here depends a lot on feedback from OS X users.
From 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 gdb.
Known Problems (GDB)
Debugging 32 bit app on 64 bit architecture
It is possible and maybe sometime necessary to debug a 32 bit exe on a 64 bit system.
This is only possible with Lazarus 0.9.29 rev 28640 and up.
TimeOuts (64 Bit only)
It 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.
This has been observed with:
- Certain Watch expressions (at least if the watched variable was not available in the current selected function)
- Handling an Exception
- Inserting breakpoints (past unit end / none code location)
It can not be guaranteed:
- that GDB will not later return some results from such a command
- that GDB's internal state is still valid
The prompt displayed for timeouts can be switched off in the debugger config.
- Warn On Timeout
- True/False. Auto continue, after a timeout, do not show a warning.
- TimeOutForEval
- Set in milliseconds, how long until a timeout detection is triggered (the detection itself may take some more time.)
You may need to "RESET" the debugger after those changes are made
More info see here:
An alternative solution seems to be to use a newer version of GDB (see below).
Hardware exceptions under Mac OS X
When a hardware exception occurs under Mac OS X, 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.
The practical upshot is that it is impossible under Mac OS X 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.
Using Alternative Debuggers (GDB)
You can install GDB 7.1 (or later) using MacPorts, fink or homebrew.
The following observations have been made:
- GDB 7.1 seems to have issues with the stabs debug info from fpc.
- Make sure you select "generate dwarf debug information (-gw)" on the linking tab of the project options
- Watch out for the linker warnings about "unknown stabs"
- If 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
Even with those rules followed, GDB does not always work with fpc compiled apps.
Those observations may be incomplete or wrong, please update them, if you have more information.
- Lazarus Version 1.0 to 1.0.12
In the debugger options configure
EncodeCurrentDirPath = gdfeNone
EncodeExeFilename = gdfeNone
And you must use "run param" to specify the actual executable inside the app-bundle ( project.app/Content/MacOS/project or similar)
In Lazarus Version 1.0.14 to 1.2 and up those steps should no longer be required.
Xcode 5
Since OS X Mavericks 10.9, Xcode 5 no longer installs gdb by default and not globally.
- 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.
- You can compile and install gdb. See GDB on OS X Mavericks and Xcode 5.
Please see issue 25157 on mantis
- http://forum.lazarus.freepascal.org/index.php/topic,22529.0.html - about installing Xcode 4.3
- http://forum.lazarus.freepascal.org/index.php/topic,22328.0.html - install gdb
Thread "[Lazarus] Help: OS X Problems" on
- http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-November/thread.html#84126
- http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-October/thread.html#84095
Frozen UI with GDB
To 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
Links
- Mac OS X comes with a lot of useful tools for debugging and profiling. Just start /Developer/Applications/Instruments.app and try them out.
FreeBSD
The system-provided gdb is ancient (version 6.1.1 in FreeBSD 9) and does not work well with Lazarus.
You can install a newer gdb from the ports tree, e.g.
cd /usr/ports/devel/gdb
make -DBATCH install clean
The new gdb is located in /usr/local/bin/gdb
Using a translated GDB (non-English responses from GDB)
- This applies only to Lazarus *before* 1.2 or *before* 1.0.14.
This is no longer needed.
The IDE expects responses in English. If GDB is translated this may affect how well the IDE can use it.
In many cases it will still work, but with limits, such as:
- No Message or Class for exceptions
- No live update of threads, while app is running
- Debugger error reported, after the app is stopped (at end of debugging)
- other ...
Please read the entire thread: [http://forum.lazarus.freepascal.org/index.php/topic,20756.msg120720]
Try to run lazarus with
export LANG=en_US.UTF-8 lazarus
Known Problems / Errors reported by the IDE
Message | OS | Description | |
---|---|---|---|
During startup program exited normally |
|||
All |
In 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. This error can happen for various reasons. There are at least 2 known:
There may be more. The 2nd only happens on repeated runs of the debugger. The 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). Even if you can work around, please consider to send a logfile: #Log_info_for_debug_session Ways to work around: (all on the options / debugger page)
This can only be used, if you do not debug within libraries (if you have not written your own lib)
It will add a very slight increase to the time it takes to start the debugger, as gdb must be reloaded each time.
Try any of the values available for "InternalStartBreak" (in the property grid of the options) | ||
SIGFPE |
|||
All |
SIGFPE is a floating point unit exception. Source: [forum thread] SIGFPE exceptions are raised on the next FPU instruction; therefore the error line you get from Lazarus may be off/incorrect. Delphi, 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. Workaround: try changing the mask with SetExceptionMask as early as possible in your program: uses math;
...
SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide,
exOverflow, exUnderflow, exPrecision]) If you think there is something wrong in the FPC code, you can use the $SAFEFPUEXCEPTIONS 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. | ||
Error 193 (Error creating process / Exe not found) |
|||
Windows |
For details see here. 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.:
| ||
SigSegV - even with new, empty application |
|||
Windows |
The following applies only, if you get a SigSegv, even with a new empty application (empty form, and no modifications made to unit1). A 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:
| ||
SigSegV - and continue debugging |
|||
Windows, Mac |
http://sourceware.org/bugzilla/show_bug.cgi?id=10004 http://forum.lazarus.freepascal.org/index.php/topic,18121.msg101798.html#msg101798 | ||
On Windows Open/Save/File or System Dialog cause gdb to crashSee next entry "gdb.exe has stopped working" Or download the "alternative GDB" 7.7.1 (Win32) from the Lazarus SourceForge site.
"Step over" steps into function (Win 64) |
|||
Windows 64 |
Sometimes pressing F8 does not step over a function, but steps into it. It 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). In Lazarus 2.0 a workaround was added, but needs to be enabled. Go to Tools > Options > Debugger and enable (in the property grid) "FixIncorrectStepOver". | ||
gdb.exe has stopped working |
|||
Windows |
GDB 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. There 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 "Debug output" window).
This can only be used, if you do not debug within libraries (if you have not written your own lib) | ||
internal-error: clear_dangling_display_expressions |
|||
Windows, maybe other |
At the end of the debug session, the debugger reports: internal-error: clear_dangling_display_expressions: Assertion `objfile->pspace == solib->pspace' failed. This is an error in gdb, and sometimes solved by
This can only be used, if you do not debug within libraries (if you have not written your own lib) | ||
"PC register is not available" ("SuspendThread failed. (winerr 5)") |
|||
Windows |
GDB may fail with this message. This is due to http://sourceware.org/bugzilla/show_bug.cgi?id=14018 If you get this issue you may want to downgrade to GDB 7.2 | ||
Can not insert breakpoint |
|||
All |
For breakpoints with negative numbers Please see: http://forum.lazarus.freepascal.org/index.php/topic,10317.msg121818.html#msg121818 You may also want to try:
This can only be used, if you do not debug within libraries (if you have not written your own lib) 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. On Windows, if it happens despite correct setup, then add -Xe (external linker) to the custom options. |
Reporting Bugs
- Did you verify your Debugger Setup?
- Did you try Dwarf and Stabs
Check existing Reports
Please check each of the following links
- Search Mantis for category "debugger"
- Search Mantis for text "debugger"
- Search Mantis for text "gdb"
- Search Mantis for text "dwarf"
- Search Mantis for text "stabs"
Bugs in GDB
Description | OS | GDB Version(s) | Reference |
---|---|---|---|
win64 crash with bad dwarf2 symbols | win64 | GDB 7.4 (maybe higher) | http://sourceware.org/bugzilla/show_bug.cgi?id=14014 |
Debuggee doesn't see environment variables set with set environment | win | Solved in GDB 7.4 | http://sourceware.org/bugzilla/show_bug.cgi?id=10989 |
Win32 fails to continue with "winerr 5" (pc register not available) *apparently* not present in 7.0 to 7.2 |
win | GDB 7.3 and up (maybe 6.x too) Appears to be fixed in 7.7.1 |
http://sourceware.org/bugzilla/show_bug.cgi?id=14018 |
Wrong array index with dwarf | * | GDB 7.3 to 7.5 (maybe 7.6.0) fixed in 7.6.1 |
http://sourceware.org/bugzilla/show_bug.cgi?id=15102 |
GDB crashes, if trying to inspect or watch resourcestrings only tested on win32, not known for other platforms only, if using dwarf |
* | GDB 7.0 to 7.2.xx | |
Records (especially: pointer to record) may be mistaken for classes/objects The data/values appear to be displayed correct / further tests pending This also affect the ability to inspect shortstring |
* | GDB 7.6.1 and up (tested and failing up to GDB 8.1) | https://sourceware.org/bugzilla/show_bug.cgi?id=16016 |
Object variables (Members) of the current methods class (self.xxx) can not be watched/inspected To work around use upper case or prefix with self. |
* | GDB 7.7 up to 7.9.0 (incl) Workaround present in Lazarus 1.4 and up |
https://sourceware.org/bugzilla/show_bug.cgi?id=17835 |
gdb cannot continue after SIGFPE or SIGSEGV happen on windows | win | * | https://sourceware.org/bugzilla/show_bug.cgi?id=10004 |
GDB truncates values for "const x = qword(...)" | Win 64 bit maybe others |
Fixed in GDB 7.7 and up, maybe fibed between 7.3 and 7.7 |
Issues with GDB 7.5.9 or 7.6
There are various reports (not confirmed) for different platforms about crashes in gdb 7.5.9 or 7.6.
It is highly recommended not to use those versions.
- http://bugs.freepascal.org/view.php?id=24401
- http://forum.lazarus.freepascal.org/index.php/topic,20756.msg120842.html#msg120842
- http://sourceware.org/bugzilla/show_bug.cgi?id=15453
Create a new Report (GDB and LLDB)
If 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.
Basic Information
- Your Operating system and Version
- Your CPU (Intel, Power, ...) 32 or 64 bit
- Version of
- Lazarus (Latest Release or SVN revision) (Include setting used to recompile LCL, packages or IDE (if a custom compile Lazarus is used))
- FPC, if different from default. Please check the "Options" dialog ("Environment" or "Tools" Menu)
- GDB, please check the "Options" dialog ("Environment" or "Tools" Menu)
- Compiler Settings: (Menu: "Project", "Project Options", indicate all settings you used )
- Page "Code generation"
- Optimization settings (-O???): Level (-O1 / ...) Other (-OR -Ou -Os) (Please always test with all optimizations disabled, and -O1)
- Page "Linking"
- Debug Info: (-g -gl -gw) (Please ensure that at least either -g or -gw is used)
- Smart Link (-XX); This must be OFF
- Strip Symbols (-Xs); This must be OFF
Log info for debug session
- Start Lazarus with the following options:
--debug-log=LOG_FILE --debug-enable=DBG_CMD_ECHO,DBG_STATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DEBUG,DBGMI_TYPE_INFO,DBG_ERRORS
- 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.
- On Linux
- start Lazarus from a shell and append " --debug-log=/home/yourname/laz.log --debug-enable=..." to the command line
- 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=...
Attach the log file after reproducing the error.
If you can not 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.
Running the test-case
If 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.
The debugger test are in the directory:
- Lazarus 1.2.x: debugger\test\Gdbmi\
- Lazarus 1.3 and up: components\lazdebuggergdbmi\test\
In the below the 1.3 path is used. If using 1.2.x substitute as appropriate.
- One time setup
Create directory components\lazdebuggergdbmi\test\Logs: Optional, but helps keeping test result in one place
Create config files: in components\lazdebuggergdbmi\test\
- copy fpclist.txt.sample to fpclist.txt
- copy gdblist.txt.sample to gdblist.txt
open 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
- Running the test
- Open project: components\lazdebuggergdbmi\test\TestGdbmi.lpi
- Lazarus 1.2.x only: Rebuild the IDE wit 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.
- Run the project (If a test failed, you may have to delete *.exe files in components\lazdebuggergdbmi\test\TestApps
Links
External Links
Experimental Debuggers in pascal
Those are work in progress:
- http://sourceforge.net/projects/duby/
- https://github.com/graemeg/fpdebug
- https://code.google.com/p/vdbg/
- fpdebug in Lazarus/components/fpdebug and debugger/components/fpgdbmidebugger blog FpGdbmiDebugger