2017-06-05 80 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). 
相關問題