我如何使用lldb' -s' flag(命令源)正确

时间:2016-12-31 02:26:13

标签: lldb

我可以在终端中使用lldb成功启动和调试八度音程等程序,如下所示:

    $ lldb octave  
    (lldb) target create "octave"  
    Current executable set to 'octave' (x86_64).  
    (lldb) r --no-gui  
    Process 76986 launched: '/opt/local/bin/octave' (x86_64)  
    Process 76986 stopped  
    * thread #1: tid = 0x13465f, 0x00007fff5fc01000 dyld`_dyld_start, stop reason = exec
frame #0: 0x00007fff5fc01000 dyld`_dyld_start
   dyld`_dyld_start:
  ->  0x7fff5fc01000 <+0>: popq   %rdi
  ...

  (lldb) c  
  Process 76986 resuming  
  GNU Octave, version 4.2.0  
  ...  
  octave:1> 

现在我可以在八度音阶提示输入八度音命令。例如:

  octave:1> version  
  ans = 4.2.0

我想执行一个lldb脚本,因此改为启动lldb:

    $ lldb octave -s ~/path/to/lldb_script

lldb_script文件包含例如:

    r --no-gui

当我实际运行时

    $ lldb octave -s ~/path/to/lldb_script

我得到了

    (lldb) target create "octave"  
    Current executable set to 'octave' (x86_64).  
    (lldb) command source -s 0 '/Users/cyril/trunk/python/lldb_startup'  
    Executing commands in '/Users/cyril/trunk/python/lldb_startup'.
    (lldb) process launch --  --no-gui  
    Process 77138 stopped
    * thread #1: tid = 0x14b1fb, 0x00007fff5fc01000 dyld`_dyld_start, stop      reason = exec
    frame #0: 0x00007fff5fc01000 dyld`_dyld_start
   dyld`_dyld_start:
   ->  0x7fff5fc01000 <+0>: popq   %rdi
   ...

   Process 77138 launched: '/opt/local/bin/octave' (x86_64)

现在,当我这样做时,继续&#39;像这样

   (lldb) c  

我得到了

   Process 77138 resuming  
   GNU Octave, version 4.2.0  
   ...  
   (lldb)

lldb实际上返回到(lldb)提示符而不是八度音阶&gt; PROMT。我无法运行八度命令。

   (lldb) version

返回

   lldb-350.0.21.9

和        (lld)c

给出

   error: Process is running.  Use 'process interrupt' to pause execution.

脚本方案工作正常,实际上是按照预期直到最近给我八度提示。我可能无意中升级了lldb。

我如何使用lldb&#39; -s&#39; flag(命令源)是否正确,以便启动的程序正确启动并且不返回(lldb)提示符?

0 个答案:

没有答案