1

I have this file:

#include <string>

using namespace std; 

string remove(string s) {
    return s;
}

int main() { 
    string s1 = "aaaa";
    string s2 = remove(s1);
    return 0;  
} 

g++9 -g test.cpp

In .gdbinit, I have "skip -gfile /build/gcc-9-NBVNOv/gcc-9-9.1.0/build/x86_64-linux-gnu/libstdc++-v3/include/**/* ", which is used to skip non existing stl lib file.

Debug a.out in Emacs gud with multi windows support. After loading, "b remove" Then "r" to start debug.

Emacs always prompts (a lot of times, which is very annoying, MAKE EMACS UNSABLE)

Please answer y or n. File /home/user1/test/"/build/gcc-9-NBVNOv/gcc-9-9.1.0/src/libstdc++-v3/src/c++17/fs_ops.c" is read-only on the disk. Make buffer read-only, too? (y or n).*

However, the file does not exist at all. GUD continously prompts similar message, making it usable.

Any workaround?

Thanks.

kgflying
  • 141
  • 4

0 Answers0