This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

exception unwinding on MIPS and vxWorks


Hi,

We're building gcc 3.0.1 for mips-wrs-vxworks
which is basically mips-gnu-elf
(on x86 host)

with the ghtread stuff turned on and we've patched up the 
gthr-vxworks.h file (which we did for egcs 2.95) which 
was no longer correct for 3.0.1

Now, we used to use sjlj-exceptions (2.95) and would like to
use the new default dwarf2 unwind exceptions.

ignoring thread issues for the meantime, 
ie. we only have one C++ excpetion enabled thread running,
    all the others are C code.


PROBLEM:
throw in one function cannot be caught by a catch() in another function.

ie
fn1()
{
   throw exception;
}

fn2()
{
  try
  {
     fn1(); 
  }
  catch()
  {
   printf("Caught\n"); 
  }
}


but a throw/catch inside the same function does work;
(ie if before we called fn1() we did a throw, the catch would get hit.)

We've been debugging it a little and we can see it hitting the end of fn1()
to to its 
associated cleanup, the going into Unwind_Resume then it returns to the
return address of fn2()
rather than the catch block.

It will do multiple try/catches etc calling all the appropiate destructors
at the
correct scope as long as its inside on function.

As soon as it leaves the function it doesn't get caught by anything.

I don't think its anything thread specific since there is only one thread
running,
but the rest of this code is standard mips (mips3 cpu=r4000)

any ideas????

Ken




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]