Skip to content

某些情况下step in可能没办法进入协程代码 #345

Description

@WKSSZN
function CoFunc()
    print("Line 1")
    coroutine.yield()
    print("Line2")
end

local co = coroutine.create(CoFunc) -- Add break point here
coroutine.resume(co)
coroutine.resume(co)

代码如上所示,运行到断点之后,按step in(f11)的话,执行到后面两行的时候按step in可以step到协程里;
运行到断点之后,按step over(f10)的话,执行到后面两行的时候按step in无法step到协程里,跟step over的效果一样。
原因可能是在coroutine.create调用之前,改变了当前lua_State的hookmask,导致协程的hookmask少了LUA_HOOKLINE。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions