When I try stepping through a program, gdb throws this error
std::ostream::operator<< (this=0x6013c0 <std::cout@@GLIBCXX_3.4>, __n=2)
at /build/gcc/src/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/ostream.tcc:110
110 /build/gcc/src/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/ostream.tcc: No such file or directory.
This is the program I am trying to debug.
#include <iostream>
int printPrime(int, int);
int main()
{
int t, c;
std::cin >> t;
c = t;
int m[t], n[t];
while (t--) {
std::cin >> m[t] >> n[t];
}
while (c--) {
printPrime(m[c], n[c]);
std::cout << std::endl;
}
return 0;
}
int printPrime(int m, int n)
{
do {
int c = m;
int lim = c>>2;
if (c <= 1) continue;
while (c-- && c>lim) {
if (m%c == 0) {
if (c == 1) {
std::cout << m << std::endl;
break;
}
break;
}
}
} while(m++ && m<=n);
}
There is no problem with the program code as it runs correctly. I guess it is a problem with my install of GDB on Arch. The error is shown when it encounters cin or cout.
This error doesn't show when I tried running it in my Ubuntu VM