From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 19822 invoked from network); 20 Sep 1998 22:18:13 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 20 Sep 1998 22:18:13 -0000 Received: from post.mail.demon.net (post-11.mail.demon.net [194.217.242.40]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id SAA10921 for ; Sun, 20 Sep 1998 18:18:08 -0400 Received: from [194.222.210.232] (helo=tardis.home.dave) by post.mail.demon.net with smtp (Exim 2.03 #1) id 0zKrnO-0004lO-00 for axp-list@redhat.com; Sun, 20 Sep 1998 22:17:31 +0000 Date: Sun, 20 Sep 1998 23:17:01 +0100 (BST) From: Dave Gilbert X-Sender: gilbertd@tardis.home.dave To: axp-list@redhat.com Subject: 'ptrace' Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, I've just downloaded 'ltrace' which is a package which traces library calls; sounded damn useful - but unfortunatly it doesn't work on Alpha yet, so I started looking at its system dependent code. The first thing I've had to look at is its use of 'ptrace' to get register values. As I read the comments in the GDB alpha config, ptrace on Linux/Alpha reads/writes longs, so my first question is: Can I read/write an 8 byte value using ptrace at any 4 byte alignment? In particular I want to read the 4 bytes of an instruction and replace them with another instruction and thus using an instruction pointer of 4 bytes. The next question is regarding registers, In particular it uses code like this on the x86: int get_instruction_pointer(pid_t pid) { return ptrace(PTRACE_PEEKUSER, pid, 4*EIP, 0); } Now ignoring for a second that it expects this to return an 'int', what am I supposed to use instead of 4*EIP, from looking at the kernel source we reckon the answer is 64, but where exactly do we find that magic in the header files? Dave -------------------------------------------------------------------- / Dr. David Alan Gilbert | Running Linux on Alpha(LX) | Happy \ \ gro.gilbert @ treblig.org | & ARM(EBSA285,old Arc) | In Hex / \____________________________|___ http://www.treblig.demon.co.uk __/