• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C6000 Single Core DSP » C67x Single Core DSP Forum » [C6713] C++ exceptions
Share
C6000 Single Core DSP
  • Forums
  • Announcements
Options
  • Subscribe via RSS

Forums

[C6713] C++ exceptions

This question is answered
vanmierlo
Posted by vanmierlo
on Jun 19 2008 09:31 AM
Prodigy10 points

I can't seem to find what the C++ compiler + library for the C6713 do with exceptions.

I know that the C++ new operator can throw exceptions, but it may also just return 0. However I cannot find what the TI compiler does.

And if I have an unhandled expection, what will my code do? Will it send a message to stdout or stderr? Wil it call abort() or exit()?

B.t.w. does anyone know of a nice overview of which C++ operators and functions can throw exceptions?

Basically my problem is that my application sometimes just stops working and I find it lurking in SYS_EXITFN. That is why I expect I have an unhandled exception somewhere. But I don't see anything in my Stdout window.

 Any help is welcome,

Maarten Brock

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • TimHarron
    Posted by TimHarron
    on Jun 19 2008 17:06 PM
    Genius16720 points

    I do not believe that you will receive any messages in the Stdout window unless you create a custom printf() message. I don't know of any good TI-published documents discussing this, but from what I can recall C++ exception handling is not nearly as powerful as Java exception handling. I think that the C++ implementation of exceptions does not automatically throw an exception; rather, the user code must be written such to check for problems and then throw an error (e.g., if (denominator == 0) throw dividebyzeroerror();).

     

    I think that in DSP/BIOS systems there is an EXC module that can capture messages using the log message buffer, but this may be limited to C64x+ hardware. Maybe we can get someone else to come along and fill in the blanks for us.

    -Tim

    ---------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------- 

    C67x C++ Exception Handling
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Brad Griffis
    Posted by Brad Griffis
    on Jun 22 2008 15:55 PM
    Verified Answer
    Verified by clam
    Guru57330 points

    Here's Chapter 7.11 from the Compiler Reference Guide (spru187n):

    "The compiler supports all the C++ exception handling features as defined by the ISO 14882 C++
    Standard. More details are discussed in The C++ Programming Language, Third Edition by Bjarne
    Stroustrup.

    The compiler --exceptions option enables exception handling. The compiler’s default is no exception
    handling support.

    For exceptions to work correctly, all C++ files in the application must be compiled with the --exceptions
    option, regardless of whether exceptions occur in a particular file. Mixing exception-enabled object files
    and libraries with object files and libraries that do not have exceptions enabled can lead to undefined
    behavior. Also, when using --exceptions, you need to link with run-time-support libraries whose name
    contains _eh. These libraries contain functions that implement exception handling.

    Using --exceptions causes increases in code size and execution time, even if no exceptions are thrown."

    The EXC module in BIOS is limited to 64x+ only.  It's more of a "hardware thing" than a "C++ thing" though.  For example, on 64x+ architecture if you execute an illegal instruction then it will generate a hardware exception.  There is a check-box on the BIOS HWI module which allows you to enable the EXC module to automatically handle those exceptions for you.  It's a nice feature, though not related to C++ exceptions.

     

    ---------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------- 

    C++ Exception Handling
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use