GDB's ability to show source lines and function names during a live debug session, and addr2line's ability to turn a crash address into a file:line, both come from walking the DW_TAG_subprogram DIEs you are extracting here. Production DWARF parsing is handled by libdwarf and elfutils's libdw, the same libraries behind `perf` and crash-reporting tools like Breakpad.