You are not logged in.
Hi all,
I am using gdb to debug C++ code, and want to drill down into g++ C++ library code:
(gdb)
Single stepping until exit from function _ZNSi10_M_extractIbEERSiRT_@plt,
which has no line number information.
std::istream::_M_extract<bool> (this=0x7ffff689cea0, __v=@0x7ffff00059a4: false)
at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/istream.tcc:86
86 /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/istream.tcc: No such file or directory.
(gdb)
89 in /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/istream.tcc
(gdb)
86 in /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/istream.tcc
(gdb)
89 in /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/istream.tcc
(gdb)
86 in /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/istream.tcc
Which package I should install to get libstdc++-v3 source code? I have installed libstdc++5, and it seems not the right package.
Thanks very much in advance!
Best Regards
Nan Xiao
Last edited by nanxiao (2017-08-01 07:05:21)
Offline
Hi,
The source code used to build gcc and friends can be found in the PKGBUILD of the gcc package. There are no separate source packages in Arch.
Remember that libraries and such are stripped during their build, which keeps them nice and small. If you want debugging symbols for a library in Arch, rebuild the package using its PKGBUILD without stripping it. See
man PKGBUILD
for details (add !strip to options essentially).
Hope it helps,
Laurent
Offline
Remember that libraries and such are stripped during their build, which keeps them nice and small.
Except for the libraries in gcc-libs.
Edit: Try this in gdb:
set substitute-path /build/gcc/src/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include /usr/include/c++/7.1.1
Offline
LaurentvdB wrote:Remember that libraries and such are stripped during their build, which keeps them nice and small.
Except for the libraries in gcc-libs.
[...]
Good one. Quite logical, but I did not think about that yet and it is even in the PKGBUILD I mentioned before.
Last edited by LaurentvdB (2017-07-31 14:00:42)
Offline