@@ -38,6 +38,7 @@ THE SOFTWARE.
38
38
#include < clasp/gctools/boehmGarbageCollection.h>
39
39
#include < clasp/gctools/gcFunctions.h>
40
40
#include < clasp/core/debugger.h>
41
+ #include < clasp/core/function.h>
41
42
#include < clasp/core/compiler.h>
42
43
#include < clasp/gctools/snapshotSaveLoad.h>
43
44
@@ -62,6 +63,7 @@ static size_t invalidHeaderTotalSize = 0;
62
63
63
64
extern " C" {
64
65
void callback_reachable_object (gctools::BaseHeader_s* ptr, void * client_data) {
66
+ gctools::GatherObjects* gatherP = (gctools::GatherObjects*)client_data;
65
67
gctools::GCStampEnum stamp;
66
68
if (ptr->_badge_stamp_wtag_mtag .consObjectP ()) {
67
69
stamp = (gctools::GCStampEnum)STAMP_UNSHIFT_WTAG (gctools::STAMPWTAG_CONS);
@@ -72,6 +74,19 @@ void callback_reachable_object(gctools::BaseHeader_s* ptr, void* client_data) {
72
74
}
73
75
}
74
76
size_t sz = objectSize (ptr);
77
+ if (stamp == (gctools::GCStampEnum)STAMP_UNSHIFT_WTAG (gctools::STAMPWTAG_core__SimpleFun_O)) {
78
+ core::SimpleFun_O* fun = HeaderPtrToGeneralPtr<core::SimpleFun_O>(ptr);
79
+ core::maybe_verify_dladdr ( fun->_EntryPoints ,
80
+ fun->_Code ,
81
+ fun->_FunctionDescription ,
82
+ gatherP );
83
+ } else if (stamp == (gctools::GCStampEnum)STAMP_UNSHIFT_WTAG (gctools::STAMPWTAG_core__SimpleCoreFun_O)) {
84
+ core::SimpleCoreFun_O* fun = HeaderPtrToGeneralPtr<core::SimpleCoreFun_O>(ptr);
85
+ core::maybe_verify_dladdr ( fun->_EntryPoints ,
86
+ fun->_Code ,
87
+ fun->_FunctionDescription ,
88
+ gatherP );
89
+ }
75
90
gctools::ReachableClassMap::iterator it = static_ReachableClassKinds->find (stamp);
76
91
if (it == static_ReachableClassKinds->end ()) {
77
92
gctools::ReachableClass reachableClass (stamp);
@@ -82,6 +97,7 @@ void callback_reachable_object(gctools::BaseHeader_s* ptr, void* client_data) {
82
97
}
83
98
#if 0
84
99
if (stamp==(gctools::GCStampEnum)(gctools::STAMPWTAG_core__Symbol_O>>gctools::Header_s::wtag_width)) {
100
+ #error "ptr is a base pointer - it cant be cast to Symbol_O"
85
101
core::Symbol_O* sym = (core::Symbol_O*)ptr;
86
102
printf("%s:%d symbol %s\n", __FILE__, __LINE__, sym->formattedName(true).c_str());
87
103
}
@@ -554,6 +570,10 @@ void clasp_gc_room(std::ostringstream& OutputStream, RoomVerbosity verbosity) {
554
570
OutputStream << " Total number of Libraries: " << std::setw (12 ) << cl__length (_lisp->_Roots ._AllLibraries ) << ' \n ' ;
555
571
OutputStream << " Total number of ObjectFiles: " << std::setw (12 ) << cl__length (_lisp->_Roots ._AllObjectFiles ) << ' \n ' ;
556
572
OutputStream << " Total number of CodeBlocks: " << std::setw (12 ) << cl__length (_lisp->_Roots ._AllCodeBlocks ) << ' \n ' ;
573
+ OutputStream << " Unique entry points: " << std::setw (12 ) << gatherObjects._uniqueEntryPoints .size () << ' \n ' ;
574
+ if (gatherObjects._uniqueEntryPointsFailedDladdr .size ()>0 ) {
575
+ OutputStream << " Unique entry points failed dladdr: " << std::setw (12 ) << gatherObjects._uniqueEntryPointsFailedDladdr .size () << ' \n ' ;
576
+ }
557
577
delete static_ReachableClassKinds;
558
578
}
559
579
0 commit comments