title: How can I attach to a process with command line arguments?
body: <p>I started a Centos process which has been running for several hours now. I used <code>gcc -g</code> to build the shared library and executable. I started the gdb process by entering <code>gdb ./MatchUpAccurate</code>. Once gdb  starts, I  enter <code>run -input XXXXXXX -fileloc YYYYY -version 5</code>. </p>
  
  <p>When I enter <code>ps -ef</code>, I see two process id numbers, one for <code>gdb ./MatchUpAccurate.exe</code> and another one for <code>./MatchUpAccurate.exe -input XXXXXXX -fileloc YYYYY -version 5</code>.</p>
  
  <p>Since the child process has been running for several hours now, I would like attach to it so I can check the value of its variables and to see what instruction it is running currently.</p>
  
  <p>I read some documentation an how to use gdb to attach an already running process. However all the examples have no command line arguments. I was wondering how to use gdb to attach a process with command line arguments. I would to be able to set breakpoints, inspect variable, look at the call stack, and step through the execution path without killing the original process. Thank you.   </p>