Emacs GDB 重新运行行为

发布于 2024-11-05 13:59:57 字数 607 浏览 3 评论 0原文

我希望程序 X 上的命令 gdb 切换到 X 的现有调试会话(如果它已经存在),而不是发出错误信号< em>gud-common-init 中的“该程序已被调试”。

我相信这很重要,因为它使 gdb 的行为与大多数其他 Emacs 交互的标准行为协调,例如 find -fileswitch-to-buffer 等,从而减少用户的困惑。

到目前为止,我已经修改了包含

(error "This program is already being debugged"))

to

(message "This program is already being debugged")

的行,以至少防止出现错误。但是,函数 gdb 执行了一些不需要的额外初始化,从而导致了一些不必要的延迟。这是一个待办事项还是我错过了一些已经执行此操作的 gud/gdb 函数?

预先非常感谢, 佩尔·诺德鲁夫

I would like the command gdb on program X to instead switch to an existing debugging session of X if it already exists instead of signalling an error "This program is already being debugged" in gud-common-init.

I believe this is important as it makes the behaviour of gdb harmonize with the standard behaviour of most other Emacs interactions such as, find-file, switch-to-buffer etc, thus creating less confusion to the user.

So far I have modified the line containing

(error "This program is already being debugged"))

to instead do

(message "This program is already being debugged")

to at least prevent the error from arising. However, the function gdb does some extra initializations that should not be needed that causes some unnecessary delays. Is this a todo item or have I missed some gud/gdb-function that does this already?

Many thanks in advance,
Per Nordlöw

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

维持三分热 2024-11-12 13:59:57

您始终可以重命名缓冲区。这就是我如何在同一个可执行文件上运行多个 gdb 会话。它不是自动的,但它是一种有效的解决方法。

例如,如果我的可执行文件名为 Pump,那么在运行 gdb 时,将生成一个名为 *gud-pump* 的缓冲区,它代表 gdb 会话。从此缓冲区执行 meta-x rename-buffer *gud-pump1*

然后再次调用 gdb,您将拥有两个 GUD 会话,一个 *gud-pump* *gud-pump1*。这些会话是独立的,不应相互干扰(尽管它们可以交互)。

You can always rename-buffer. This is how I can run multiple gdb sessions on the same executable. It is not automatic but it is an effective work around.

For example if my executable is called pump, then upon running gdb, a buffer named *gud-pump* will be generated which represents the gdb session. From this buffer do meta-x rename-buffer *gud-pump1*

Then invoke gdb again and you will have two GUD sessions, one *gud-pump* and *gud-pump1*. The sessions are separate and should not interfere (although they can interact) with each other.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文