View previous topic :: View next topic |
Author |
Message |
borucix n00b
Joined: 23 Aug 2007 Posts: 4
|
Posted: Sat Dec 26, 2009 11:05 am Post subject: ptrace vs procfs - controlling processes |
|
|
Hi guys,
the ptrace function allows one process to control the actions of another (like single-stepping, writing to its memory, etc.). However, I have recently read that it is generally better to use procfs for such purposes, it is supposed to be more universal. Is such functionality available in linux's procfs? I am looking for something like the one offered by DragonFly BSD:
http://leaf.dragonflybsd.org/cgi/web-man?command=procfs§ion=5 |
|
Back to top |
|
|
gentoo_ram Guru
Joined: 25 Oct 2007 Posts: 474 Location: San Diego, California USA
|
Posted: Sat Dec 26, 2009 6:34 pm Post subject: |
|
|
Yes, Linux contains a /proc filesystem. But it offers different functionality. gdb, the debugger, offers the ability to attach to a remote process and control it if you need to using the 'attach' command in gdb. The /proc filesystem does not offer this functionality. |
|
Back to top |
|
|
borucix n00b
Joined: 23 Aug 2007 Posts: 4
|
Posted: Sat Dec 26, 2009 10:29 pm Post subject: |
|
|
Thanks. So I'm guessing that ptrace is the only way given by the API to controll processes? Gdb is a debugger, what I need is to write such a "debugger" of my own. |
|
Back to top |
|
|
|