wireshark/epan/wslua
Guy Harris 6b629c4d92 Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c.  Update their callers to include
<epan/show_exception.h> to get their declaration.

Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff.  Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).

Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).

Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.

Use show_exception() to report non-fatal errors, rather than doing it
yourself.
 
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.

Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.

Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.

svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
..
CMakeLists.txt Update Free Software Foundation address. 2012-06-28 22:56:06 +00:00
Makefile.am Update Free Software Foundation address. 2012-06-28 22:56:06 +00:00
Makefile.nmake Add a "-build" argument to checkAPIs.pl. Use that argument when building 2012-04-04 20:46:49 +00:00
console.lua Update Free Software Foundation address. 2012-06-28 22:56:06 +00:00
dtd_gen.lua Update Free Software Foundation address. 2012-06-28 22:56:06 +00:00
init_wslua.c Move show_exception() and show_reported_bounds_error() to 2013-02-27 22:43:54 +00:00
lua_bitop.c Fix some system header files that were #included with "" instead of <>. 2012-07-18 02:47:56 +00:00
make-init-lua.pl Update Free Software Foundation address. 2012-06-28 22:56:06 +00:00
make-reg.pl We always HAVE_CONFIG_H so don't bother checking whether we have it or not. 2012-09-20 01:48:30 +00:00
make-taps.pl OK, fine, maybe sometimes it's used; flag it with _U_ while we're at it. 2012-12-26 06:07:04 +00:00
taps Update Free Software Foundation address. 2012-06-28 22:56:06 +00:00
template-init.lua Fix typos/errors and make Lua API more consistent. 2013-02-25 22:05:28 +00:00
wslua.h Move show_exception() and show_reported_bounds_error() to 2013-02-27 22:43:54 +00:00
wslua_dumper.c Fix typos/errors and make Lua API more consistent. 2013-02-25 22:05:28 +00:00
wslua_field.c Fix typos/errors and make Lua API more consistent. 2013-02-25 22:05:28 +00:00
wslua_gui.c Fix typos/errors and make Lua API more consistent. 2013-02-25 22:05:28 +00:00
wslua_listener.c Fix typos/errors and make Lua API more consistent. 2013-02-25 22:05:28 +00:00
wslua_pinfo.c Fix typos/errors and make Lua API more consistent. 2013-02-25 22:05:28 +00:00
wslua_proto.c Move show_exception() and show_reported_bounds_error() to 2013-02-27 22:43:54 +00:00
wslua_tree.c Fix typos/errors and make Lua API more consistent. 2013-02-25 22:05:28 +00:00
wslua_tvb.c Fix a misspelled word; Do some minor tweaking of the wording of a few comments. 2013-02-26 15:10:28 +00:00
wslua_util.c Fix typos/errors and make Lua API more consistent. 2013-02-25 22:05:28 +00:00