mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fabiano Ramos <fabramos@bol.com.br>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Fabiano Ramos <ramos_fabiano@yahoo.com.br>,
	Edil Severiano Tavares Fernandes <edil@cos.ufrj.br>
Subject: ptrace bug?
Date: Wed, 05 May 2004 23:59:23 -0300	[thread overview]
Message-ID: <1083812363.1382.314.camel@slack.domain.invalid> (raw)

Hi all.

I am using ptrace() from a user program (code at the end). The thing
is, when tracing a snippet like:

0x0804869f:  8B 4D 0C                     mov	ecx, [ebp+12]
0x080486a2:  CD 80                        int	0x80
0x080486a4:  89 45 F8                     mov	[ebp-8], eax
0x080486a7:  83 7D F8 82                  cmp	[ebp-8], -126

it would print 

0x080486a2
0x080486a7

which means it is not stopping after the syscall (int 0x80).

Am I missing something or is it the expected behaviour?

TIA
Fabiano

-----------------------------
 
	// wait for exec
	waitpid(pid,&wait_val,0);
	ptrace(PTRACE_SINGLESTEP,pid,NULL,NULL) < 0)

        waitpid(pid,&wait_val,0);

        while (1) {
                ptrace(PTRACE_GETREGS, pid, 0, (int)&regs);
	      	printf("\n 0x%08lx \n", regs.eip);
                
		ptrace(PTRACE_SINGLESTEP, pid, 0, 0);

                wait(&wait_val);
		if ( WIFEXITED(wait_val)) break;

         }




                 reply	other threads:[~2004-05-06  2:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1083812363.1382.314.camel@slack.domain.invalid \
    --to=fabramos@bol.com.br \
    --cc=edil@cos.ufrj.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ramos_fabiano@yahoo.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®