Permalink
Browse files

some usefull debug fprintf. also print to stderr instead of stdout

  • Loading branch information...
1 parent 5cfbabe commit b655ca13070f32ef74b86d9f071cfce7619da415 @albertz albertz committed Sep 7, 2011
@@ -66,6 +66,7 @@ mach_inject(
unsigned int jumpTableOffset;
unsigned int jumpTableSize;
mach_error_t err = machImageForPointer( threadEntry, &image, &imageSize, &jumpTableOffset, &jumpTableSize );
+ //fprintf(stderr, "mach_inject: found threadEntry image at: %p with size: %lu\n", image, imageSize);
// Initialize stackSize to default if requested.
if( stackSize == 0 )
@@ -18,7 +18,7 @@
load_bundle_package(
const char *bundlePackageFileSystemRepresentation )
{
- printf("LBP\n");
+ fprintf(stderr, "mach_inject_bundle load_bundle_package: %s\n", bundlePackageFileSystemRepresentation);
assert( bundlePackageFileSystemRepresentation );
assert( strlen( bundlePackageFileSystemRepresentation ) );
@@ -68,7 +68,10 @@ INJECT_ENTRY(
extern void __pthread_set_self(char*);
__pthread_set_self(dummy_pthread_struct);
#endif
-
+
+ fprintf(stderr, "mach_inject_bundle: entered in %s, codeOffset: %td, param: %p, paramSize: %lu\n",
+ INJECT_ENTRY_SYMBOL, codeOffset, param, paramSize);
+
pthread_attr_t attr;
pthread_attr_init(&attr);
@@ -95,6 +98,7 @@ INJECT_ENTRY(
pthread_entry(
mach_inject_bundle_stub_param *param )
{
+ fprintf(stderr, "mach_inject_bundle: entered in pthread_entry, param: %p\n", param);
assert( param );
EventLoopTimerProcPtr proc = (EventLoopTimerProcPtr) EventLoopTimerEntry;
@@ -111,7 +115,8 @@ EventLoopTimerEntry(
EventLoopTimerRef inTimer,
mach_inject_bundle_stub_param *param )
{
+ fprintf(stderr, "mach_inject_bundle: entered in EventLoopTimerEntry, inTimer: %p, param: %p\n", inTimer, param);
assert( inTimer );
assert( param );
load_bundle_package( param->bundlePackageFileSystemRepresentation );
-}
+}

0 comments on commit b655ca1

Please sign in to comment.