Skip to content

Commit 29bab77

Browse files
committed
Add LLDB crash repro files and updated launch.json
1 parent 22cfeb9 commit 29bab77

File tree

7 files changed

+37
-4
lines changed

7 files changed

+37
-4
lines changed

Code Samples/Fib/a.out

60.7 KB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>English</string>
7+
<key>CFBundleIdentifier</key>
8+
<string>com.apple.xcode.dsym.a.out</string>
9+
<key>CFBundleInfoDictionaryVersion</key>
10+
<string>6.0</string>
11+
<key>CFBundlePackageType</key>
12+
<string>dSYM</string>
13+
<key>CFBundleSignature</key>
14+
<string>????</string>
15+
<key>CFBundleShortVersionString</key>
16+
<string>1.0</string>
17+
<key>CFBundleVersion</key>
18+
<string>1</string>
19+
</dict>
20+
</plist>
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
triple: 'arm64-apple-darwin'
3+
binary-path: a.out
4+
relocations: []
5+
...

Code Samples/Fib/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ int main(int argc, char **argv)
5454

5555
std::cout << "All threads exited!" << std::endl;
5656

57-
return 1;
57+
return 0;
5858
}

Code Samples/Fib/thread.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ void * thread_proc(void* ctx)
2424
int tid = g_tid++;
2525

2626
char thread_name[16];
27-
sprintf(thread_name, "Thread %d", tid);
27+
snprintf(thread_name, sizeof(thread_name), "Thread %d", tid); // ✅ replaced sprintf with snprintf
28+
2829
#ifdef __APPLE__
2930
pthread_setname_np(thread_name);
3031
#else
@@ -45,4 +46,6 @@ void * thread_proc(void* ctx)
4546
}
4647

4748
std::cout << thread_name << " exited!" << std::endl;
48-
}
49+
50+
return nullptr; // ✅ fixed missing return
51+
}

Code Samples/Fib/thread.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
void * thread_proc(void* ctx);
1+
#ifndef THREAD_H
2+
#define THREAD_H
3+
4+
void* thread_proc(void* ctx);
5+
6+
#endif // THREAD_H

0 commit comments

Comments
 (0)