Re: using ptrace system call

From: Paul Pluzhnikov (ppluzhnikov-nsp_at_charter.net)
Date: 09/15/04


Date: 15 Sep 2004 07:58:51 -0700

amujoo@yahoo.com (Ash) writes:

> I have written a small code for using ptrace (I am new to this system
> call)
>
> int main()
> {

Please post *complete* test case so we would not have to guess
which headers it needs, and please specify your OS.

> But the code doesnt seem to work fine and hangs. I think it is waiting
> at waitpid in parent.

It probably does.

> So where I am doing wrong and how to i print out
> the register values of the child process?

Add 'ptrace(PTRACE_TRACEME, 0, 0, 0);' to the child.

Cheers,

-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


Relevant Pages

  • slightly OT: Sudoku solver C source
    ... takes 162 bytes per recursion level, times a maximum of 81 recursion ... void setbox(int n, int x, int bit) ... to indicate an unused square. ... program to restore the bitmask from a previously saved value. ...
    (comp.emulators.apple2)
  • Re: new java programmer with compile error and trouble writting a Recursive Function
    ... public static int handshakes ... When a new person enters the room, does his handshake count really multiply by the previous handshake count? ... Which operation is appropriate for "op" in the recursive function? ... Recursion is a fundamental concept of maths and computer science. ...
    (comp.lang.java.programmer)
  • Re: printing the permutation, help
    ... People might not be able to see the post you are replying to. ... Don't use global variables without a very good reason. ... Implicit int was removed in the C99 standard and many considered it bad style even before then, and you don't return a value anyway! ... there are plenty of solutions without bothering with recursion. ...
    (comp.lang.c)
  • Re: Recursion to Iteration
    ... recursion 15 years ago. ... void singleton(int *x, int *y, int count) ... int xpivot; ... int ypivot; ...
    (comp.programming)
  • Re: Iteration vs. Recursion
    ... void rfoo(int, int, int); ... function with a loop in it uses just the one stack frame throughout. ... "Recursion does not preserve state", but, to put it another way, "with ...
    (comp.programming)