xwm: Add an X11 error tracing infrastructure

This adds some infrastructure that records the current X11 sequence
number, file name, and line number at various places. When an X11 error
later comes in, this tracing infrastructure can use the sequence number
of the error to figure out which piece of code caused this X11 error.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2021-01-09 13:11:53 +01:00
parent c2f51f2705
commit 744fa2e1b7
5 changed files with 109 additions and 0 deletions

View file

@ -12,6 +12,7 @@
#include <xcb/xcb_errors.h>
#endif
#include "xwayland/selection.h"
#include "xwayland/trace.h"
/* This is in xcb/xcb_event.h, but pulling xcb-util just for a constant
* others redefine anyway is meh
@ -98,6 +99,7 @@ struct wlr_xwm {
struct wlr_xwayland *xwayland;
struct wl_event_source *event_source;
struct wlr_seat *seat;
struct wlr_x11_trace trace;
uint32_t ping_timeout;
xcb_atom_t atoms[ATOM_LAST];