2 ms·
I don't know how Visual Studio does it, but Apple did implement a feature called "fix and continue" for gdb (it was very dependend on XCode, so it could not be
by deng 12y ago
I don't know how Visual Studio does it, but Apple did implement a feature called "fix and continue" for gdb (it was very dependend on XCode, so it could not be merged to mainline). The implementation was described like this:
"It was pointed out that I never said what F&C _is_. It's a feature for debugging your program, where you can modify your sources mid-debug-session, and the debugger will "patch" in the new code. At a very high level, the source file you're modifying is built as a shared library, gdb executes inferior function calls to load that shared library into the program, gdb finds all old versions of all
functions contained in that shared library and writes trampolines in the prologues to jump to the new versions of those functions, and gdb redirects all file-static (including global) variables in that shared library to point to the statics/globals in the original executable."
(From: http://osdir.com/ml/gdb.devel/2003-06/msg00518.html http://osdir.com/ml/gdb.devel/2003-06/msg00518.html)