lkml.org 
[lkml]   [2017]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: A issue about ptrace/SINGLESTEP on arm64
From
Date


On 2017/10/16 23:30, Will Deacon wrote:
> Can you jump the PC once the child appears to be "stuck"?
>
> IIRC, GDB has special heuristics to step through LDXR/STXR critical
> sections.
The function can be returned, But the number of instructions looks too much
We use objdump to count the assembly code length of the program

#=======
#trace
#=======
ptrace/2-arm64-loop # objdump -d ./nop | wc -l
115885


ptrace/2-arm64-loop # ./ptrace_singlestep ./nop

./nop : nop
Please wait
Number of machine instructions : 186688022


/ptrace/2-arm64-loop # ./ptrace_singlestep ./nop

./nop : nop
Please wait
Number of machine instructions : 103670668


The number of instructions executed twice is not the same

#=======
#trace ls
#=======

ptrace/2-arm64-loop # objdump -d /bin/ls | wc -l
18095

ptrace/2-arm64-loop # ./ptrace_singlestep /bin/ls
/bin/ls : ls
Please wait
Number of machine instructions : 7718122167


It seems that the child has also been tracked by the parent process
when it goes into the kernel space.

Is this what your 'stuck' mean?
Does all the instructions been tracked in kernel space, or only the
LDXR/STXR?




\
 
 \ /
  Last update: 2017-10-17 04:08    [W:0.140 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site