Question about debugging.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about debugging.

Ulrich Schmidt
Hi all.

I use a function as __index in a metatable.
When debugging my source in ZBS and stepping into a objects method, i
end up first in this __index-function, which makes debugging more
difficult and time consuming.

Question: Is there any trick to ignore/jump over this function?

tia.
Ulrich.

Reply | Threaded
Open this post in threaded view
|

Re: Question about debugging.

彭 书呆
在 2016/5/17 15:29, Ulrich Schmidt 写道:

> Hi all.
>
> I use a function as __index in a metatable.
> When debugging my source in ZBS and stepping into a objects method, i end up first in this __index-function, which makes debugging more difficult and time consuming.
>
> Question: Is there any trick to ignore/jump over this function?
>
> tia.
> Ulrich.
>

if __index returns the same function for the same method name, you may set a break point
at the beginning of the method body and use run (or step over) command instead of step into
when you call that method.


--
the nerdy Peng / 书呆彭 / Sent from Thunderbird



Reply | Threaded
Open this post in threaded view
|

Re: Question about debugging.

Paul K-2
In reply to this post by Ulrich Schmidt
Hi Ulrich,

> I use a function as __index in a metatable.
> Question: Is there any trick to ignore/jump over this function?

As long as the debug hook is generated in that function, the debugger
will stop there (if you are stepping through your code and not running
to a breakpoint). There may be a way to skip stopping in that
function, but in this case it needs to be added to the debugger and
ZeroBrane Studio itself; I don't think there is anything to be done at
the Lua level.

Paul.