> Я видел последние обсуждения отладчика в списках рассылки очень давно, поэтому ссылок
> не найду. В системе сейчас GDB 6.1.1, пока его выпиливать никто
> не собирается (в ближайшее время).///---
% man gdb
GDB(4) FreeBSD Kernel Interfaces Manual GDB(4)
NAME
gdb — external kernel debugger
SYNOPSIS
makeoptions DEBUG=-g
options DDB
DESCRIPTION
The gdb kernel debugger is a variation of gdb(1) which understands some
aspects of the FreeBSD kernel environment. It can be used in a number of
ways:
· It can be used to examine the memory of the processor on which it
runs.
· It can be used to analyse a processor dump after a panic.
· It can be used to debug another system interactively via a serial or
firewire link. In this mode, the processor can be stopped and single
stepped.
· With a firewire link, it can be used to examine the memory of a
remote system without the participation of that system. In this
mode, the processor cannot be stopped and single stepped, but it can
be of use when the remote system has crashed and is no longer
responding.
When used for remote debugging, gdb requires the presence of the ddb(4)
kernel debugger. Commands exist to switch between gdb and ddb(4).
...
...
...
BUGS
The gdb(1) debugger was never designed to debug kernels, and it is not a
very good match. Many problems exist.
The gdb implementation is very inefficient, and many operations are slow.
Serial debugging is even slower, and race conditions can make it diffi
cult to run the link at more than 9600 bps. Firewire connections do not
have this problem.
The debugging macros “just grown”. In general, the person who wrote them
did so while looking for a specific problem, so they may not be general
enough, and they may behave badly when used in ways for which they were
not intended, even if those ways make sense.
Many of these commands only work on the ia32 architecture.
FreeBSD 9.1 February 8, 2005 FreeBSD 9.1
---///
> Как альтернатива рассматривается lldb, но вот
> уже больше года его статус на вики так и застрял на
> 75%. Но тут опять же больше речь идёт об отладчике ядра.
> Юзерспейс никто не запрещает отлаживать новыми версиями GDB.
> И Clang с GDB никак не противоречат друг другу, поэтому ничего не
> мешает использовать их вместе.
К тому же, на продакшене отладка не нужна. GDB исключается из системы опцией WITHOUT_GDB=true в /etc/src.conf и убиранием строчки "makeoptions DEBUG=-g" в файле конфигурации ядра с последующей пересборкой ядра и системы.