On 28/02/2012 10:45, Jonas Maebe wrote: > > On 27 Feb 2012, at 13:32, Lukasz Sokol wrote: > >> On 26/02/2012 11:17, Mattias Gaertner wrote: >>> The next step is to "compile" the function on every change. Easy >>> with an interpreter. How to compile only one function of a big >>> program and insert/replace it? >> >> Sorry for a plug, but MS VC++ 6.0 (!)* allowed for Pause->Edit >> Code-> Quick compile->Resume Execution kind of workflow... >> >> Yes, in Debug/Pause mode, you COULD write a {code block} and then >> go Debug->Apply and Continue (or something like that) and voila, >> you could totally change code paths ... (Not that I know much about >> internals/constraints of this, to be honest, but of all, i found >> that a very cool feature) >> >> Is there a way to add THAT to FPC/Lazarus/GDB world ? > > Apple supported that in older versions of their development tools, > and it worked as well (or as badly) with FPC as it did with GCC. It > required changes to their dynamic linker (for the code replacement) > and to GDB. It was extremely flakey and limited though, and they > abandoned it fairly quickly. > > Since the required support is generally not part of the compiler but > of the environment (you need a way to inject the new code, and > possibly data, into the process, and link up everything with the new > version), I don't think this is something that can be added as an > "FPC" feature. > > > Jonas
(Un)fortunately I don't know much about the internals, as I mentioned :) The closest idea that looks similar is a loadable library: you can unload a dll (or a .so), edit/recompile/rebuild it while the caller program is paused/waiting, then reload it (with an obvious constraint that you can't modify the interfaces that the already-running program knows) - now imagine each code/data block is separate 'object' that can be loaded/unloaded...? (Did I just hit on the unmentionable feature of loadable modules :) ) Lukasz _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal