Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
现在,我已将 F5 设置为在 emacs 中为我启动 gdb:
(全局设置键 [f5] 'gdb)
这将切换到迷你缓冲区,然后我输入一个可执行文件的路径......我想找到一种方法来绕过这个路径输入......
我编写了一个可执行文件,它查看 Makefile,解析它并找出可执行文件的完整路径并将其打印到标准输出......是否可以从我的 .emacs 调用它......然后以某种方式将输出传递给gdb 命令?
(defun gdb-getpath () "Figures out the path to executable and launches gdb." (interactive) (let ((path (shell-command-to-string "/path/to/your/executable"))) (gdb (concat "gdb " path)) )) (global-set-key [f5] 'gdb-getpath)