3
votes

I would like to understand the internal workings of C's memcpy function. Is there a way for me to step into the function using gdb?

1

1 Answers

5
votes

Sure. When you get to a memcpy call, use si (step instruction) to step into the assembly.

You will only get source if you have a debug build of libc and the glibc sources handy, though.

If you want to just see the implementation, check out e.g. memcpy-ssse3.S or memcpy.S.