Shared Libraries and Exceptions on PSeries

Darren Sheppard Darren.Sheppard at ncode.com
Fri Oct 29 18:33:54 EST 2004


I am new to this site so apologies if I have inadvertently broken any
rules.

 

We are having trouble catching Exceptions within a shared library built
on IBM PSeries running SUSE Linux 8.0 using 32bit gcc compiler.

 

We have created a very simple test application which demonstrates this.
We are pretty experienced with porting code to unix platforms but have
never come across this before. The code sample works on all of our Unix
and Linux platforms and Windows.

 

There is no possibility of upgrading to SUSE 9 as the project we are
working on if for a large multinational company who wont upgrade for
another 2 years.

 

Here is the code

 

MAIN.CPP

#include <stdio.h>

 

int main(int argc, char *argv[])

{

printf ("In main\n");

void shared_func();

  try 

{

  throw 1;

}

catch(int)

{

 printf ("Catch in main ok\n");

}

 

try {

   shared_func();

}

catch(...) {

   printf ("Caught shared exception in main - ERROR\n");

}

return 0;

}

 

SHARED.CPP

#include <stdio.h>

 

void shared_func()

{

   try 

   {

      printf ("Throwing in shared\n");

      throw 1;

   }

   catch(...)

   {

      printf ("Caught in shared\n");

   }

}

 

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20041029/2c358065/attachment.htm 


More information about the Linuxppc64-dev mailing list