Skip to content

Commit 00471d2

Browse files
committed
Code review feedback on function names and comment phrasing
1 parent 83a8f44 commit 00471d2

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lldb/include/lldb/Target/DynamicLoader.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,14 @@ class DynamicLoader : public PluginInterface {
339339
}
340340

341341
/// Returns a list of memory ranges that should be saved in the core file,
342-
/// specific for this dßynamic loader.
342+
/// specific for this dynamic loader.
343343
///
344-
/// By default, this returns an empty list, but for POSIX/ELF it will return
345-
/// the link map, and the TLS data.
344+
/// For example, an implementation of this function can save the thread
345+
/// local data of a given thread.
346346
virtual void CalculateDynamicSaveCoreRanges(
347347
lldb_private::Process &process,
348348
std::vector<lldb_private::MemoryRegionInfo> &ranges,
349-
std::function<bool(const lldb_private::Thread &)> save_thread_predicate) {
349+
llvm::function_ref<bool(const lldb_private::Thread &)> save_thread_predicate) {
350350
};
351351

352352
protected:

lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ bool DynamicLoaderPOSIXDYLD::IsCoreFile() const {
869869
}
870870

871871
// For our ELF/POSIX builds save off the fs_base/gs_base regions
872-
static void AddSegmentRegisterSections(Process &process, ThreadSP &thread_sp,
872+
static void AddThreadLocalMemoryRegions(Process &process, ThreadSP &thread_sp,
873873
std::vector<MemoryRegionInfo> &ranges) {
874874
lldb::RegisterContextSP reg_ctx = thread_sp->GetRegisterContext();
875875
if (!reg_ctx)
@@ -930,17 +930,17 @@ static void AddLinkMapSections(Process &process,
930930
void DynamicLoaderPOSIXDYLD::CalculateDynamicSaveCoreRanges(
931931
lldb_private::Process &process,
932932
std::vector<lldb_private::MemoryRegionInfo> &ranges,
933-
std::function<bool(const lldb_private::Thread &)> save_thread_predicate) {
933+
llvm::function_ref<bool(const lldb_private::Thread &)> save_thread_predicate) {
934934
ThreadList &thread_list = process.GetThreadList();
935935
for (size_t idx = 0; idx < thread_list.GetSize(); idx++) {
936936
ThreadSP thread_sp = thread_list.GetThreadAtIndex(idx);
937937
if (!thread_sp)
938938
continue;
939939

940-
if (!save_thread_predicate(*thread_sp.get()))
940+
if (!save_thread_predicate(*thread_sp))
941941
continue;
942942

943-
AddSegmentRegisterSections(process, thread_sp, ranges);
943+
AddThreadLocalMemoryRegions(process, thread_sp, ranges);
944944
}
945945

946946
AddLinkMapSections(process, ranges);

lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class DynamicLoaderPOSIXDYLD : public lldb_private::DynamicLoader {
6363
void CalculateDynamicSaveCoreRanges(
6464
lldb_private::Process &process,
6565
std::vector<lldb_private::MemoryRegionInfo> &ranges,
66-
std::function<bool(const lldb_private::Thread &)> save_thread_predicate)
66+
llvm::function_ref<bool(const lldb_private::Thread &)> save_thread_predicate)
6767
override;
6868

6969
protected:

0 commit comments

Comments
 (0)