Skip to content

Commit 5d91796

Browse files
author
meister
committed
Add testing of dladdr with simplefuns to room
1 parent 75ec0c1 commit 5d91796

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

src/core/function.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,15 +770,20 @@ void maybe_verify_dladdr( core::ClaspXepFunction& entryPoints,
770770
core::T_sp code,
771771
core::FunctionDescription_sp functionDescription,
772772
gctools::GatherObjects* gatherP ) {
773-
gatherP->_SimpleFunCount++;
774773
if (gc::IsA<llvmo::Library_sp>(code)) {
774+
gatherP->_SimpleFunCount++;
775775
bool failed_dladdr = false;
776776
for (size_t ii = 0; ii < ClaspXepFunction::Entries; ++ii) {
777777
Dl_info info;
778778
void* address = (void*)entryPoints._EntryPoints[ii].load();
779779
if (gatherP->_uniqueEntryPoints.count(address)==0) {
780780
gatherP->_uniqueEntryPoints.insert(address);
781781
int ret = dladdr((void*)address, &info);
782+
printf("%s:%d:%s dladdr ret=%d for entry point[%zu] %p for %s\n",
783+
__FILE__, __LINE__, __FUNCTION__,
784+
ret,
785+
ii, (void*)address,
786+
_rep_(functionDescription->_functionName).c_str());
782787
if (ret == 0) {
783788
failed_dladdr = true;
784789
gatherP->_uniqueEntryPointsFailedDladdr.insert(address);

src/gctools/boehmGarbageCollection.cc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -562,21 +562,21 @@ void clasp_gc_room(std::ostringstream& OutputStream, RoomVerbosity verbosity) {
562562
OutputStream << "Total object memory usage (bytes): " << std::setw(10) << totalSize << '\n';
563563
}
564564
#endif
565-
OutputStream << "Total GC_get_heap_size(): " << std::setw(12) << GC_get_heap_size() << '\n';
566-
OutputStream << "Total GC_get_free_bytes(): " << std::setw(12) << GC_get_free_bytes() << '\n';
567-
OutputStream << "Total GC_get_bytes_since_gc(): " << std::setw(12) << GC_get_bytes_since_gc() << '\n';
568-
OutputStream << "Total GC_get_total_bytes(): " << std::setw(12) << GC_get_total_bytes() << '\n';
569-
OutputStream << "Total number of JITDylibs: " << std::setw(12) << cl__length(_lisp->_Roots._JITDylibs) << '\n';
570-
OutputStream << "Total number of Libraries: " << std::setw(12) << cl__length(_lisp->_Roots._AllLibraries) << '\n';
571-
OutputStream << "Total number of ObjectFiles: " << std::setw(12) << cl__length(_lisp->_Roots._AllObjectFiles) << '\n';
572-
OutputStream << "Total number of CodeBlocks: " << std::setw(12) << cl__length(_lisp->_Roots._AllCodeBlocks) << '\n';
573-
OutputStream << "Total number of SimpleFun: " << std::setw(12) << gatherObjects._SimpleFunCount << '\n';
565+
OutputStream << "Total GC_get_heap_size(): " << std::setw(12) << GC_get_heap_size() << '\n';
566+
OutputStream << "Total GC_get_free_bytes(): " << std::setw(12) << GC_get_free_bytes() << '\n';
567+
OutputStream << "Total GC_get_bytes_since_gc(): " << std::setw(12) << GC_get_bytes_since_gc() << '\n';
568+
OutputStream << "Total GC_get_total_bytes(): " << std::setw(12) << GC_get_total_bytes() << '\n';
569+
OutputStream << "Total number of JITDylibs: " << std::setw(12) << cl__length(_lisp->_Roots._JITDylibs) << '\n';
570+
OutputStream << "Total number of Libraries: " << std::setw(12) << cl__length(_lisp->_Roots._AllLibraries) << '\n';
571+
OutputStream << "Total number of ObjectFiles: " << std::setw(12) << cl__length(_lisp->_Roots._AllObjectFiles) << '\n';
572+
OutputStream << "Total number of CodeBlocks: " << std::setw(12) << cl__length(_lisp->_Roots._AllCodeBlocks) << '\n';
573+
OutputStream << "Total number of library Simple(Core)Fun: " << std::setw(12) << gatherObjects._SimpleFunCount << '\n';
574574
if (gatherObjects._SimpleFunFailedDladdrCount>0) {
575-
OutputStream << "Total number of SimpleFun failed dladdr: " << std::setw(12) << gatherObjects._SimpleFunFailedDladdrCount << '\n';
575+
OutputStream << "Total of library Simple(Core)Fun dladdr fails: " << std::setw(12) << gatherObjects._SimpleFunFailedDladdrCount << '\n';
576576
}
577-
OutputStream << "Unique entry points: " << std::setw(12) << gatherObjects._uniqueEntryPoints.size() << '\n';
577+
OutputStream << "Unique library Simple(Core)Fun entry points: " << std::setw(12) << gatherObjects._uniqueEntryPoints.size() << '\n';
578578
if (gatherObjects._uniqueEntryPointsFailedDladdr.size()>0) {
579-
OutputStream << "Unique entry points failed dladdr: " << std::setw(10) << gatherObjects._uniqueEntryPointsFailedDladdr.size() << '\n';
579+
OutputStream << "Unique library Simple(Core)Fun dladdr fails: " << std::setw(10) << gatherObjects._uniqueEntryPointsFailedDladdr.size() << '\n';
580580
}
581581
delete static_ReachableClassKinds;
582582
}

0 commit comments

Comments
 (0)