From: Iain Sandoe Date: Tue, 15 Oct 2019 20:28:02 +0000 (+0000) Subject: [Darwin] Clarify fix and continue support (NFC). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a1f37c3f62acf98aa2a44b1f5b3e6d574ef52670;p=gcc.git [Darwin] Clarify fix and continue support (NFC). This updates the description of the support for fix and continue debugging. gcc/ChangeLog: 2019-10-15 Iain Sandoe * config/darwin.c: Update description of fix and continue. From-SVN: r277010 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a9c2e0482f..2320abc0dd2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2019-10-15 Iain Sandoe + + * config/darwin.c: Update description of fix and continue. + 2019-10-15 Iain Sandoe * config/darwin.c (darwin_binds_local_p): Update to call diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index d34b0035bdb..c0fafedfa8b 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -49,18 +49,24 @@ along with GCC; see the file COPYING3. If not see #include "intl.h" #include "optabs.h" -/* Darwin supports a feature called fix-and-continue, which is used - for rapid turn around debugging. When code is compiled with the - -mfix-and-continue flag, two changes are made to the generated code - that allow the system to do things that it would normally not be - able to do easily. These changes allow gdb to load in - recompilation of a translation unit that has been changed into a - running program and replace existing functions and methods of that - translation unit with versions of those functions and methods - from the newly compiled translation unit. The new functions access - the existing static symbols from the old translation unit, if the - symbol existed in the unit to be replaced, and from the new - translation unit, otherwise. +/* Fix and Continue. + + NOTES: + 1) this facility requires suitable support from a modified version + of GDB, which is not provided on any system after MacOS 10.7/Darwin11. + 2) There is no support for this in any X86 version of the FSF compiler. + + Fix and continue was used on some earlier MacOS systems for rapid turn + around debugging. When code is compiled with the -mfix-and-continue + flag, two changes are made to the generated code that allow the system + to do things that it would normally not be able to do easily. These + changes allow gdb to load in recompilation of a translation unit that + has been changed into a running program and replace existing functions + and methods of that translation unit with versions of those functions + and methods from the newly compiled translation unit. The new functions + access the existing static symbols from the old translation unit, if the + symbol existed in the unit to be replaced, and from the new translation + unit, otherwise. The changes are to insert 5 nops at the beginning of all functions and to use indirection to get at static symbols. The 5 nops