Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: Re: [Ethereal-dev] help: new dissector debugging questions

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Richard van der Hoff <richard@xxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Apr 2004 09:42:35 +0100
Wei Li (Michael) wrote:
Hi, There is sth weird when I am debugging a new dissector in Ethereal. During debugging, the execution order of program statements is not following the program flow. For example, in the following capture of debugging session, it jumpped around the statement 2105 quite a few times until finally execute it. I have never met such problems with GDB.

That's because the code's been optimised by the compiler and is no
longer in the same order as the source.

Try rerunning configure with

CFLAGS=-O0 ./configure [options]

and rebuild.

By the way, after I successfully dissect the first two packets in the
dump file, the program suddenly aborted because of failing on the following assertion: ** ERROR **: file tvbuff.c: line 379 (check_offset_length_no_exception): assertion failed: (tvb->initialized). Could anybody help me out here?

Er, you passed the tvbuff routines an uninitialised tvbuff?

When I trace step by step into the major routine dissect_protoname( ), the (proto_tree * tree) changed to NULL one step into the routine while the passed-in argument is not NULL. Besides, the pinfo->cinfo pointer changed to NULL after I call asn1_open( ) method.

Again, sounds like it may be due to optimisation and may go away when
you disable optimisation.

If possible, can someone give me a link about the whole architecture
of Ethereal, the sequence diagram, or the call flow or something like
that.

I take it you've read doc/README.developer?

Richard