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
|