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 C7BB256A9A0; Tue, 8 Aug 2023 22:57:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C7BB256A9A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1691524633; bh=bXMHHNYdtaAeimai2q7VIsAew+fmbVk6W7Hi5rM6fo0=; 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=r+zUxXUoD7TdDfCgSO3fErkzlS6H0iT/XbvEA9Zw7bk2zatnbwRAFpbqCJFTFszbz BwmeggNpJyifB+ASOw/cXc6CKk16gm6bLcYCBfZcRlU0b9MBwVdPP507GoWNpzlAPE gcAZ+iSX9pvfHZdXcOdR3EIccl/QL5kUZ8EimQAA= Received: from smtp36.i.mail.ru (smtp36.i.mail.ru [95.163.41.77]) (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 554B056A9A0 for ; Tue, 8 Aug 2023 22:56:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 554B056A9A0 Received: by smtp36.i.mail.ru with esmtpa (envelope-from ) id 1qTSor-005nU0-2W; Tue, 08 Aug 2023 22:56:42 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Tue, 8 Aug 2023 19:42:40 +0000 Message-Id: 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: 4F1203BC0FB41BD969E04B5EED670DC868303E4FA23A046C075EC7AC197E9C0B182A05F53808504094565D33DC913B2B2EC357425D262D540AEBD1799F005C7017BADDB20389AF0B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73B44982FA5E78411EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006376AEB812070489DF38638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D85C987C37B5C09E7A955639084AB8DFA4117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC55D5BE2F85BDEC5FA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735204B6963042765DA4B618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EEB28585415E75ADA96B91AC3BD56FC247D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE389DDFE3E282F3DD16E0066C2D8992A16C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F790063788B3B24285A3CD0EEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5A16217E9E47B1BD59CEE3CB01E4BE55F3A6B84EFDB8A853EF87CCE6106E1FC07E67D4AC08A07B9B04AB4081B6A6C2E079C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A0997E3FB2386030E77 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFCBCE4BA071B1A1ABD897D3A4090F3AEF99723E0A84AB1F6D8E84562F7F112C6B9901B20BD73D67EE1529AA6C8ABD04CA0974C6E4E36F45B36F8059FCA6A0064EA74DFFEFA5DC0E7F02C26D483E81D6BEECAEF3E2CCC1ED8C383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojUzxoxvtYX2qRIhXCVS67ZA== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D5318460DAC02BEF7D43C351B6C36EB024A6955FF3E630B0E9412326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 19/15] test: fix E501 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 11 occurrences of E501 ("line too long") error reported by pycodestyle[1]. [1]: https://www.flake8rules.com/rules/E501.html Signed-off-by: Igor Munkin --- **NB**: This patch will be placed between "[PATCH luajit 10/15] test: fix E305 errors by pycodestyle" and "[PATCH luajit 11/15] test: fix E502 errors by pycodestyle" on the branch. CI: https://github.com/tarantool/luajit/actions/runs/5800936024/job/15724104222 src/luajit-gdb.py | 4 ++-- src/luajit_lldb.py | 55 +++++++++++++++++++++++++--------------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py index 9dcddb17..5eaf250f 100644 --- a/src/luajit-gdb.py +++ b/src/luajit-gdb.py @@ -430,9 +430,9 @@ def dump_lj_tfunc(tv): if ffid == 0: pt = funcproto(func) - return 'Lua function @ {addr}, {nupvals} upvalues, {chunk}:{line}'.format( + return 'Lua function @ {addr}, {nups} upvalues, {chunk}:{line}'.format( addr=strx64(func), - nupvals=int(func['nupvalues']), + nups=int(func['nupvalues']), chunk=strdata(cast('GCstr *', gcval(pt['chunkname']))), line=pt['firstline'] ) diff --git a/src/luajit_lldb.py b/src/luajit_lldb.py index 13d9f2e3..ef0986cc 100644 --- a/src/luajit_lldb.py +++ b/src/luajit_lldb.py @@ -50,10 +50,11 @@ class Ptr: if isinstance(other, int): return self.__add__(-other) else: - return int((self.value.unsigned - other.value.unsigned) / sizeof(self.normal_type.__name__)) + return int((self.value.unsigned - other.value.unsigned) + / sizeof(self.normal_type.__name__)) def __eq__(self, other): - assert isinstance(other, Ptr) or (isinstance(other, int) and other >= 0) + assert isinstance(other, Ptr) or isinstance(other, int) and other >= 0 if isinstance(other, Ptr): return self.value.unsigned == other.value.unsigned else: @@ -126,10 +127,12 @@ class Struct(metaclass=MetaStruct): c_structs = { 'MRef': [ - (property(lambda self: self['ptr64'].unsigned if LJ_GC64 else self['ptr32'].unsigned), 'ptr') + (property(lambda self: self['ptr64'].unsigned if LJ_GC64 + else self['ptr32'].unsigned), 'ptr') ], 'GCRef': [ - (property(lambda self: self['gcptr64'].unsigned if LJ_GC64 else self['gcptr32'].unsigned), 'gcptr') + (property(lambda self: self['gcptr64'].unsigned if LJ_GC64 + else self['gcptr32'].unsigned), 'gcptr') ], 'TValue': [ ('GCRef', 'gcr'), @@ -137,8 +140,9 @@ c_structs = { ('uint', 'i'), ('int', 'it64'), ('string', 'n'), - (property(lambda self: self['ftsz'].signed if LJ_GC64 else None), 'ftsz'), - (property(lambda self: FR(self['fr']) if not LJ_GC64 else None), 'fr') + (property(lambda self: FR(self['fr']) if not LJ_GC64 else None), 'fr'), + (property(lambda self: self['ftsz'].signed if LJ_GC64 else None), + 'ftsz') ], 'GCState': [ ('GCRef', 'root'), @@ -223,16 +227,10 @@ for cls in c_structs.keys(): for cls in Struct.__subclasses__(): ptr_name = cls.__name__ + 'Ptr' - def make_ptr_init(nm, cls): - return type( - nm, - (Ptr,), - { - '__init__': lambda self, value: super(type(self), self).__init__(value, cls) - } - ) - - globals()[ptr_name] = make_ptr_init(ptr_name, cls) + globals()[ptr_name] = type(ptr_name, (Ptr,), { + '__init__': + lambda self, value: super(type(self), self).__init__(value, cls) + }) class Command(object): @@ -590,9 +588,9 @@ def dump_lj_tfunc(tv): if ffid == 0: pt = funcproto(func) - return 'Lua function @ {addr}, {nupvals} upvalues, {chunk}:{line}'.format( + return 'Lua function @ {addr}, {nups} upvalues, {chunk}:{line}'.format( addr=strx64(func), - nupvals=func.nupvalues, + nups=func.nupvalues, chunk=strdata(cast(GCstrPtr, gcval(pt.chunkname))), line=pt.firstline ) @@ -737,7 +735,8 @@ def frame_prevl(framelink): # a struct member of 32-bit type to 64-bit type without getting onto # the next property bits, despite the fact that it's an actual value, not # a pointer to it. - return framelink - (1 + LJ_FR2 + bc_a(vtou64(dbg_eval('((BCIns *)' + str(frame_pc(framelink)) + ')[-1]')))) + bcins = vtou64(dbg_eval('((BCIns *)' + str(frame_pc(framelink)) + ')[-1]')) + return framelink - (1 + LJ_FR2 + bc_a(bcins)) def frame_ispcall(framelink): @@ -852,10 +851,15 @@ def dump_stack(L, base=None, top=None): nstackslots=int((maxstack - stack) >> 3), ), dump_stack_slot(L, maxstack, base, top), - '{start:{padding}}:{end:{padding}} [ ] {nfreeslots} slots: Free stack slots'.format( - start=strx64(top + 1), - end=strx64(maxstack - 1), - padding=len(PADDING), + '{start}:{end} [ ] {nfreeslots} slots: Free stack slots'.format( + start='{address:{padding}}'.format( + address=strx64(top + 1), + padding=len(PADDING), + ), + end='{address:{padding}}'.format( + address=strx64(maxstack - 1), + padding=len(PADDING), + ), nfreeslots=int((maxstack - top - 8) >> 3), ), ]) @@ -1075,9 +1079,10 @@ def register_commands(debugger, commands): for command, cls in commands.items(): cls.command = command debugger.HandleCommand( - 'command script add --overwrite --class luajit_lldb.{cls} {command}'.format( + 'command script add --overwrite --class luajit_lldb.{cls} {cmd}' + .format( cls=cls.__name__, - command=cls.command, + cmd=cls.command, ) ) print('{cmd} command intialized'.format(cmd=cls.command)) -- 2.30.2