From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 433BD6F3C8; Thu, 6 Oct 2022 12:02:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 433BD6F3C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1665046923; bh=dAVa51rn791ZE7BQYEbx+T1lQvLRkn6hf27gIxeorHI=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=QfhgR8Rcs8NeJXAubXyB3gNA7S8UuVV6cj8gCcJBHTgb3euVujHJRktRhFHeSeyzW Jt96Ghb83CWWbK3iOdwwj0wPJ1JavPxbOMYheA4ujxqC1yvcaoMg7fC7eqh+fnFlgV Q/x8Vh1W+Gq20FCoInW1/iy7cS84aiE2ZPNI2l/E= Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id CFE316F3C8 for ; Thu, 6 Oct 2022 12:02:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CFE316F3C8 Received: by smtp51.i.mail.ru with esmtpa (envelope-from ) id 1ogMlV-0003iH-3Z; Thu, 06 Oct 2022 12:02:01 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) In-Reply-To: <20221005144331.39666-1-m.kokryashkin@tarantool.org> Date: Thu, 6 Oct 2022 12:02:00 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20221005144331.39666-1-m.kokryashkin@tarantool.org> To: Maxim Kokryashkin X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9EA63AAA3C7549E8E20E78EB8CD0ED25942078F1F848836AE00894C459B0CD1B9DFFFF2F6F7AFCD204444B24A9B284CF3201FAB0D7183801CE1BDF786614B4017 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DB84ED444C624799EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F88016AB904663428638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B25CF0A88DA2EC56C2D10A789D3A2BD2A6C5BC91295CC49E52D2E47CDBA5A96583C09775C1D3CA48CFEF0AF71940E62277117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7850F8B975A76562C9FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE770EE682517BB4314D32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C0436E5D5C25C4A223CD04E86FAF290E2DB606B96278B59C421DD303D21008E29813377AFFFEAFD269176DF2183F8FC7C0C70DDB8F70474A6A68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CE0F3BA37685B2B9043847C11F186F3C59DAA53EE0834AAEE X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D349EC559D073CA5B6829E0D20C9CCAE4DEE678ACBF61B85E21BD2EA134D5E196C6242182252573A37B1D7E09C32AA3244CB61950100D11665DB7BA7A062B922EAF63871F383B54D9B3927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojSBWEoeHrZs+4/MyJZvUQsw== X-Mailru-Sender: 5AA3D5B9D8C486465A7E7C48E78B605D402A67FC473482268D6C94D80B3960FA6ECF975C7BB2667F60D8632BEC246C7D55B4A2144138A8805FC805B5969CB4993EE16157CC7DAB4272D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] luajit-gdb: support full-range 64-bit lightud X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: sergos via Tarantool-patches Reply-To: sergos Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Max! Thanks for the patch! 0. Please, add Mikhail to review. > On 5 Oct 2022, at 17:43, Maxim Kokryashkin = wrote: >=20 > Following up the introduction of full-range 64-bit lightuserdata > support in commit 2cacfa8 ("Add support for full-range 64 bit > lightuserdata."), this patch modifies the corresponding dumper > behavior for LJ_64 platforms in the luajit-gdb extension. >=20 > Resolves tarantool/tarantool#6481 > --- > Branch: = https://github.com/tarantool/luajit/tree/fckxorg/gh-6481-luajit-gdb-light-= ud > Issue: https://github.com/tarantool/tarantool/issues/6481 > src/luajit-gdb.py | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) >=20 > diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py > index 6480d014..2993f2c1 100644 > --- a/src/luajit-gdb.py > +++ b/src/luajit-gdb.py > @@ -166,6 +166,9 @@ LJ_GCVMASK =3D ((1 << 47) - 1) > LJ_TISNUM =3D None > PADDING =3D None >=20 > +LJ_LIGHTUD_BITS_SEG =3D 8 > +LJ_LIGHTUD_BITS_LO =3D 47 - LJ_LIGHTUD_BITS_SEG 1. Is this =E2=80=9947=E2=80=99 literal has the same meaning as the one = above in the =E2=80=98LJ_GCVMASK=E2=80=99=20 definition and the one below in the =E2=80=98itype()=E2=80=99 = function?=20 Shall we introduce a constant to avoid running across the code to fix = all =E2=80=9947=E2=80=99s=20 later on? > + > # }}} >=20 > def itype(o): > @@ -315,6 +318,12 @@ def frames(L): > break > framelink =3D frame_prev(framelink) >=20 > +def lightudseg(u): > + return (u >> LJ_LIGHTUD_BITS_LO) & ((1 << LJ_LIGHTUD_BITS_SEG) - 1) > + > +deflightudlo(u): > + return u & ((1 << LJ_LIGHTUD_BITS_LO) - 1) > + 2a. Did you expect to reuse these two above somewhere else later? Also, the '((1 << LJ_LIGHTUD_BITS_LO) - 1)=E2=80=99 is a constant, = can be named =E2=80=98LJ_LIGHTUD_BITS_MASK=E2=80=99. Then the whole = =E2=80=98lightudlo=E2=80=99 is just an =E2=80=98&=E2=80=99 with this constant. The same can be done for _SEG_MASK and we can proceed = to 2b. > # Dumpers {{{ >=20 > def dump_lj_tnil(tv): > @@ -327,7 +336,14 @@ def dump_lj_ttrue(tv): > return 'true' >=20 > def dump_lj_tlightud(tv): > - return 'light userdata @ {}'.format(strx64(gcval(tv['gcr']))) > + if LJ_64: > + u =3D int(tv['u64']) > + seg =3D lightudseg(u) > + segmap =3D mref('uint32_t *', G(L(None))['gc']['lightudseg']) > + addr =3D (int(segmap[seg]) << 32) | lightudlo(u) 2b. Otherwise why not to put the whole iff clause above into a separate = function? > + else: > + addr =3D gcval(tv['gcr']) > + return 'light userdata @ {}'.format(strx64(addr)) >=20 > def dump_lj_tstr(tv): > return 'string {body} @ {address}'.format( > --=20 > 2.36.1 >=20