Skip to content

Commit c7a8ad3

Browse files
committed
Add more debug info macos.
1 parent 8160473 commit c7a8ad3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

source/portability/source/portability_library_path.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,19 @@ int portability_library_path_find(const char name[], portability_library_path_st
194194
}
195195

196196
/* Start from 1 so we avoid the executable itself */
197-
for (image_index = 0; image_index < size; ++image_index)
197+
for (image_index = 1; image_index < size; ++image_index)
198198
{
199199
const char *image_name = _dyld_get_image_name(image_index);
200200

201201
// TODO: Delete this
202202
printf("Debug: #%d / %d => %s\n", image_index, size, image_name);
203203
fflush(stdout);
204204

205-
if (portability_library_path_ends_with(image_name, path) == 0)
205+
printf("Debug ends with: %s | %s\n", image_name, path);
206+
printf("Debug ends with: %s | %s\n", image_name, name);
207+
fflush(stdout);
208+
209+
if (portability_library_path_ends_with(image_name, name) == 0)
206210
{
207211
size_t image_length = strnlen(image_name, PORTABILITY_PATH_SIZE);
208212

@@ -218,6 +222,9 @@ int portability_library_path_find(const char name[], portability_library_path_st
218222
*length = image_length;
219223
}
220224

225+
printf("Debug ended with: %s | %s => %s\n", image_name, path, name);
226+
fflush(stdout);
227+
221228
return 0;
222229
}
223230
}

0 commit comments

Comments
 (0)