libstdc++ not handling exception for sh4 architecture

Rahul Dhobi <[email protected]>
Newsgroups gmane.linux.debian.devel.toolchain,gmane.linux.debian.ports.superh
Organization System Level Solutions (India) Pvt.Ltd.
Message-ID <[email protected]>
Hello,

I'm using *gcc4.9 sh4 toolchain* from 
http://download.si-linux.co.jp/debian-sh/jessie-sh4/toolchain-amd64/gcc-4.9/ 
, During testing I have found that libstdc++ is not handling exception 
and program receives *SIGABRT* signal.

sample program is below.

int div(int a,int b)
{
     if(b==0)
         throw "divided by zero..";
     else
         return (a/b);
}


int main()
{
     int x=20 ,y = 0;

     try
     {
         int z;
                   z=div(x,y);
         cout<<"result="<<z<<endl;
     }

     catch (const char *p)
     {
         cout<<p<<endl;
     }
     return 0;
}

I'm compiling this sample code using *sh4-linux-gnu-g++ -o test test.cpp*.

So, Anyone have idea why this happening?


-- 


          Regards,
          Rahul R Dhobi,
          System Level Solutions (I) Pvt. Ltd.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.