开发者

How to trace a program execution with ptrace?

开发者 https://www.devze.com 2023-03-08 03:07 出处:网络
I\'ve been trying to use the system call \"ptrace\" (using the PTRACE_SINGLESTEP macro) to trace the execution of a simple application.

I've been trying to use the system call "ptrace" (using the PTRACE_SINGLESTEP macro) to trace the execution of a simple application.

While recording the execution of the program I would like to skip the useless part of the reading to only follow from the 'main' of my application. Because whenever I launch my tracer I get 开发者_开发知识库around 100k execution steps.

Cordialy


You may want to insert a breakpoint at main entry, wait for a SIGTRAP to arrive, restore the instruction under the breakpoint, and single-step from there.

0

精彩评论

暂无评论...
验证码 换一张
取 消