Replace uses of GetModuleAtIndexUnlocked and GetModulePointerAtIndexUnlocked with the ModuleIterable and ModuleIterableNoLocking where applicable.
Details
Diff Detail
Event Timeline
LGTM apart from few nits.
lldb/include/lldb/Core/ModuleList.h | ||
---|---|---|
485–486 | nit: Can we rename that to ModuleIterableNonLocking and ModulesNonLocking ? Sounds more correct to me ^^ | |
lldb/source/Commands/CommandObjectTarget.cpp | ||
1404 | Same here, we could remove the check and just use module_list.GetSize() in the printf. | |
2279 | Same. | |
3911–3914 | Early return instead to get rid of num_modules ? | |
lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp | ||
409 | This doesn't seem to be used anymore. |
Address @mib's code review feedback.
lldb/include/lldb/Core/ModuleList.h | ||
---|---|---|
485–486 | If you feel strongly about it I can do it as a pre-commit change, but personally I don't think it's worth the churn. | |
lldb/source/Commands/CommandObjectTarget.cpp | ||
1404 | There's a few places in this file where that's true, but here we still need it for both the early return and the print statement. I'm being pedantic, but generally ::size is only guaranteed to be O(n) as opposed to ::empty which is O(1). I think having the temporary variable here is fine. | |
lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp | ||
409 | It is below, but I've inlined it. |
lldb/include/lldb/Core/ModuleList.h | ||
---|---|---|
485–486 | Not really, it can remain as is. |
nit: Can we rename that to ModuleIterableNonLocking and ModulesNonLocking ?
Sounds more correct to me ^^