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

Wireshark-dev: Re: [Wireshark-dev] Quickly determine where your duplicate ett_definition is ...

From: Peter Wu <peter@xxxxxxxxxxxxx>
Date: Tue, 5 Nov 2019 10:43:28 +0000
On Thu, Oct 17, 2019 at 12:00:07PM -0700, Richard Sharpe wrote:
> Hi folks,
> 
> I just had a nasty issue with duplicate ett_* entries (well, one, actually).
> 
> The issue was in dissector A but I was working on dissector B and had
> not run Wireshark after building with the changes in A, so it looked
> like the issue was in B.
> 
> I notice that proto_register_subtree_array does not take any
> parameters indicating which dissector it is called from.
> 
> Could we make that call a macro that passes the code line and function
> name as the last two parameters so the g_error printed out can tell us
> where the problem lies?

These issues are so rare, I would rather not complicate this routine.
It would also have some overhead since every group of etts would have to
be registered with the affected dissector.

> In the end I used gdb to figure it out, but life would have been
> easier if the error message told me.

Use of a debugger seems an appropriate approach since you can easily
obtain a backtrace from it, and print the address of the ett item to
learn which dissector registered the ett.
-- 
Kind regards,
Peter Wu
https://lekensteyn.nl