Emacs GDB 重新运行行为
我希望程序 X
上的命令 gdb
切换到 X
的现有调试会话(如果它已经存在),而不是发出错误信号< em>gud-common-init 中的“该程序已被调试”。
我相信这很重要,因为它使 gdb
的行为与大多数其他 Emacs 交互的标准行为协调,例如 find -file
、switch-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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您始终可以重命名缓冲区。这就是我如何在同一个可执行文件上运行多个 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.