Re: status of Linux ptrace on amd64?

2014-12-02 Thread Alexander Nasonov
Alexander Nasonov wrote:
 Christos Zoulas wrote:
  Should not be that hard, but what is that tool reading from PEEKUSER?
  Registers?
 
 In both cases it reads from user_regs_struct, if I understand everything
 correctly. But it's the first step, the tool would definitely try other
 things if PEEKUSER didn't fail. In fact, I'm not sure that thing would
 work at all because it's a dynamic instrumentation tool called Pin. It
 updates code on the fly.

OK, I implemented reading orig_ax by PEEKUSER. It fixed ptrace failure
but it added two problems:

1. I had to disable compat_linux32 to fix compilation. I need
   to make linux_sys_ptrace_arch multiarch-aware.
2. PEEKUSER didn't change anything. The tool still detaches its child
   and exits. I can't debug to see what's going on, gdb receives SIGUSR1
   from the tool. I suspect PEEKUSER returns unexpected value.

Alex


Re: status of Linux ptrace on amd64?

2014-12-02 Thread Christos Zoulas
On Dec 2, 10:06pm, al...@yandex.ru (Alexander Nasonov) wrote:
-- Subject: Re: status of Linux ptrace on amd64?

| Alexander Nasonov wrote:
|  Christos Zoulas wrote:
|   Should not be that hard, but what is that tool reading from PEEKUSER?
|   Registers?
|  
|  In both cases it reads from user_regs_struct, if I understand everything
|  correctly. But it's the first step, the tool would definitely try other
|  things if PEEKUSER didn't fail. In fact, I'm not sure that thing would
|  work at all because it's a dynamic instrumentation tool called Pin. It
|  updates code on the fly.
| 
| OK, I implemented reading orig_ax by PEEKUSER. It fixed ptrace failure
| but it added two problems:
| 
| 1. I had to disable compat_linux32 to fix compilation. I need
|to make linux_sys_ptrace_arch multiarch-aware.
| 2. PEEKUSER didn't change anything. The tool still detaches its child
|and exits. I can't debug to see what's going on, gdb receives SIGUSR1
|from the tool. I suspect PEEKUSER returns unexpected value.

Have you tried porting the tool to NetBSD? What is involved?

christos


Re: status of Linux ptrace on amd64?

2014-12-02 Thread Alexander Nasonov
Christos Zoulas wrote:
 Have you tried porting the tool to NetBSD? What is involved?

I don't think source code is available.

Alex


Re: status of Linux ptrace on amd64?

2014-12-02 Thread Christos Zoulas
In article 20141202221949.GA4053@neva,
Alexander Nasonov  al...@yandex.ru wrote:
Christos Zoulas wrote:
 Have you tried porting the tool to NetBSD? What is involved?

I don't think source code is available.

It is going to be hard to get it to work

christos