2017-06-05 51 views
0

现在我知道gdb使我们能够在执行的线程之间切换。每个gdb实例有可能有一个线程吗?

但是,为了更方便,我想知道是否有可能在应用程序中打开多个终端仿真程序,并在每个仿真程序中都有一个gdb实例,每个绑定到特定线?

回答

0

,并在每个模拟器的GDB实例,每个绑定到 特定线程

你不能多GDB实例连接到相同的过程。这是gdb使用的ptrace syscall的限制。来自man ptrace

EPERM The specified process cannot be traced. This could be because 
      the tracer has insufficient privileges (the required 
      capability is CAP_SYS_PTRACE); unprivileged processes cannot 
      trace processes that they cannot send signals to or those 
      running set-user-ID/set-group-ID programs, for obvious 
      reasons. Alternatively, the process may already be being 
      traced, or (on kernels before 2.6.26) be init(1) (PID 1). 
相关问题