Created
June 26, 2016 08:16
-
-
Save C0deH4cker/ab2636b48a5b171f27202ca32275b747 to your computer and use it in GitHub Desktop.
Sample source file exhibiting incorrect debug info within Xcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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