Re: [DynInst_API:] Is the dynamic mode dyninst disable ptrace?


Date: Tue, 17 Feb 2015 19:59:04 +0100
From: Xi Chen <xi.chen.chn@xxxxxxxxx>
Subject: Re: [DynInst_API:] Is the dynamic mode dyninst disable ptrace?
Hi
 That indeed a good idea. Thank you guys.

2015-02-17 19:52 GMT+01:00 Matthew LeGendre <legendre1@xxxxxxxx>:

On Tue, 17 Feb 2015, Bill Williams wrote:
On 02/17/2015 07:05 AM, Xi Chen wrote:
Hi,
 ÂI recently try to debug the dynamic mode dyninst because I found the
result is inconsistent with the static rewrite. I basically want to
attach to mutatee process, and see how the instrumentation code be
executed. However, when I do that in GDB, it tell me the ptrace
operation is not permitted (I have teh yama/ptrace_scope as 0). I wonder
if there are any way I can attach to the mutatee's address space and
debug there?

Not without detaching your mutator first; ptrace only allows one debugger at a time to be attached.

You can, however, use breakpoint snippets and the stack walking interface in BPatch_process for programmatic debugging. You can also enable DYNINST_DEBUG_RELOC and/or DYNINST_DEBUG_SPRINGBOARD in your environment to see what, exactly, we're generating for relocated/instrumented code and for branches that lead to it, respectively.

Core files can also be a convenient way to debug generated instrumentation. Just send the process a SIGSEGV after instrumenting. You can't walk through the code as it runs, but with gdb's 'disass' command you can dump the assembly showing what was generated and modified.

-Matt



--
Best Regards
X.Chen


[← Prev in Thread] Current Thread [Next in Thread→]