@albanD thanks a lot for your help.  I think you answered my question quite accurate, though the codes in those links are beyond my comprehension at this moment (I am very new to C/C++, and will keep learning it).
The deepest reason for why I had persisted to install gdb and keep coming to visit Torch C/C++ codes is I want to understand the logic of bricks (such as conv2d, relu etc) of deep learning through coding. As pdb helps me a lot in understanding code logic in python level ( I use pdb to explore code logic in perfectly healthy codes, not buggy codes, by experiment and checking the values of internals of funcions and classes), I expect gdb would do the same good for me when trying to understand C/C++ codes as pytorch’s most activations, layers are written in C/C++.
Now, I don’t expect gdb would work on my Mac anytime soon, is there other easier way for me to experiment torch C/C++ codes (for example, experiment on ConvForward in THNN) to understand the calculation inside the classes and functions, like we can use pdb on pure python codes?
Although my gdb is not working on python code, but it seems working on C/C++. So if you can give me a very simple demo on how to experiment ConvForward or Threshold_updateOutput or else in C/C++, I can learn to start using gdb with C/C++ to experiment the Torch code.
Thanks  a lot!