<HTML><BODY><div class="cl-nz1vqc4v6k"><div>Hi, Sergey! Thanks for the upgrade of the debuggers extension!<br><br>I try your updates in the Docker on Arm64 (M4 Pro chip). On the latest Ubuntu versions (24/26) all tests were passed now.</div><div> </div><div>Under Ubuntu 20 it’s all ok for gcc build, and there are some fails with clang build. I think, this may be fixed later.</div><div> </div><div>LGTM for all commits.</div><div> </div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>Best regards,</div><div>Evgeniy Temirgaleev</div></div></div><br><div class="mail-quote-collapse"><blockquote style="border-left:1px solid #0857A6;margin:10px;padding:0 0 0 10px"><span>From: Sergey Kaplun <<a href="mailto:skaplun@tarantool.org">skaplun@tarantool.org</a>><br>To: Evgeniy Temirgaleev <<a href="mailto:e.temirgaleev@tarantool.org">e.temirgaleev@tarantool.org</a>><br>Cc: tarantool-patches@dev.tarantool.org, Sergey Bronnikov <<a href="mailto:sergeyb@tarantool.org">sergeyb@tarantool.org</a>><br>Date: Thursday, June 18, 2026 9:49 PM +03:00</span><br> <div><div id=""><div class="cl-dz5x933l2i"><div class="js-helper_mr_css_attr js-readmsg-msg_mr_css_attr"><div id="style_17818085450939256652_mr_css_attr"><div id="style_17818085450939256652_BODY_mr_css_attr">Hi, Evgeniy!<br>Thanks for the review!<br>Fixed your comments and force-pushed the branch.<br><br>On 18.06.26, Evgeniy Temirgaleev wrote:<br>> Hi, Sergey! Thanks for the patch!<br>><br>> I tried the tests under Ubuntu 20.04 and Ubuntu 24.04 with gcc and clang LuaJIT builds:<br>><br>> 1) Ubuntu 20 + gcc: all tests were passed.<br>> 2) Ubuntu 20 + clang: some of gdb and lldb tests were failed.<br>> 3) Ubuntu 24 + gcc: some of lldb tests were failed.<br>> 4) Ubuntu 24 + clang: some of gdb and lldb tests were failed.<br><br>Thanks a lot for these catches!<br><br>Ubuntu 24 has LLDB (18) with regression. It can't use the array object<br>as the initializer for `lldb.value`. This regression affects versions 17<br>- 19. See [1] for the details.<br><br>I've added the corresponding workaround for it:<br>===================================================================<br>diff --git a/src/luajit_dbg.py b/src/luajit_dbg.py<br>index 3a3ca9b8..2edb199a 100644<br>--- a/src/luajit_dbg.py<br>+++ b/src/luajit_dbg.py<br>@@ -324,7 +324,7 @@ class _LLDBDebugger(Debugger):<br>key = int(key)<br>if type(key) is int:<br># Allow array access.<br>- if key >= 0:<br>+ if key >= 0 and not lldbval.sbvalue.TypeIsPointerType():<br>return lldb.value(<br>lldbval.sbvalue.GetValueForExpressionPath('[%i]' % key)<br>)<br>@@ -475,7 +475,22 @@ class _LLDBDebugger(Debugger):<br>return strptr.sbvalue.summary<br><br>def lookup_global(self, symbol):<br>- return lldb.value(self.target.FindFirstGlobalVariable(symbol))<br>+ sbvalue = self.target.FindFirstGlobalVariable(symbol)<br>+ tp = sbvalue.GetType()<br>+ # XXX: LLDB in versions 17 - 19 can't use an array object<br>+ # as the initializer for `lldb.value` since `GetValue()`<br>+ # for it returns `None` leading to the invalid result.<br>+ # See <a href="https://github.com/llvm/llvm-project/pull/90144">https://github.com/llvm/llvm-project/pull/90144</a>.<br>+ if (self.version < 17 or self.version > 19) or \<br>+ tp.GetTypeClass() != lldb.eTypeClassArray:<br>+ return lldb.value(sbvalue)<br>+ else:<br>+ ptr_tp = tp.GetArrayElementType().GetPointerType()<br>+ return self._lldb_value_from_raw(<br>+ sbvalue.GetLoadAddress(),<br>+ ptr_tp.GetByteSize(),<br>+ ptr_tp<br>+ )<br><br>def eval(self, command):<br>if not command:<br>===================================================================<br><br>Regarding clang issues, I suppose this is due to not enough dwarf<br>information about the macro definitions. That leads to test failures<br>(even if the extension works correctly).<br><br>I've added the following fix with detecting is the required macro<br>definitions supported. Patch is splitted via the corresponding commits.<br>===================================================================<br>diff --git a/test/tarantool-debugger-tests/debug-extension-tests.py b/test/tarantool-debugger-tests/debug-extension-tests.py<br>index b677942c..7e8ea5a2 100644<br>--- a/test/tarantool-debugger-tests/debug-extension-tests.py<br>+++ b/test/tarantool-debugger-tests/debug-extension-tests.py<br>@@ -97,6 +97,10 @@ IS_DUALNUM = execute_process([<br>LUAJIT_BINARY, '-e', "print(require('ffi').abi('dualnum'))"<br>]).strip() == 'true'<br><br>+IS_GC64 = execute_process([<br>+ LUAJIT_BINARY, '-e', "print(require('ffi').abi('gc64'))"<br>+]).strip() == 'true'<br>+<br># If it is the guaranteed DUALNUM build (for example, on aarch64),<br># we use this regexp for the guaranteed 'integer' check and<br># 'number' for single-number build.<br>@@ -139,23 +143,54 @@ class TestCaseBase(unittest.TestCase):<br>self.assertRegex(self.output, self.pattern.strip())<br><br><br>-# LLDB + Clang on macOS can't produce debug info for the C-defined<br>-# macros. Thus, we hardcoded its value manually.<br>+# Test that the emitted debug information supports macro<br>+# definitions.<br>+def check_macro_debug_info():<br>+ cmd_file = persist('\n'.join([<br>+ 'b lj_cf_print',<br>+ *PROCESS_RUN,<br>+ 'n',<br>+ 'p gcval(L->base)',<br>+ 'q',<br>+ ]))<br>+ process_cmd = [<br>+ DEBUGGER,<br>+ *RUN_CMD_FILE,<br>+ cmd_file.name,<br>+ INFERIOR_ARGS,<br>+ LUAJIT_BINARY,<br>+ '-e',<br>+ 'print("")'<br>+ ]<br>+ output = execute_process(process_cmd)<br>+ cmd_file.close()<br>+ return re.search(r'\(GCobj \*\) ' + RX_ADDR, output) is not None<br>+<br>+<br>+SUPPORT_MACRO_EXPAND = check_macro_debug_info()<br>+<br>+<br>+# LLDB + Clang on macOS (for example) can't produce debug info<br>+# for the C-defined macros. Thus, we hardcoded its value manually.<br>def gcval(arg):<br>- if sys.platform == 'darwin':<br>- # Assume GC64 build only.<br>- LJ_GCVMASK = '(((uint64_t)1 << 47) - 1)'<br>- return '(((' + arg + ')->gcr).gcptr64 & ' + LJ_GCVMASK + ')'<br>- else:<br>+ if SUPPORT_MACRO_EXPAND:<br>return 'gcval(' + arg + ')'<br>+ else:<br>+ if IS_GC64:<br>+ LJ_GCVMASK = '(((uint64_t)1 << 47) - 1)'<br>+ return '(((' + arg + ')->gcr).gcptr64 & ' + LJ_GCVMASK + ')'<br>+ else:<br>+ return '((' + arg + ')->gcr).gcptr32'<br><br><br>def mref(arg, tp):<br>- if sys.platform == 'darwin':<br>- # Assume GC64 build only.<br>- return '((' + tp + '*)(' + arg + ').ptr64)'<br>- else:<br>+ if SUPPORT_MACRO_EXPAND:<br>return 'mref(' + arg + ', ' + tp + ')'<br>+ else:<br>+ if IS_GC64:<br>+ return '((' + tp + '*)(' + arg + ').ptr64)'<br>+ else:<br>+ return '((' + tp + '*)(' + arg + ').ptr32)'<br><br><br>class TestLoad(TestCaseBase):<br>===================================================================<br><br>I've checked in Ubuntu 24/26 Dockers, our CI (Ubuntu 20), and macOS M1.<br>Tests don't fail anymore.<br><br>><br>> --<br>> Best regards,<br>> Evgeniy Temirgaleev<br>><br><br><snipped><br><br>[1]: <a href="https://github.com/llvm/llvm-project/pull/90144">https://github.com/llvm/llvm-project/pull/90144</a><br><br>--<br>Best regards,<br>Sergey Kaplun</div></div></div></div></div></div></blockquote></div></div></BODY></HTML>