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 3D68B562373; Thu, 3 Aug 2023 10:48:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3D68B562373 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1691048938; bh=o3HVI8cPknm+gszXlk2BStEAVIi95pV8pxIdpNZTh1M=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=rwN0mqEggJQhsG96DlBWIkMI6OmzIz0prQV9PNZqYfd+PnRHyYatFwkFjfHqLNIFg KfnT6NabruJO6PAcgZbbHGKgiTUcLJDmddQ9p1nfkaFGFxpBS5o3lzGGdpAEpJhKOc Ci8UM+5l+1r6GHNt90w/0gcvpooue8CmFAZvJJ9s= Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [95.163.41.96]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 054FD562373 for ; Thu, 3 Aug 2023 10:44:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 054FD562373 Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1qRT08-000EDQ-2W; Thu, 03 Aug 2023 10:44:05 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Thu, 3 Aug 2023 07:30:35 +0000 Message-Id: <8bbf5e3f00102d4e71f451c82de00bafe775518c.1691047132.git.imun@tarantool.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD93761F2630DFFAF4106610A4783CEB24278EC05A2247AC8B7182A05F538085040C192AD3AF7D18A90325CEC2678E6041D4FFE50650615F2DC2641D46BB34D745E X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE716FAD50E497B9C14EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E8DF562B6063DE0A8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8D7EEC580D9F9E426A5932AE515FFD03A117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC60CDF180582EB8FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209647ADFADE5905B16FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE1E561CDFBCA1751F040F9FF01DFDA4A84AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3A333A05395E4745B76E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C2249957A4DEDD2346B42E827F84554CEF50127C277FBC8AE2E8B2EE5AD8F952D28FBAAAE862A0553A39223F8577A6DFFEA7CC1948A84299AD5C643847C11F186F3C59DAA53EE0834AAEE X-B7AD71C0: 6FEFE4C63DFE2D85A738F0139E645D6121512D861BDD37F8E8C45197E62BCD8AE8F7B195E1C9783174ED69E5B088E266E7218EB9B50BAE8A X-C1DE0DAB: 0D63561A33F958A535F6FA1080DF834D43F7D6B393291FE03A6B84EFDB8A853EF87CCE6106E1FC07E67D4AC08A07B9B04AB4081B6A6C2E079C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A0997E3FB2386030E77 X-C8649E89: 1C3962B70DF3F0AD75DCE07D45A749953FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF8B27AC7539B2363B9A6C5AEC54D2DECDF120897AE337DAFC03A8AF25733B6A8116D5D591715857EC8553022043D0BC9AB2D4198EAE816ECEB97714D6832202E7A74DFFEFA5DC0E7F02C26D483E81D6BEECAEF3E2CCC1ED8C383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojcir52QaMQ83t1C1eiM8WCQ== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D531C55F6AC43F6B032876895B18F1A60846955FF3E630B0E9412326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 10/15] test: fix E305 errors by pycodestyle 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Fixed 10 occurrences of E305 ("expected 2 blank lines after class or function definition, found 1") error reported by pycodestyle[1]. Furthermore, some other spots have been re-aligned the similar way to be in sync with the default code style. [1]: https://www.flake8rules.com/rules/E305.html Signed-off-by: Igor Munkin --- src/luajit-gdb.py | 15 +++++++++++++++ src/luajit_lldb.py | 10 ++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py index 9c51be0b..3babb1d5 100644 --- a/src/luajit-gdb.py +++ b/src/luajit-gdb.py @@ -7,6 +7,7 @@ import sys # make script compatible with the ancient Python {{{ + LEGACY = re.match(r'^2\.', sys.version) if LEGACY: @@ -14,8 +15,10 @@ if LEGACY: int = long range = xrange + # }}} + gtype_cache = {} @@ -70,8 +73,10 @@ def strx64(val): return re.sub('L?$', '', hex(int(cast('uint64_t', val) & 0xFFFFFFFFFFFFFFFF))) + # Types {{{ + LJ_T = { 'NIL': i2notu32(0), 'FALSE': i2notu32(1), @@ -95,10 +100,12 @@ def typenames(value): LJ_T[k]: 'LJ_T' + k for k in LJ_T.keys() }.get(int(value), 'LJ_TINVALID') + # }}} # Frames {{{ + FRAME_TYPE = 0x3 FRAME_P = 0x4 FRAME_TYPEP = FRAME_TYPE | FRAME_P @@ -175,10 +182,12 @@ def frame_prev(framelink): def frame_sentinel(L): return mref('TValue *', L['stack']) + LJ_FR2 + # }}} # Const {{{ + LJ_64 = None LJ_GC64 = None LJ_FR2 = None @@ -194,6 +203,7 @@ LJ_LIGHTUD_BITS_LO = 47 - LJ_LIGHTUD_BITS_SEG LIGHTUD_SEG_MASK = (1 << LJ_LIGHTUD_BITS_SEG) - 1 LIGHTUD_LO_MASK = (1 << LJ_LIGHTUD_BITS_LO) - 1 + # }}} @@ -339,6 +349,7 @@ def gcringlen(root): else: return 1 + gclistlen(gcnext(root), gcref(root)) + gclen = { 'root': gclistlen, 'gray': gclistlen, @@ -374,6 +385,7 @@ def lightudV(tv): else: return gcval(tv['gcr']) + # Dumpers {{{ @@ -465,8 +477,10 @@ def dump_lj_tnumx(tv): def dump_lj_invalid(tv): return 'not valid type @ {}'.format(strx64(gcval(tv['gcr']))) + # }}} + dumpers = { 'LJ_TNIL': dump_lj_tnil, 'LJ_TFALSE': dump_lj_tfalse, @@ -867,4 +881,5 @@ def load(event=None): 'lj-gc': LJGC, }) + load(None) diff --git a/src/luajit_lldb.py b/src/luajit_lldb.py index bdd9e716..325b40ec 100644 --- a/src/luajit_lldb.py +++ b/src/luajit_lldb.py @@ -18,6 +18,8 @@ LJ_GCVMASK = ((1 << 47) - 1) LJ_TISNUM = None # Debugger specific {{{ + + # Global target = None @@ -121,6 +123,7 @@ class Struct(metaclass=MetaStruct): def addr(self): return self.value.address_of + c_structs = { 'MRef': [ (property(lambda self: self['ptr64'].unsigned if LJ_GC64 else self['ptr32'].unsigned), 'ptr') @@ -212,9 +215,11 @@ c_structs = { 'BCIns': [] } + for cls in c_structs.keys(): globals()[cls] = type(cls, (Struct, ), {'metainfo': c_structs[cls]}) + for cls in Struct.__subclasses__(): ptr_name = cls.__name__ + 'Ptr' @@ -363,6 +368,7 @@ def dbg_eval(expr): frame = thread.GetSelectedFrame() return frame.EvaluateExpression(expr) + # }}} Debugger specific @@ -396,6 +402,7 @@ def gcringlen(root): else: return 1 + gclistlen(gcnext(root), gcref(root)) + gclen = { 'root': gclistlen, 'gray': gclistlen, @@ -630,6 +637,7 @@ def dump_lj_tnumx(tv): def dump_lj_invalid(tv): return 'not valid type @ {}'.format(strx64(gcval(tv.gcr))) + dumpers = { 'LJ_TNIL': dump_lj_tnil, 'LJ_TFALSE': dump_lj_tfalse, @@ -647,6 +655,7 @@ dumpers = { 'LJ_TNUMX': dump_lj_tnumx, } + LJ_T = { 'NIL': i2notu32(0), 'FALSE': i2notu32(1), @@ -682,6 +691,7 @@ def typenames(value): def dump_tvalue(tvptr): return dumpers.get(typenames(itypemap(tvptr)), dump_lj_invalid)(tvptr) + FRAME_TYPE = 0x3 FRAME_P = 0x4 FRAME_TYPEP = FRAME_TYPE | FRAME_P -- 2.30.2