[Tarantool-patches] [PATCH v2 luajit 0/3] Introduce gdb extension for LuaJIT

Alexander Turenko alexander.turenko at tarantool.org
Thu Feb 27 01:41:48 MSK 2020


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.


More information about the Tarantool-patches mailing list