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

@ -156,7 +156,7 @@ log_closure(struct wl_resource *resource,
struct wl_protocol_logger_message message;
if (debug_server)
wl_closure_print(closure, object, send, false);
wl_closure_print(closure, object, send, false, NULL);
if (!wl_list_empty(&display->protocol_loggers)) {
message.resource = resource;