From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (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 5A476469719 for ; Tue, 3 Mar 2020 17:16:26 +0300 (MSK) Date: Tue, 3 Mar 2020 17:16:25 +0300 From: Sergey Ostanevich Message-ID: <20200303141625.GB188@tarantool.org> References: <20200226224148.pq3mqfd4amh63rqd@tkn_work_nb> <20200228104613.GQ404@tarantool.org> <20200302160044.GX404@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200302160044.GX404@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2 luajit 0/3] Introduce gdb extension for LuaJIT List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Hi! Thanks for the update, LGTM for me. regards, Sergos On 02 мар 19:00, Igor Munkin wrote: > OK, this fix doesn't work e.g. for luajit w/o debuginfo. Consider the > following: > > | > | luajit-gdb.py initialization is postponed until libluajit objfile is loaded > | Reading symbols from /home/imun/projects/tarantool-luajit/src/luajit... > | (No debugging symbols found in /home/imun/projects/tarantool-luajit/src/luajit) > | luajit-gdb.py initialization is postponed until libluajit objfile is loaded > | > > The extension initialization goes in loops, since it fails to find > luaJIT_setmode global symbol. I didn't investigate the problem a lot, > just made the extension work. > > On 28.02.20, Igor Munkin wrote: > > > > > + if not gdb.lookup_global_symbol('luaJIT_setmode'): > > + gdb.write('luajit-gdb.py initialization is postponed ' > > + 'until libluajit objfile is loaded\n') > > + gdb.events.new_objfile.connect(load) > > + return > > + > > Here is the problem, so I rewrote it the following way: > > ================================================================================ > > diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py > index 2e20642..f142fc5 100644 > --- a/src/luajit-gdb.py > +++ b/src/luajit-gdb.py > @@ -662,7 +662,9 @@ The command requires no args and dumps current GC stats: > def init(commands): > global LJ_64, LJ_GC64, LJ_FR2 > > - if not gdb.lookup_global_symbol('luaJIT_setmode'): > + try: > + gdb.parse_and_eval('luaJIT_setmode') > + except: > gdb.write('luajit-gdb.py initialization is postponed ' > 'until libluajit objfile is loaded\n') > gdb.events.new_objfile.connect(load) > > ================================================================================ > > Squashed, force-pushed to the branch. > > > > > > > -- > > Best regards, > > IM > > -- > Best regards, > IM