announcing wldbg

Marek Chalupa mchqwerty at
Wed Jul 22 07:27:46 PDT 2015

Hi folks,

It's been some time since I started developing a tool called wldbg in my 
free time. I'm using it while debugging applications based on wayland 
and I think it is in enough good shape to bring it out (although there 
is still a lot of missing features I'd like to add/fix)

It can work in few modes. One mode takes a list of modules (I call them
passes, like LLVM passes) and run functions from these modules on every
message that goes through wayland socket (one function for incoming 
messages, one for outcoming). Each module can modify, dump,
take statistics, delay the message - whatever it wants (see 
passes/example.c in source tree)

Second mode is interactive gdb-like interface. You can set breakpoints,
hide or showonly some particular messages, display what objects clients
has, etc. This mode has few functions, but helped me a lot in some 
cases. The usage is very easy:

wldbg -i wayland-client

It will stop on the first message, waiting for commands.

Last mode is server mode. wldbg overtakes the bound socket and accepts
all new connections. It was originally developed for debugging Xwayland,
but since all compositors pass WAYLAND_SOCKET to Xwayland - therefore 
Xwayland don't bind to named socket, I don't use it much now. Maybe
somebody of you will :)

The source code is here:

Hopefully, some of you will find this tool helpful :)


More information about the wayland-devel mailing list