我使用https://opensource.apple.com/source/lldb/lldb-69/utils/emacs/gud.el和https://github.com/ptrv/emacs.d/blob/master/site-lisp/gud-lldb.el,在LLVM3.9.1中使用emacs24.3和lldb。它可以在断点停止,并在单独的emacs窗口中显示正确源文件中的光标。但是lldb中的'up'/'down‘命令只在lldb emacs窗口中显示新的源代码。没有一个新的emacs窗口显示新的源代码。
“/fin”可以在不同的窗口中显示正确的代码。
这是意料之中吗?
发布于 2017-11-18 18:55:35
我在emacs 25.3.1中使用https://github.com/ptrv/emacs.d/blob/master/site-lisp/gud-lldb.el时运气更好。它还具有不尝试修补gud.el的优点。我是一个更独立的解决方案。在堆栈帧上下移动时,它也未能移动游标,但是通过这种更改,它可以工作:
*** gud-lldb.el.orig 2017-12-11 17:22:08.000000000 -0700
--- gud-lldb.el 2017-11-18 11:52:55.000000000 -0700
***************
*** 64,73 ****
;; * thread #1: tid = 0x2e03, 0x0000000100000de8 a.out`c + 7 at main.c:39, stop reason = breakpoint 1.1, queue = com.apple.main-thread
(string-match " at \\([^:\n]*\\):\\([0-9]*\\), stop reason = .*\n"
gud-marker-acc start)
! ;; (lldb) frame select -r 1
! ;; frame #1: 0x0000000100000e09 a.out`main + 25 at main.c:44
! (string-match "^[ ]*frame.* at \\([^:\n]*\\):\\([0-9]*\\)\n"
! gud-marker-acc start))
;(message "gud-marker-acc matches our pattern....")
(setq gud-last-frame
(cons (match-string 1 gud-marker-acc)
--- 70,79 ----
;; * thread #1: tid = 0x2e03, 0x0000000100000de8 a.out`c + 7 at main.c:39, stop reason = breakpoint 1.1, queue = com.apple.main-thread
(string-match " at \\([^:\n]*\\):\\([0-9]*\\), stop reason = .*\n"
gud-marker-acc start)
! ;; cherry
! ;; (lldb) frame #1: 0x000000010013e29a sta`sta::PathEnumFaninVisitor::visitFromToPath(sta::Pin const*, sta::Vertex*, sta::TransRiseFall const*, sta::Tag*, sta::PathVertex*, sta::Edge*, sta::TimingArc*, float, sta::Vertex*, sta::TransRiseFall const*, sta::Tag*, float&, sta::MinMax const*, sta::PathAnalysisPt const*) + 986 at /Users/foobar/File.cc:348
! (string-match "^.*frame.* at \\([^:\n]*\\):\\([0-9]*\\)\n"
! gud-marker-acc start))
;(message "gud-marker-acc matches our pattern....")
(setq gud-last-frame
(cons (match-string 1 gud-marker-acc)发布于 2017-12-23 19:18:44
jjcherry56,你的零钱管用。既然你找到了答案,我就把先前的答案从-1提高到0。
所以,我看了那个增量,最后显式地做了一个小的改变。
特别是,我改变了模式的一部分:
string-match "^[ ]*frame至
string-match "^.*frame而且起作用了!
诚然,gud-lldb.el中的“from”模式(来自jjcherry56 56的增量)比^frame更接近于^frame(在最初修改的gud.el中,它根本不工作,并且该文件覆盖了其他语言调试器)。
因此,修改后的模式现在需要从行开始到帧的任何东西,而不仅仅是零或更多的空白。实际上,“那里”(甚至没有考虑多个"frame“实例的边界条件,以及其他深层次的测试:-)更加接近。
jjcherry56,我怀疑某人最初的否决是因为提到了提问者是"nube",而且没有一个具体的解释摘要(这肯定不是我的问题,而且这可能是过分的,特别是考虑到你的改变有其价值,但我能理解这种反应)。
由于您所述的原因,gud-lldb.el肯定更好,您的修复现在允许我(以及其他人(您也是,Joe C))继续在Mac上使用emacs/gud进行明智的调试。
PS我已经尝试了所有使用gdb的方法(我羡慕那些为它工作的人),没有运气,所以这是一个保护程序。嘿,我实际上可以在深度设置一个断点,M在那里停下来,给我缓冲区中的箭头(它会弹出)!
https://stackoverflow.com/questions/42730911
复制相似问题