This is because coroutine.create just pushes the function onto the new
thread's stack: the first resume does the actual work.
So for this case, I guess what you're asking for is a way to inspect a
lua thread's stack from lua itself.
This wouldn't be a terrible addition to the debug.* api.
It's hardly implement a pure lua version like this to traverse the whole lua vm to find out all of the lua objects,
or do some hot update to replace some functions to new version.
So I suggest add an api to coroutine.* or debug.* to get the value on thread's stack.