inspect for throws

Discussion in 'C++' started by Ian Lazarus, Nov 9, 2003.

  1. Ian Lazarus

    Ian Lazarus Guest

    Hello,

    How do I analyze my code to determine which routines throw? Are there tools
    which automate this? Manual inspection is prone to error.

    Thanks
    Ian Lazarus, Nov 9, 2003
    #1
    1. Advertising

  2. Ian Lazarus

    Dave Guest

    "Ian Lazarus" <> wrote in message
    news:Xfirb.220891$...
    > Hello,
    >
    > How do I analyze my code to determine which routines throw? Are there

    tools
    > which automate this? Manual inspection is prone to error.
    >
    > Thanks
    >
    >


    Yep, it is prone to error and I don't know of any tools (but they may very
    well be out there).

    You'd have to make a complete call graph of your app., including calls to
    any standard library or third-party functions. Getting the set of
    exceptions that can propagate out of standard / third-party libraries and
    into your code will probably be a pain in the butt!

    Start at the bottom (i.e. the lowest level functions called) and propagate
    up the tree the exceptions that can be thrown. At each node in your tree,
    eliminate any exceptions which can propagate into a function but can't
    propagate out because they are handled and not re-thrown. Any place you get
    to a function that has an exception specification, don't allow anything but
    the exceptions in the specification to go up past that point in your tree
    (assuming your compiler supports exception specifications). And if you do
    find yourself cutting out some potential exceptions in this manner, that's a
    spot where your program has the potential to just die at runtime if such an
    exception makes it into that function and can't continue propagating because
    of the exception specification.

    I hope someone else can give you more easily-implementable advice...
    Dave, Nov 9, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QnJpYW4gS2l0dA==?=

    How do you inspect HTML controls in compiled C#?

    =?Utf-8?B?QnJpYW4gS2l0dA==?=, May 22, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    511
    Kevin Spencer
    May 30, 2005
  2. John C.

    inspect aspx form with reflection?

    John C., Dec 5, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    408
    John C.
    Dec 5, 2005
  3. Replies:
    4
    Views:
    4,765
    wpghost
    May 8, 2006
  4. Robin Becker

    bug in inspect (was cgitb vs traceback)

    Robin Becker, Jun 6, 2004, in forum: Python
    Replies:
    1
    Views:
    296
    Robin Becker
    Jun 6, 2004
  5. deluxstar
    Replies:
    5
    Views:
    863
    Terry Reedy
    Sep 25, 2010
Loading...

Share This Page