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 A85126F153; Thu, 1 Sep 2022 02:17:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A85126F153 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1661987827; bh=RpL1Z0HUoOuit4x6la/ICWU0FfA+serN4LBWPMNPGYc=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=G3+73ip9DkjuVZx0+WiHX8P9rtdVokeA2sHKrqpYnpz06R/212Z8nK7y8oLAC/E1Y AvdwvKaryN7GuAq5Q3mYqNsuWQ0BHbkw5H5RFOy8FzVIbhk2Z57YPeiSshFqxqAm+J VijVHGbv/R6LvI1dyXDnB83nYO+ratSuQrbM3wPs= Received: from smtp35.i.mail.ru (smtp35.i.mail.ru [94.100.177.95]) (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 F14926F153 for ; Thu, 1 Sep 2022 02:17:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F14926F153 Received: by smtp35.i.mail.ru with esmtpa (envelope-from ) id 1oTWxE-0002hH-6Z; Thu, 01 Sep 2022 02:17:04 +0300 Message-ID: Date: Thu, 1 Sep 2022 02:17:02 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: Igor Munkin , Mikhail Elhimov Cc: tarantool-patches@dev.tarantool.org References: <9eaffd397e8ebb3ccb898d50686249b9edd3f02f.1658531255.git.m.elhimov@vk.team> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9BF9AC82A1D2D723726E00519A4B1BBAA4A61EF3D98871484182A05F5380850405F285378688B8F1A1471F326B0BE691FAC110DE400D2C735DAE241550A5FE2FC X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE705B79473340BE836C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7798B95EC47D21699EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B8859CA687ABA27BA584C9CC0013AFD9D09B9B05D08BDD54420879F7C8C5043D14489FFFB0AA5F4BF176DF2183F8FC7C06030C3405640F6718941B15DA834481FA18204E546F3947CEDCF5861DED71B2F389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D2A98E5A6551E3E5117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF11334A1F18504230BA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6623A6A3D360573D276E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C590056E1B436ACBA43847C11F186F3C59DAA53EE0834AAEE X-B7AD71C0: 1B70FBA5C9BEEE72C9761FC34675ADEB871C96603B655635EE9D5CB6078CC77C777E1B54B706759DEFFFE7C7C1A70394 X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E142185AC9E3593CE4B31AB1881A6453793CE9274300E5CE05BD4401A9E91200F654B0DDDEAE67FA777B9C523897933F9F8387BE520D8CF5563FF8A5C081B9F9DBF5819C2B6934AE262D3EE7EAB7254005DCED8DA55E71E02F9FC08E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D341B5517184E88C1BD3BDF14AC2CAC230BB5DAE12A0D689F769BB2316677D6E2A4A8990C84E2CB91FD1D7E09C32AA3244C15392228240415E4B8D5A10CB702D6DF63871F383B54D9B3FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojxzT94hBWyprAjrp0HMWplQ== X-Mailru-Sender: 49D287FBCBBF3A5C9DDD0AAA0179FAA784BF1411757B67753DF12E78DC6544D37C304CEE7CAA1E4E4CA08BFBBB45AAA72C22B24405C8F0CCB7331131FBF1F0346646DC4FAA7499610DD12ECE0827B3FF5685057D9971753F22B820C1B2086D890DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/2] gdb: adjust to support python2 (centos 7) 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: Mikhail Elhimov via Tarantool-patches Reply-To: Mikhail Elhimov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Igor! Thanks for the review! On 31.08.2022 17:47, Igor Munkin wrote: > Misha, > > Thanks for the patch! Almost LGTM after your fixes for Sergey comments: > please, consider the last nit, I found. > > On 23.07.22, Mikhail Elhimov via Tarantool-patches wrote: >> Stop using unpacking arguments within list initialization as python2 >> only supports it in function call >> >> fixes tarantool/luajit#7458 >> --- >> src/luajit-gdb.py | 22 ++++++++++++---------- >> 1 file changed, 12 insertions(+), 10 deletions(-) >> >> diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py >> index baf66f66..1e9a96fb 100644 >> --- a/src/luajit-gdb.py >> +++ b/src/luajit-gdb.py >> @@ -432,15 +432,16 @@ def dump_stack(L, base=None, top=None): >> maxstack = mref('TValue *', L['maxstack']) >> red = 5 + 2 * LJ_FR2 >> >> - dump = '\n'.join([ >> - '{padding} Red zone: {nredslots: >2} slots {padding}'.format( >> - padding = '-' * len(PADDING), >> - nredslots = red, >> - ), >> - *( >> - dump_stack_slot(L, maxstack + offset, base, top, '') >> - for offset in range(red, 0, -1) >> - ), >> + dump = [] > Please move this line to the "definition" section above to save the > original structure. Fixed. I personally prefer to do similar operations (populating of `dump` list) in a similar way (call appropriate "populating" method). For me populating-over-initialization is not the "similar" way here, and I'd use it here only if I could initialize whole list at once (as it was before). Anyway, if you find that it saves the original structure then let it be ) >> + dump.append('{padding} Red zone: {nredslots: >2} slots {padding}'.format( >> + padding = '-' * len(PADDING), >> + nredslots = red, >> + )) >> + dump.extend([ >> + dump_stack_slot(L, maxstack + offset, base, top, '') >> + for offset in range(red, 0, -1) >> + ]) >> + dump.extend([ >> '{padding} Stack: {nstackslots: >5} slots {padding}'.format( >> padding = '-' * len(PADDING), >> nstackslots = int((tou64(maxstack) - tou64(stack)) >> 3), >> @@ -451,7 +452,8 @@ def dump_stack(L, base=None, top=None): >> end = strx64(maxstack - 1), >> nfreeslots = int((tou64(maxstack) - tou64(top) - 8) >> 3), >> ), >> - ]) + '\n' >> + ]) >> + dump = '\n'.join(dump) + '\n' >> >> slot = top >> framelink = base - (1 + LJ_FR2) >> -- >> 2.34.1 >> =================================================== diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py index baf66f66..9846f3a2 100644 --- a/src/luajit-gdb.py +++ b/src/luajit-gdb.py @@ -432,15 +432,17 @@ def dump_stack(L, base=None, top=None):      maxstack = mref('TValue *', L['maxstack'])      red = 5 + 2 * LJ_FR2 -    dump = '\n'.join([ +    dump = [          '{padding} Red zone: {nredslots: >2} slots {padding}'.format(              padding = '-' * len(PADDING),              nredslots = red,          ), -        *( -            dump_stack_slot(L, maxstack + offset, base, top, '') -                for offset in range(red, 0, -1) -        ), +    ] +    dump.extend([ +        dump_stack_slot(L, maxstack + offset, base, top, '') +            for offset in range(red, 0, -1) +    ]) +    dump.extend([          '{padding} Stack: {nstackslots: >5} slots {padding}'.format(              padding = '-' * len(PADDING),              nstackslots = int((tou64(maxstack) - tou64(stack)) >> 3), @@ -451,7 +453,8 @@ def dump_stack(L, base=None, top=None):              end = strx64(maxstack - 1),              nfreeslots = int((tou64(maxstack) - tou64(top) - 8) >> 3),          ), -    ]) + '\n' +    ]) +    dump = '\n'.join(dump) + '\n'      slot = top      framelink = base - (1 + LJ_FR2) =================================================== -- Best regards, Mikhail Elhimov