- Adding support to step into the callable wrapped by libc++ std::function
- Adding test to validate that functionality
Details
- Reviewers
jingham davide aprantl EricWF - Commits
- rGaa30268539a9: Adding support to step into the callable wrapped by libc++ std::function
rLLDB344371: Adding support to step into the callable wrapped by libc++ std::function
rL344371: Adding support to step into the callable wrapped by libc++ std::function
Diff Detail
- Repository
- rL LLVM
Event Timeline
Some basic comments. Haven't looked at the implementation very closely, I'll do that probably tomorrow. Thanks for working on this!
include/lldb/Target/CPPLanguageRuntime.h | ||
---|---|---|
59–60 ↗ | (On Diff #168196) | Please add a doxygen comment to this function. (I understand the surrounding ones are not commented, but we should start somewhere)/ |
packages/Python/lldbsuite/test/lang/cpp/std-function-step-into-callable/TestStdFunctionStepIntoCallable.py | ||
1–3 ↗ | (On Diff #168196) | This comment seems a little outdated. |
8–9 ↗ | (On Diff #168196) | I'm not sure you need these. |
27–28 ↗ | (On Diff #168196) | Is this affected by the debug info variant used? (i.e. dSYM/gmodules/DWARF/dwo). |
56–73 ↗ | (On Diff #168196) | All these lines check hardcoded make me a little nervous, as they're really fragile. Can you make them parametric at least? |
packages/Python/lldbsuite/test/lang/cpp/std-function-step-into-callable/main.cpp | ||
1–9 ↗ | (On Diff #168196) | You don't need a license for the test case, I think. |
source/Target/ThreadPlanStepThrough.cpp | ||
99–105 ↗ | (On Diff #168196) | Can you add a comment here? |
Addressing comments and fixing a bug in ThreadPlanStepThrough.cpp where I would overwrite the result of objc_runtime.
Just a couple of trivial requests, mostly about comments...
packages/Python/lldbsuite/test/lang/cpp/std-function-step-into-callable/TestStdFunctionStepIntoCallable.py | ||
---|---|---|
45–61 ↗ | (On Diff #168389) | Most of this setup (excepting the line_number calls) can be done in one line using lldbutils.run_to_source_breakpoint. |
64 ↗ | (On Diff #168389) | Can you also check the source file? The way libcxx does inlining nowadays, all these std::function calls introduce lots of inlining so the chance that you got to the right line but in an inlined function is not zero... |
27–28 ↗ | (On Diff #168196) | I don't think this test will be sensitive to those differences, so this probably can be a NO_DEBUG_INFO test. |
source/Target/CPPLanguageRuntime.cpp | ||
295–301 ↗ | (On Diff #168389) | I'm not sure this comment is helpful. You want to do the trampoline detection regardless of the value of the regexp. And we really aren't violating that contract, since we don't intent to STOP on step into std::function... |
329 ↗ | (On Diff #168389) | You need to explain what this step in is about. Otherwise this is pretty mysterious. |
- Addressing comments
- Adding test to make sure we step through a std::function wrapping a member variable
Couple more lines you can delete from the test case, and I think you should make this a debug-variant insensitive test. Do that and this is good.
packages/Python/lldbsuite/test/lang/cpp/std-function-step-into-callable/TestStdFunctionStepIntoCallable.py | ||
---|---|---|
29–30 ↗ | (On Diff #169105) | You don't need these two lines anymore. You never use the exe variable, and the target you make with this "file" command is never used (you correctly use the one returned by run_to_source_breakpoint.) Also, this doesn't seem like a debug variant sensitive test, so you really should make this a NO_DEBUG_INFO test. We're trying to do that wherever it makes sense just to keep down the number of tests we run. |
This looks great, thanks for making this work, it will be SO helpful for debugging std::function uses.
This change has the same problem as D49271 - the class name LibCxxFunctionTestCase is re-used from another test case. This will cause issues when the tests report results and create logs. Please use unique names for each class and test.