<HTML><BODY><div>QA LGTM</div><div> </div><div> </div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>Vitaliia Ioffe</div></div></div><div> </div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Понедельник, 16 августа 2021, 13:02 +03:00 от Максим Корякшин via Tarantool-patches <tarantool-patches@dev.tarantool.org>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16291081241164034741_BODY"><div class="cl_162379"><div>Hello, Igor!</div><div>Thanks for your comments!</div><div> </div><div>Here is the new commit message:</div><div>=========================================================</div><div><div>gdb: support LJ_DUALNUM mode</div><div> </div><div>luajit-gdb.py displays integers in LJ_DUALNUM mode as nan-s. The<br>dumper function produces output considering any input value as a<br>double. However, in LJ_DUALNUM mode, integers and doubles are stored<br>differently, so the `itype` of a double must be less than<br>`LJ_TISNUM`, and the `itype` of an integer must be `LJ_TISNUM`. With<br>this fact in mind, we can easily differentiate one from another.</div><div> </div><div>Closes tarantool/tarantool#6224<br>=========================================================</div></div><div> </div><div>Here is the diff:</div><div>=========================================================</div><div><div>diff --git a/src/luajit-gdb.py b/src/luajit-gdb.py<br>index 9ccca66a..25428745 100644<br>--- a/src/luajit-gdb.py<br>+++ b/src/luajit-gdb.py<br>@@ -507,10 +507,14 @@ pointers respectively.<br> '''</div><div> def invoke(self, arg, from_tty):<br>- gdb.write('LJ_64: {LJ_64}, LJ_GC64: {LJ_GC64}\n'.format(<br>- LJ_64 = LJ_64,<br>- LJ_GC64 = LJ_GC64<br>- ))<br>+ gdb.write(<br>+ 'LJ_64: {LJ_64}, LJ_GC64: {LJ_GC64}, LJ_DUALNUM : {LJ_DUALNUM}\n'<br>+ .format(<br>+ LJ_64 = LJ_64,<br>+ LJ_GC64 = LJ_GC64,<br>+ LJ_DUALNUM = LJ_DUALNUM<br>+ )<br>+ )</div><div> class LJDumpTValue(LJBase):<br> '''<br>@@ -690,7 +694,7 @@ The command requires no args and dumps current GC stats:<br> ))</div><div> def init(commands):<br>- global LJ_64, LJ_GC64, LJ_DUALNUM, LJ_TISNUM, LJ_FR2, PADDING<br>+ global LJ_64, LJ_GC64, LJ_FR2, LJ_DUALNUM, LJ_TISNUM, PADDING</div><div> # XXX Fragile: though connecting the callback looks like a crap but it<br> # respects both Python 2 and Python 3 (see #4828).<br>@@ -731,7 +735,7 @@ def init(commands):<br> try:<br> LJ_64 = str(gdb.parse_and_eval('IRT_PTR')) == 'IRT_P64'<br> LJ_FR2 = LJ_GC64 = str(gdb.parse_and_eval('IRT_PGC')) == 'IRT_P64'<br>- LJ_DUALNUM = lookup('lj_lib_checknumber') is not None<br>+ LJ_DUALNUM = gdb.lookup_global_symbol('lj_lib_checknumber') is not None<br> except:<br> gdb.write('luajit-gdb.py failed to load: '<br> 'no debugging symbols found for libluajit\n')<br>=========================================================</div></div><div> </div><blockquote style="border-left:1px solid #0857A6;margin:10px;padding:0 0 0 10px;"><div> <blockquote style="border-left:1px solid #0857A6;margin:10px;padding:0 0 0 10px;"><div id=""><div class="js-helper_mr_css_attr js-readmsg-msg_mr_css_attr"><div><div id="style_16291051631725839802_BODY_mr_css_attr">Max,<br><br>Thanks for the patch! Please consider the comments below.</div></div></div></div></blockquote><div><snipped></div><blockquote style="border-left:1px solid #0857A6;margin:10px;padding:0 0 0 10px;"><div><div class="js-helper_mr_css_attr js-readmsg-msg_mr_css_attr"><div><div>> def tvislightud(o):<br>> if LJ_64 and not LJ_GC64:<br>> @@ -343,7 +346,10 @@ def dump_lj_tudata(tv):<br>> return 'userdata @ {}'.format(strx64(gcval(tv['gcr'])))<br>><br>> def dump_lj_tnumx(tv):<br>> - return 'number {}'.format(cast('double', tv['n']))<br>> + if tvisint(tv):<br>> + return 'number {}'.format(cast('int32_t', tv['i']))<br><br>Side note: Agree with Sergey here. It is more convenient to understand<br>that TValue structure for integer slot differs from double.</div></div></div></div></blockquote><div>I have already fixed the output format here with the fix for v2 of the patch.</div><div><snipped></div><div> </div><div>Best regards,</div><div>Maxim Kokryashkin</div><div> </div></div></blockquote></div></div></div></div></div></blockquote><div> </div></BODY></HTML>