Tarantool development patches archive
 help / color / mirror / Atom feed
From: Maxim Kokryashkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: "Sergey Kaplun" <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches]  [PATCH luajit 1/2] gdb: introduce dumpers for GCobj
Date: Mon, 04 Jul 2022 18:24:43 +0300	[thread overview]
Message-ID: <1656948283.336822639@f748.i.mail.ru> (raw)
In-Reply-To: <7539a0ac196ba192636d5f6cfc1c03d9f50f7c4a.1654767443.git.skaplun@tarantool.org>

[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]


Hi, Sergey!
 
Thanks for the patch!
 
LGTM, except for the single nit below.
 
<snipped>
>
>+def dump_lj_tv_lightud(tv):
>+ return dump_lj_gco_lightud(gcval(tv['gcr']))
>+
>+def dump_lj_tv_str(tv):
>+ return dump_lj_gco_str(gcval(tv['gcr']))
>+
>+def dump_lj_tv_upval(tv):
>+ return dump_lj_gco_upval(gcval(tv['gcr']))
>+
>+def dump_lj_tv_thread(tv):
>+ return dump_lj_gco_thread(gcval(tv['gcr']))
>+
>+def dump_lj_tv_proto(tv):
>+ return dump_lj_gco_proto(gcval(tv['gcr']))
>+
>+def dump_lj_tv_func(tv):
>+ return dump_lj_gco_func(gcval(tv['gcr']))
>+
>+def dump_lj_tv_trace(tv):
>+ return dump_lj_gco_trace(gcval(tv['gcr']))
> 
>-def dump_lj_tnumx(tv):
>+def dump_lj_tv_cdata(tv):
>+ return dump_lj_gco_cdata(gcval(tv['gcr']))
>+
>+def dump_lj_tv_tab(tv):
>+ return dump_lj_gco_tab(gcval(tv['gcr']))
>+
>+def dump_lj_tv_udata(tv):
>+ return dump_lj_gco_udata(gcval(tv['gcr']))
>+
I think we can replace that load of wrappers with something
that looks more or less like that:
 
1 | gco_to_wrap = [func for func in globals().keys() if func.startswith('dump_lj_gco')]
2 |
3 | for func_name in gco_to_wrap:
4 |    wrapped_func_name = func_name.replace('gco', 'tv')
5 |    globals()[wrapped_func_name] = lambda tv: globals()[func_name](gcval(tv['gcr']))
 
I am not really sure if it is harder to read for those who are not really familiar
with python, so feel free to ignore.
 
<snipped>
--
Best regards,
Maxim Kokryashkin
 

[-- Attachment #2: Type: text/html, Size: 1997 bytes --]

  reply	other threads:[~2022-07-04 15:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09 10:11 [Tarantool-patches] [PATCH luajit 0/2] Introduce dumpers for bytecodes in gdb Sergey Kaplun via Tarantool-patches
2022-06-09 10:11 ` [Tarantool-patches] [PATCH luajit 1/2] gdb: introduce dumpers for GCobj Sergey Kaplun via Tarantool-patches
2022-07-04 15:24   ` Maxim Kokryashkin via Tarantool-patches [this message]
2022-07-14 12:08     ` Sergey Kaplun via Tarantool-patches
2022-07-19  8:39       ` Maxim Kokryashkin via Tarantool-patches
2022-06-09 10:11 ` [Tarantool-patches] [PATCH luajit 2/2] gdb: introduce lj-bc, lj-func and lj-proto dumpers Sergey Kaplun via Tarantool-patches
2022-07-04 16:10   ` Maxim Kokryashkin via Tarantool-patches
2022-07-14 15:41     ` Sergey Kaplun via Tarantool-patches
2022-07-19  8:40       ` Maxim Kokryashkin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1656948283.336822639@f748.i.mail.ru \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=m.kokryashkin@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches]  [PATCH luajit 1/2] gdb: introduce dumpers for GCobj' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox