From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (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 E36D7469719 for ; Thu, 27 Feb 2020 01:41:50 +0300 (MSK) Date: Thu, 27 Feb 2020 01:41:48 +0300 From: Alexander Turenko Message-ID: <20200226224148.pq3mqfd4amh63rqd@tkn_work_nb> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 Bugreport: When I source the extension from .gdbinit and run gdb to inspect a core file like so: gdb tarantool \ -ex "set solib-search-path $(realpath lib64):$(realpath lib64/lua/5.1):$(realpath lib64/tarantool):$(realpath lib64/tarantool/http):$(realpath lib64/tarantool/cron)" \ -ex "add-auto-load-safe-path $(realpath .)" \ -ex "set sysroot $(realpath .)" \ -ex 'set substitute-path /build/usr/src/debug/tarantool-2.2.1.137 src/tarantool' \ -ex 'core core' I got 'luajit-gdb.py failed to load: no debugging symbols found for libluajit' warning and the extesion is not loaded. However if I source it afterwards it loded successfully. I guess it is because `gdb.parse_and_eval('IRT_PTR')` and `gdb.parse_and_eval('IRT_PGC')` needs values from runtime, which is available only after `-ex 'core core'` command. Possible solution: always register lj-* functions, but load those values inside them (if it is not already done). A kind of lazy loading. WBR, Alexander Turenko.