Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > inspect for throws

Reply
Thread Tools

inspect for throws

 
 
Ian Lazarus
Guest
Posts: n/a
 
      11-09-2003
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


 
Reply With Quote
 
 
 
 
Dave
Guest
Posts: n/a
 
      11-09-2003

"Ian Lazarus" <(E-Mail Removed)> wrote in message
news:Xfirb.220891$(E-Mail Removed)...
> 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...


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
inspect.stack() or inspect.currentframe() gives "list index out ofrange error" deluxstar Python 5 09-25-2010 05:12 PM
no ftp connection possible through cisco router with ip inspect Didier Cisco 0 01-27-2004 03:48 PM
ip inspect and access-list question didier Cisco 1 01-18-2004 01:02 AM
ip inspect name FastEthernet_0_0 smtp Rik Bain Cisco 3 11-12-2003 05:16 PM
Re: will the pix ever inspect http inbound?? Russ Johnson Cisco 1 10-16-2003 03:41 PM



Advertisments