This patch adds support for parsing and evaluating local variables. using the native pdb plugin.
While implementing this, I came up with several new ideas for increasing test coverage throughout LLDB (not limited to this plugin), including:
- We should start extending AST tests to other types of targets and debug info, not just windows / native pdb. This uncovered a few bugs for me here that allowed me to proceed.
- We should have comprehensive test coverage of the DWARFExpression evaluator in lldb/Expression/DWARFExpression.cpp. This would allow us to improve test coverage of scenarios that require compilers to emit specific debug info, and allow us to do it in a way that doesn't require that debug info to have been emitted by some compiler.
- We should add options to lldb-test that will allow it to call into SymbolFile::ResolveSymbolContext and dump the output in some format that is interesting for file checking. This function is at the heart of a lot of logic, and if it doesn't work, many things will fail. Being able to test all of the edge cases of this function would weed out a lot of problems.
Anyway, for now these are all just ideas. For this patch, I've just implemented support for local variables and a test to make sure it works. One interesting thing: With the old PDB plugin, this test takes over 1 minute to run. With the new PDB plugin, it takes about 2 seconds.
I am not sure if you care about the distinction between "expr" and "frame variable" here, but if you don't, these could be displayed in one shot with frame variable Param1 Param2 Local1 Local2 (or even just frame variable which would display all locals).