On Thursday 19 January 2006 01:08, Jeff Dike wrote:
> On Wed, Jan 18, 2006 at 05:42:56PM +0100, Blaisorblade wrote:
> > What about this? Inserting an asm volatile clobbering all unsaved
> > registers (what I thought for long time)?

> The gcc doc is somewhat confusing.  I read your description as saying
> that locals may be totally smashed to random numbers (and the first
> sentence in the gcc description implies that as well).

I agree with that.

> However, the 
> example they give is a pathological case where a local may have one of
> two (well-defined) values, and it's not defined which of those two
> well-defined values it will end up with.

It's confusing. Standard conformance page says that:

       * On some rare x86 targets, `setjmp' doesn't save the registers
          in all circumstances.  In those cases, GCC doesn't allocate
          any variables in registers unless they are marked `register'.
But we know it's totally wrong.

The example under "Incompatibilities of GCC" is what you say. However, it's 
just because it's a little example. If the var is placed in a register, and 
after a lot you longjmp there, that register is totally smashed.

> > Or taking the libc implementation and suiting
> > it for our use, solving the above problem?

> Yuck.  But how big is it?

Don't know... I suggested this mainly for the volatile vars problem, more than 
for the "access stack" problem.

> Another possibility is to do the magic wakeup thing we do with
> mconsole stack, and have it tell us what it registers are.  Not sure
> if that's any better.

You mean mconsole_kern.c:do_stack()? Hmm, ugly too, but more reliable, and not 
relying on glibc at least.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

        

        
                
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to