pkulchenko / MobDebug

Remote debugger for Lua.
Other
889 stars 192 forks source link

Inspect variables in an actual scope #46

Closed zdychacek closed 5 years ago

zdychacek commented 5 years ago

Hi, I just want to ask if there is a way to inspect variables names and their values within an actual scope?

Thanks.

pkulchenko commented 5 years ago

@zdychacek, what do you mean by "actual scope"? In a specific stack frame?

zdychacek commented 5 years ago

@pkulchenko, yeas, I mean a specific stack frame.

I lack some kind of command, which would list all variables in the specific stack frame and show their associated values as well.

Something like a command info locals from GDB debugger.

This command prints the local variables in the currently selected stack frame.

Is there any way to get this kind of information?

Thanks.

pkulchenko commented 5 years ago

@zdychacek, there is no command to get a specific stake frame, but you can get that information form the STACK command. Also, EXEC command take optional comment that may specify what stack frame to use for the execution. For example, EXEC a --{stack=2} will get a value from the parent frame (where stack=1 is the current/default stack frame).

This doesn't give you the list of variables available at that stack level, so maybe it would make sense to extend the STACK command to also take stack= parameter and only return variables from the specified frame.

zdychacek commented 5 years ago

@pkulchenko Thank you, for your answer.

Do you plan to implement any kind of this funcionality?

I would appreciate this :)

Thank you.