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?


  • Basically, emacs gud does not respect the setting in .gdbinit. – kk9527 Aug 21 at 6:53
  • Interestingly, as a comparison, the gdb frontend of Eclipse C++ debugger, does not have this issue. It respects the setting. – kk9527 Aug 21 at 6:54
  • Does your path really have double quotes in it? – nega Aug 21 at 14:07
  • The path info is prompted by emacs. Path should not have double quote. So I suspect this is a bug of gud. – kk9527 Aug 21 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.