title: How does the pstack command work?
body: <p>I am curious to find how does the pstack command prints the stack trace of all the threads running under the PID?</p>
  
  <p>It has to be someway different than the way gdb does since the process runs inside the gdb environment, but pstack is executed after the execution of the process. </p>