File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1919 * CallstackLibrary, see the file LICENSE. If not, see <https://www.gnu.org/licenses/>.
2020 */
2121
22+ #include <stdbool.h>
23+
2224#include <callstack_internals.h>
2325#include <functionInfo/functionInfo.h>
2426
27+ #include "../dlMapper/dlMapper.h"
28+
2529struct functionInfo functionInfo_loadHint (const char * functionName , const char * libraryName ) {
2630 struct functionInfo toReturn = (struct functionInfo ) { 0 , 0 };
2731
32+ dlMapper_init ();
33+ bool found = false;
34+ if (libraryName != NULL ) {
35+ struct loadedLibInfo * info = dlMapper_libInfoForFileName (libraryName );
36+ if (info != NULL ) {
37+ if (info -> associated == NULL ) {
38+ info -> associated = binaryFile_new (info -> fileName , info -> begin );
39+ }
40+ struct binaryFile * file = info -> associated ;
41+ if (file != NULL ) {
42+ file -> relocationOffset = info -> relocationOffset ;
43+ file -> inMemory = true;
44+ found = file -> getFunctionInfo (file , functionName , & toReturn );
45+ }
46+ }
47+ }
48+ if (!found ) {
49+ // TODO: Search in all known binaries
50+ }
51+
2852 if (callstack_autoClearCaches ) {
2953 callstack_clearCaches ();
3054 }
You can’t perform that action at this time.
0 commit comments