Search code examples
gdbcygwin

GDB prevents updating the executable


On some operating systems, notably Windows (and cygwin), if you are debugging a program with GDB it is not possible to update the executable (e.g. by compiling and linking or copying).

Of course this is an inherent property of the os, but is there a command to gdb that "releases" the program under debug?

I'm thinking that if I could free the executable file from the grip of GDB, re-compile and then read it in again using the "file" command I would not have to restart and reset everything.

Is there such a command? Alternatives?


Solution

  • Just run the file command with no arguments. From http://sourceware.org/gdb/onlinedocs/gdb/Files.html:

    file with no argument makes gdb discard any information it has on both executable file and the symbol table.