emacs gud中的lldb不会更新' up'

时间:2017-03-11 03:12:16

标签: emacs lldb gud

我使用了https://opensource.apple.com/source/lldb/lldb-69/utils/emacs/gud.elhttps://github.com/ptrv/emacs.d/blob/master/site-lisp/gud-lldb.el ,以及LLVM 3.9.1中的emacs 24.3和lldb。它可以在断点处停止,并在单独的emacs窗口中将光标显示在正确的源文件中。但是' up' down' lldb中的命令仅在lldb emacs窗口中显示新的源代码。没有新的emacs窗口显示新的源代码。

' S' /'鳍'可以在不同的窗口中显示正确的代码。

这是预期的吗?

2 个答案:

答案 0 :(得分:1)

我在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)

答案 1 :(得分:1)

jjcherry56,你的改变是有效的。而且,既然你找到了它,我就将前一个答案推荐为0,从-1开始。

所以,我看了那个delta,最后明确做了一个小改动。

特别是,我改变了模式的一部分:

string-match "^[ ]*frame

string-match "^.*frame

它有效!

不可否认,"之前" gud-lldb.el,^ [] * frame)中的模式(来自jjcherry56' s),比^ frame更接近(在原始修改的gud.el中,并且它根本不起作用) ,该文件覆盖了其他语言调试器。)

因此,修改后的模式现在可以从行的开头到帧,而不仅仅是零个或多个空格。事实上更接近,如果没有,"那里" (甚至思考关于"框架"在线上的多个实例的边界条件,以及其他测试: - )。

jjcherry56,我怀疑某人的原始downvote是因为提及提问者为" nube",并且没有具体的解释摘要(当然不是我,它可能是过度的,特别是考虑到你的改变有其价值,但我能理解这种反应。)

gud-lldb.el绝对更好,因为你说的原因,你的修复现在允许我(和其他人(你也是,Joe C))继续前进(继续能够)在Mac上使用emacs / gud进行调试。

PS我已经尝试过使用gdb的所有内容(我羡慕所有那些为之工作的人),没有运气,所以这是一个救星。嘿,我实际上可以在深度处设置一个断点,并且M-x lldb在那里停止,并在缓冲区中给我箭头(它会弹出)!