tags:

views:

117

answers:

2

hello all,

Following is my requirement.

while process A is running.

  1. attach Process A from B with PTRACE_ATTACH.
  2. Start a Loop
  3. Stop Process A
  4. read registers
  5. Resume Process A
  6. sleep(1)
  7. end loop
  8. detach A

i am facing issue with Start and Resume Process A from the loop. i tried combination of kill(pid,SIGSTOP), kill(pid,SIGCONT), PTRACE_CONT. but didnt work.

any other solutions please?

Thanks in advance. Sandeep

A: 

Sounds like a very challenging project to undertake from scratch. Have you considered leveraging the GNU debugger in any way? In particular there is an long running sub-project called libgdb2 which may suit your purposes even though it is far from finished or stable at this time.

bjg
no, i did not use GNU debugger..
Sandeep P
A: 

You could try scripting/interfacing with gdb in the same way that a lot of IDE's do. See also http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gdb/gdb-mi.html

Marc van Kempen