This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Oldest supported Linux kernel version (require PTRACE_EVENT_CLONE?)


Hi,

GDB currently has no guideline on the oldest version of the
Linux kernel gdb supports.

For every new feature the kernel introduces, we keep old
fallback code, and as time (years) goes by, we keep the old code
working, and tend to leave it in place.

As a result we're probably carrying around old code that works
around bugs and missing features in ancient kernels that nobody
expects new gdb to ever run on.

Such fallback code obviously increases maintenance burden, often
confuses newcomers, and sometimes influences design decisions deep
in the ptrace backends and sometimes in the remote protocol.

For example, on systems that don't support PTRACE_EVENT_CLONE, both gdb
and gdbserver coordinate with libthread_db.so to insert breakpoints at magic
locations in libpthread.so, in order to thread creation and thread death.

The ongoing work to make gdbserver support software single-stepping itself,
necessary for tracepoints on ARM, MIPS and other architectures where the
CPU doesn't offer a hardware single-step facility, trips on these magic
breakpoints -- the question of how to fit the new software single-step
mechanism with those breakpoints naturally comes up.

However, PTRACE_EVENT_CLONE was first introduced in Linux 2.5.46,
released in November 2002.

So I think it's reasonable to just remove support for kernels that
don't support PTRACE_EVENT_CLONE, and sidestep the libthread_db
breakpoints issues entirely.

Comments?

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]