Skip to content

Instantly share code, notes, and snippets.

@C0deH4cker
Created June 26, 2016 08:16
Show Gist options
  • Save C0deH4cker/ab2636b48a5b171f27202ca32275b747 to your computer and use it in GitHub Desktop.
Save C0deH4cker/ab2636b48a5b171f27202ca32275b747 to your computer and use it in GitHub Desktop.
Sample source file exhibiting incorrect debug info within Xcode
#include <stdio.h>
// Even making the pointer volatile doesn't help
__thread int* tl_ptr;
int main(void) {
int x = 0xDEAD;
// Put a breakpoint on the following line
tl_ptr = &x;
// At this point, in Xcode's debugger, tl_ptr still shows up as NULL
// The value printed here will not be NULL
printf("tl_ptr = %p\n", tl_ptr);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment