1

I'm trying to build a debugger-like program under Linux (Ubuntu) and I've run into some problems. From what I've heard, the /proc vfs provides mechanisms to create watchpoints, but I can't seem to find out how.

Some man pages pointed me to “control file”s, supposedly located at /proc/<pid>/ctl, but I can't find this file anywhere. (Perhaps this file is only for Solaris? Or maybe it's Ubuntu's fault?)

Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254
aradia
  • 11
  • 1

1 Answers1

0

Under Linux, as far as I know, a debugger will have to call ptrace to attach to the process being debugged, and possibly to influence its behavior.

Looking at the source of GDB is likely to be helpful.

There is information in /proc/<pid> that is of interest to debuggers. For example, you can read the process's memory via /proc/<pid>/mem. You can also use ptrace for this, and you need to use ptrace to write.

Community
  • 1
  • 1
Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254