Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 Reviewed-by: Igor Munkin <imun@tarantool.org> Reviewed-by: Sergey Ostanevich <sergos@tarantool.org> Signed-off-by: Igor Munkin <imun@tarantool.org>
- Loading branch information