debug: Fix printing of new ids

The client side closure traces have incorrect object ids for new server
generated objects. This is because create_proxies() overwrites the id in
'n' type arguments by storing a pointer to the actual object in the 'o'
field of the union.

Getting back to an id from this pointer requires accessing a structure
that isn't visible outside of wayland-client.c.

Add a function pointer to fish the correct value out of the argument and
pass it to wl_closure_print.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2021-08-24 17:08:51 -05:00 committed by Daniel Stone
parent 9c05e6c475
commit ca893075ef
4 changed files with 29 additions and 9 deletions

View file

@ -211,7 +211,8 @@ wl_closure_queue(struct wl_closure *closure, struct wl_connection *connection);
void
wl_closure_print(struct wl_closure *closure,
struct wl_object *target, int send, int discarded);
struct wl_object *target, int send, int discarded,
uint32_t (*n_parse)(union wl_argument *arg));
void
wl_closure_destroy(struct wl_closure *closure);