gdb 手册页中的 C@t{++} 是什么意思?

Dis*_*ame 16 man documentation gdb

我正在阅读 gdb 的联机帮助页,但遇到了以下问题:

You can use GDB to debug programs written in C, C@t{++}, Fortran and Modula-2.
Run Code Online (Sandbox Code Playgroud)

C@t{++} 看起来像一个正则表达式,但我似乎无法解码它。

这是什么意思?

小智 28

GNU 讨厌手册页,因此他们通常以另一种格式编写文档并从中生成手册页,而并不真正关心结果是否可用。

C@t{++}是一些未翻译的 texinfo 标记。它不打算成为用户可见文档的一部分。它应该简单地说C++(可能带有一些特殊字体++以使其看起来不错)。

  • 在这种情况下,情况正好相反。[doco 最初是在 1980 年代用 roff 编写的](https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=7b4ac7e1ed2c4616bce56d1760807798be87ac9e#patch54() ) 在 2013 年手工转换为 texinfo。 (8认同)
  • 我们可以引用第一句中的观点吗? (6认同)
  • @thosphor 见例如 https://unix.stackexchange.com/questions/77514/what-is-gnu-info-for (4认同)
  • @Kusalananda 感谢您提供链接/信息。不过,该消息来源不支持答案中的观点。 (3认同)
  • @thosphor“讨厌”有点夸张,但很明显 RMS 和 FSF 并不认为它是他们的首选格式。 (2认同)

fil*_*den 18

序列@t{...}是使用固定宽度字体排版序列的 texinfo 标记(有关更多详细信息和一些示例,请参阅texinfo 手册的字体部分。)

It looks like they were trying to write "C++" and have the "++" use a fixed width font (like "++".) Perhaps someone found that yields better results with specific fonts while rendering documentation in PostScript or PDF or some format that uses variable-width fonts by default.

The reason why this doesn't seem to work and you're seeing the unprocessed sequence is that texinfo is used by the info documentation system, while man uses nroff which is a different language with different commands (for instance, the command to switch to a constant width font in nroff is \f(CW), so it of course didn't recognize the @t{...} sequence unchanged.

这个问题似乎是在2013 年 4 月的一次提交中引入的,其中手册页被转换为 texinfo 并引入了特定的标记。现在用于生成手册页 ( texi2man.pl)的脚本似乎无法识别或正确转换该序列。

  • 具有讽刺意味的是 [`pod2man` 为“更好的 C++”提供了一个 roff 宏](https://sources.debian.org/src/gdb-doc/8.1-1/gdb/doc/gdb.1/#L18 ) 没有被使用,因为 [它的识别码](https://github.com/rra/podlators/blob/18ec39768f4f06c0790cc97b5e09a6f110ee86d1/lib/Pod/Man.pm#L578) 只对字符串“C++”起作用。 (6认同)
  • [RedHat 的 Jan Kratochvil 于 2013 年 4 月将原始 roff 手册转换为 texinfo](https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=43662968f15ddbd815d64b4392a036f_387)在那一点上的标记。 (4认同)
  • 合作, 管道. [答案评论用于建议改进答案](https://unix.stackexchange.com/help/privileges/comment)。这里有一些改进。让我们看看这里的两个回答者是否希望合并它们。如果他们这样做,我不想踩到他们的脚趾。 (3认同)
  • @JdeBP 感谢您的来电。我记得我得到了 `C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'` troff在 C++ 语言的最初传播期间,当我们为那些早期的 C++ 事件排版 USENIX 程序时,从 Murray Hill 的 labbie 扩展而来。labbies 对他们的 troff 非常认真。:) (3认同)
  • @JdeBP 你似乎在这里有答案,所以你为什么不写一个? (2认同)