Emacs / GDB:始终使用gdb-many-windows在特定窗口中显示源代码
我在Emacs 24中使用GDB,gdb-many-
windows设置为t,通常在自己的框架中.我喜欢有一个单独的编辑框架.它看起来像这样(为我粗略的ASCII图表道歉):
+-------------+-------------+ | gdb | locals | +-------------+-------------+ | source | I/O | | | | +-------------+-------------+ | stack | breakpoints | +-------------+-------------+ 除了一个大问题外,这种方法效果很好.每当gdb需要显示不同的源缓冲区时,例如,在上/下/步之后,它并不总是在“源”窗口中显示它.例如,如果我在不同帧的窗口中打开相同的缓冲区,它将提升该帧,同时将键盘焦点保持在gdb帧中.当帧相互覆盖时,这对于单显示器设置来说真的很烦人. 我希望gdb始终使用gdb-many-windows设置中的源窗口来显示源,无论是否在其他地方显示相同的源缓冲区.我怎样才能做到这一点? 编辑:更详细的重现说明.我正在使用Emacs 24.2.1和GDB 7.5-ubuntu.我在Ubuntu 10.04和Linux Mint Nadia与Cinnamon上看到过这个问题. >评估此表达式:(setq gdb-many-windows t) 例如: // foo.c void bar(int); void foo(int c) { if (c > 0) bar(c - 1); } int main(void) { foo(100); return 0; } // bar.c void foo(int c); void bar(int c) { if (c > 0) foo(c - 2); } // compile with gcc -g -O0 foo.c bar.c -o test >让bar.c显示在主框架中.使用M-x 5打开一个新帧2.在该帧中,使用M-x gdb启动gdb.如上图所示,该帧中应该有六个窗口.将gdb框架放在源框架的顶部. 我认为问题函数是gud.el.gz中的gdb-display-source-buffer.我打算尝试用defadvice来覆盖它,但我并不熟悉建议.如果我搞清楚,我会在这里发一个答案.
我有24.3.我无法重现这个版本的问题.
gud-display-line看起来如下: (defun gud-display-line (true-file line) (let* ((last-nonmenu-event t) ; Prevent use of dialog box for questions. (buffer (with-current-buffer gud-comint-buffer (gud-find-file true-file))) (window (and buffer (or (get-buffer-window buffer) (display-buffer buffer)))) (pos)) (when buffer (with-current-buffer buffer (unless (or (verify-visited-file-modtime buffer) gud-keep-buffer) (if (yes-or-no-p (format "File %s changed on disk. Reread from disk? " (buffer-name))) (revert-buffer t t) (setq gud-keep-buffer t))) (save-restriction (widen) (goto-char (point-min)) (forward-line (1- line)) (setq pos (point)) (or gud-overlay-arrow-position (setq gud-overlay-arrow-position (make-marker))) (set-marker gud-overlay-arrow-position (point) (current-buffer)) ;; If they turned on hl-line,move the hl-line highlight to ;; the arrow's line. (when (featurep 'hl-line) (cond (global-hl-line-mode (global-hl-line-highlight)) ((and hl-line-mode hl-line-sticky-flag) (hl-line-highlight))))) (cond ((or (< pos (point-min)) (> pos (point-max))) (widen) (goto-char pos)))) (when window (set-window-point window gud-overlay-arrow-position) (if (eq gud-minor-mode 'gdbmi) (setq gdb-source-window window)))))) 窗口设置与您的完全不同.也许,上面的代码是有用的,或者你应该升级到新的gud / gdb东西. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 如何在windows azure中创建表格?
- WinRT和XAML – 资源文件,但语言不是本地化?
- .net – msxml6.dll错误’80072ee2’操作超时
- 如何在多台Windows机器上自动更新非Microsoft软件?
- 在Windows 7上以编程方式更改系统范围的扬声器平衡
- 简单探究一下window下的wifi各种东西
- 为什么我的WPF应用程序中出现“无法加载DLL’sqlite3’”?
- 文件名全球化Windows与Unix
- 如何在Windows Server Active Directory计算机下列出Linux计
- Windows写代码,Linux运行 (WSL & VS Code)
- windows – 仅限Internet访问活动目录中的Web浏览
- Windows Python解释器在Ctrl C上退出
- windows-server-2008 – Windows 2008R2上的IIS
- windows-8 – Windows 8广告显示在设置弹出窗口之
- windows – Delphi中的GDI行间距?
- 如果我在代码中进行了更改,是否需要重新安装Wind
- wcf – 为我配置“使用端点配置服务”演示失败(M
- windows – 如何查找发送shutdown命令的pc的ip地
- Windows Server 2008中的管理员密码重置
- .net – 在Windows Mobile中找不到PInvoke DLL错