Use the debugger. There are keyboard shortcuts and programmatic triggers, but I can never remember most of them. There's a Breakpoints menu in the editor and you can also add breakpoints by clicking in the left margin of an open file on the line you want. Then the code will stop there and you can view everything on command line.
There's no need to start trying to chuck all the variables into the base workspace, it is far better to see them in context as they are evolving, and you can step through each line of the code too with the debugger,