泰晓科技 -- 聚焦 Linux - 追本溯源,见微知著!

[ 点 我 解 锁 ]

加微信 tinylab 进本站 Linux 交流群。

搜索 泰晓科技 或扫码关注本站公众号。

LWN 70465: 引入 kgdb 到 2.6

Xiao Jun 创作于 2018/06/10

原文:Bringing kgdb into 2.6 原创:By corbet @ Feb 10, 2004 翻译:By darmac 校对:By unicornx of TinyLab.org

The kernel development community has long been divided over the topic of interactive debuggers. Many hackers find debuggers to be an indispensable part of their development toolkits. Others claim that debuggers lead people to fix symptoms rather than problems; rather than use such a crutch, these people say, it is better to truly understand the code. Once you have “become one” with the code, finding bugs is not that hard.


The latter view is held by Linus Torvalds, who explained his approach in very clear terms back in 2000:

You can use a kernel debugger if you want to, and I won’t give you the cold shoulder because you have “sullied” yourself. But I’m not going to help you use one, and I would frankly prefer people not to use kernel debuggers that much. So I don’t make it part of the standard distribution, and if the existing debuggers aren’t very well known I won’t shed a tear over it.

后一种观点为 Linus Torvalds 所持有,早在 2000 年他就非常清楚地表达了他的看法:


The end result is that there has never been support for interactive debuggers in the mainline kernel - at least, for the more popular architectures.

最终结果是在主线内核中从来没有支持过交互式调试器 - 至少,对主流的架构是如此。

The 2.6 kernel is now Andrew Morton’s turf, however, and Andrew is more open to the value of debugging tools. In fact, he has carried a version of the kgdb patch in his -mm tree for a long time. Might Andrew merge kgdb into the 2.6 kernel at some point?

然而,2.6 内核现在是由 Andrew Morton 掌控,而他对调试工具持更加开放的态度。实际上,他已经在他的 -mm 树中携带一个版本的 kgdb 补丁很长时间了。 Andrew 会在某个时候将 kgdb 合进 2.6 内核中吗?

The answer from Andrew seems to be “maybe”:

I wouldn’t support inclusion of i386 kgdb until it has had a lot of cleanup, possible de-featuritisification and some thought has been applied to splitting it into arch and generic bits. It’s quite a lot of work.

来自 Andrew 的答案看起来是“可能”:

我当前还不会加入 kgdb,它跟 i386 绑定太深,除非它经过一些清理,将其拆解为架构部分和通用部分。为此还需要完成大量的工作。

In other words, there is no disagreement with the idea of merging kgdb, but the code needs some work first. Problems include a large number of #ifdefs, and the fact that the patch is relatively intrusive, touching many files. There are also objections to how the debugger works with the virtual memory subsystem, especially for the i386 architecture. All of these problems are probably solvable, given enough development time. The interest in a mainline kgdb is probably high enough that the cleanup work will happen, and kgdb may well be merged; a kgdb CVS repository has been established for those interested in this effort. An eventual merge into 2.6 seems unlikely to carry forward into 2.7, however.

换句话说,大家对合并 kgdb 的想法并没有异议,但首先要对代码做一些改进工作。包括引入大量的“#ifdefs”,而且事实是这个补丁比较繁琐,涉及到很多文件。也有人对调试器如何处理虚拟内存子系统持有反对意见,尤其是对 i386 架构。当然只要有足够的研发时间,所有这些问题都是可以解决的。看起来大家对主线支持 kgdb 的兴趣已经足够高了,清理工作很快就会开始,所以 kgdb 会被很快地合并;一个 kgdb 的 CVS 版本库已经为那些对此工作感兴趣的人建立起来了。看起来它最终会被合并进 2.6 的版本,而不会被推迟到2.7。

Read Album:

Read Related:

Read Latest: