This wiki has been migrated to https://gitlab.com/wireshark/wireshark/-/wikis/home and is now deprecated. Please use that site instead.
Differences between revisions 1 and 2
Revision 1 as of 2005-01-20 09:11:13
Size: 637
Editor: UlfLamping
Comment: how to fix a bug in packet number 1234
Revision 2 as of 2005-01-20 10:44:24
Size: 842
Editor: GuyHarris
Comment: Mention conditional breakpoints.
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:

Some debuggers, such as gdb, also let you make breakpoints conditional; you could set a breakpoint at some point in a routine, and make the condition for the breakpoint be {{{pinfo->fd->num == 1234}}}.

Development Tips

Here you will find various tips useful while development and debugging.

Breakpoint on a specific packet number

Often you know, that you have a bug/problem in your dissector, which can be found only in a specific packet.

Let's say you know packet number 1234 has a bug, so you can add the following to your code:

{{{ if(pinfo->fd->num == 1234) {

  • printf("Here is my bug\n");

} }}}

and simply set a breakpoint to the printf call.

Of course you will need access to pinfo, but this should be the case in any dissector.

Don't forget to remove this later, after you've found your bug :-)

Some debuggers, such as gdb, also let you make breakpoints conditional; you could set a breakpoint at some point in a routine, and make the condition for the breakpoint be pinfo->fd->num == 1234.

Development/Tips (last edited 2019-02-01 14:23:13 by PeterWu)