泰晓科技 -- 聚焦 Linux - 追本溯源,见微知著!
网站地址:https://tinylab.org

泰晓RISC-V实验箱,转战RISC-V,开箱即用
请稍侯

LWN 70465: 引入 kgdb 到 2.6

Xiao Jun 创作于 2018/06/10

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

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: