Fix and Continue, part 1

Daniel Jacobowitz drow@mvista.com
Fri Mar 7 03:34:00 GMT 2003


On Thu, Mar 06, 2003 at 07:15:38PM -0800, Mike Stump wrote:
> These add a feature to the compiler called fix-and-continue.  Basically 
> gcc inserts nops at the start of functions so that the debugger can 
> rewrite them to forward old functions to newly loaded instances of 
> those functions in a running debugging session.
> 
> If people are interested in hearing more, I'd be happy to say more...

Why is this necessary?  I'd think it would be generally easier and less
intrusive to just make sure functions were a minimum of (however many
instructions) long; if you're overwriting the code, why not overwrite
the code instead of a padding buffer?

> There is another set of changes that indirect all global data accesses 
> through pointers at runtime, so that the newly loaded code will get the 
> old data, instead of any new data.  I'll be submitting that next.

Hrm, I can't intuitively see why that's necessary either.  I'm curious,
tell me more :)

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gcc-patches mailing list