You'll want to compile it with debugging symbols while building it from source.
The Tor Project distributes debugging symbols for Tor Browser, but I do not believe they do so for Tor (building Tor Browser is a much bigger undertaking, so providing the symbols makes it easier).
Under Linux (or most POSIX-like systems), the process should look something like this:
gpg --verify tor-0.3.1.7.tar.gz.asc tor-0.3.1.7.tar.gz
# Check the signature is good
tar vxaf tor-0.3.1.7.tar.gz
env CFLAG='-ggdb' ./configure
# Add the -ggdb CFLAG to the make process
# gdb should report 'Reading symbols from src/or/tor...done.', you now have debugging symbols available.