python - ptrace single step followed by set breakpoint fails -
I have a debugger code using python On my system, immediately after step 2 ( but If I add a delay (in the code below using the It is quite possible , Error for Python code: C code: Tronsd Trres Re: PTRACE_CONT, but to prevent the trace on coming or entries from a system call or after the execution of a command system, respectively. (Trace will also, in general, be stopped at the receipt of a signal.) From the trailer perspective, Tracey will be closed by the receipt of a SIGTRAP . So, for example, to PTRACE_SYSCALL, it should be inspected arguments for system calls on the idea that the first call, then a second to inspect the return value of PTRACE_SYSCALL and call system on another call. Data logic is considered for PTRACE_CONT ptrace To restore,
single step ) step 3 (
createBreakpoint ), then with error message Something is wrong:
ptrace.error.PtraceError: ptrace (cmd = 4, .. error # 3: no such process
sys.readline ), all the steps and the debugged program are executed successfully.
ptrace module Ishisht No, I was not the right approach recognizes welcome any help.
import sys import ptrace.debugger.child import ptrace. debugger.debugger pid = ptrace.debugger.child.createChild ([ './sleeper'], 0) dbg = ptrace.debugger.debugger.PtraceDebugger () procedure = dbg.addProcess (pid, is_attached = 1) # # "# movel use "address gdb to" Disaimbl Men "- instructions between the two" calls "sPP = process. Biaarpeepi (0x08048432) process.cont () event = process.waitEvent () print (" the incidence of new process :% S "% Event) bp.desinstall (set_ip) = 1) # 1: # Otherwise the accident if breakpoint processing. Print "Press any key to continue ... 'sys.stdin.readline () bp = process.createBreakpoint (bp.address) Keep print (" process continues execution ") process.cont () < / Pre>
#include & lt; Stdio.h & gt; Int main () {printf ("~~~~~~~~~~~~> before breakpoint \ n"); // breakpoints printf ("~~~~~~~~~~~~> after breakpoint \ n"); Return 0; }
process.singleStep () event = process. WaitEvent () # repair-line bp = process.createBreakpoint (bp.address)
Comments
Post a Comment