Function interposition in Linux without dlsym

后端 未结 4 1185
死守一世寂寞
死守一世寂寞 2020-12-03 08:54

I\'m currently working on a project where I need to track the usage of several system calls and low-level functions like mmap, brk, sbrk

4条回答
  •  离开以前
    2020-12-03 09:18

    You can examine function invocation unobtrusively using tools such as:

    • gdb
    • ltrace
    • systemtap

    These tools allow a monitor program to inform you when a function is called, and allow you to interrogate the arguments.

    The main differences are:

    • gdb is interactive, but powerful
    • ltrace simple to use, but you can only print the function name
    • systemtap is not interactive, but it can be very fast, and is powerful.

提交回复
热议问题