From 3091e2fe5a8d6bf079508acfacc26edf14c65d1c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sun, 5 Jun 2022 10:49:21 +0200 Subject: [PATCH] add debug pretty-printing for OPEN_* flags as well --- src/drv_proxy.c | 9 ++++++++- src/drv_proxy_gen.pl | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/drv_proxy.c b/src/drv_proxy.c index 45d6352..5598100 100644 --- a/src/drv_proxy.c +++ b/src/drv_proxy.c @@ -8,6 +8,8 @@ #include "driver.h" +BIT_FORMATTER_FUNCTION(opts, OPEN) + typedef struct gen_cmd gen_cmd_t; typedef union proxy_store { @@ -162,7 +164,7 @@ static @type@proxy_@name@( store_t *gctx@decl_args@ ) debug( "%sEnter @name@@print_fmt_args@\n", ctx->label@print_pass_args@ ); @print_args@ @type@rv = ctx->real_driver->@name@( ctx->real_store@pass_args@ ); - debug( "%sLeave @name@, ret=@fmt@\n", ctx->label, rv ); + debug( "%sLeave @name@, ret=@print_fmt_ret@\n", ctx->label, @print_pass_ret@ ); return rv; } //# END @@ -239,6 +241,11 @@ static @type@proxy_@name@( store_t *gctx@decl_args@, void (*cb)( @decl_cb_args@v } //# END +//# DEFINE prepare_load_box_print_fmt_args , opts=%s +//# DEFINE prepare_load_box_print_pass_args , fmt_opts( opts ).str +//# DEFINE prepare_load_box_print_fmt_ret %s +//# DEFINE prepare_load_box_print_pass_ret fmt_opts( rv ).str + //# DEFINE load_box_pre_print_args char ubuf[12]; //# END diff --git a/src/drv_proxy_gen.pl b/src/drv_proxy_gen.pl index 28ddeeb..604c5bc 100755 --- a/src/drv_proxy_gen.pl +++ b/src/drv_proxy_gen.pl @@ -161,7 +161,8 @@ for (@ptypes) { $template = "REGULAR_VOID"; } else { $template = "REGULAR"; - $replace{'fmt'} = type_to_format($cmd_type); + $replace{'print_fmt_ret'} = type_to_format($cmd_type); + $replace{'print_pass_ret'} = "rv"; } $replace{'decl_args'} = $cmd_args; $replace{'print_pass_args'} = $replace{'pass_args'} = make_args($cmd_args);