[Tarantool-patches] [PATCH luajit v1] tools: fix luajit-gdb stack dump

Sergey Kaplun skaplun at tarantool.org
Wed Jul 21 12:02:27 MSK 2021


Sorry, one more change:
Fix allignment in the commit message:

| gdb: fix dump stack without function frame
|
| Dummy frame is the "initial" coroutine state, when the framelink slot
| (i.e. L->base - (1 + LJ_FR2)) is the bottom slot of the guest stack
| (i.e. L->stack). Since coroutine stack unwinding is implemented via
| precondition loop, lj-stack doesn't dump the slots for the dummy frame,
| since the framelink points to the stack bottom.
|
| The output looks like the following:
|
| | 0x7fb512ac40:0x7fb512ac70 [    ] 7 slots: Red zone
| | 0x7fb512ac38              [   M]
| | 0x7fb512ab28:0x7fb512ac30 [    ] 34 slots: Free stack slots
| | 0x7fb512ab20              [  T ]
| | 0x7fb512ab08:0x7fb512ab10 [S   ] FRAME: dummy L
|
| Python doesn't provide post-condition (do-while) syntax construction,
| that fits better for this case, so the unwinding of the topmost frame is
| just manually unrolled.
|
| As a result of the patch the output looks like the following:
|
| | 0x7fb512ac40:0x7fb512ac70 [    ] 7 slots: Red zone
| | 0x7fb512ac38              [   M]
| | 0x7fb512ab28:0x7fb512ac30 [    ] 34 slots: Free stack slots
| | 0x7fb512ab20              [  T ]
| | 0x7fb512ab18              [    ] VALUE: string 0 "/tmp/net_box.lua:6: err in ser" @ 0x7fb512ade8
| | 0x7fb512ab10              [ B  ] VALUE: table @ 0x7fb512ac80 (asize: 0, hmask: 0x0)
| | 0x7fb512ab00:0x7fb512ab08 [S   ] FRAME: dummy L


-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list