how does gdb work?

前端 未结 3 1652
伪装坚强ぢ
伪装坚强ぢ 2021-02-02 08:19

I want to know how does gdb work internally. e.g. I know a brief idea that it makes use of ptrace() system call to monitor traced program. But I want to know how it handles sign

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-02 08:49

    The only way you'll find out is by studying the source.

    You can also build it and debug it with itself. Step through the code, and you'll know exactly how it does what it does.

    Reading GDB source is not for the faint of heart though -- it is chock-full of macros, and heavily uses libbfd, which itself is hard to understand.

    It has to, because it is portable (and in particular, builds and works on platforms which do not have ptrace() at all).

提交回复
热议问题