blob: 265b9271cf306e1b15e00f8c1f7a8bfb1f09e3e0 [file] [log] [blame]
许杰友 Jieyou Xu (Joe)6e48b962024-02-22 12:10:291//@ compile-flags:-g
Urgauc0c57b32024-06-08 11:26:372//@ revisions: macos win
Wesley Wiser820ffc82022-05-19 21:21:203// We can't set the main thread name on Linux because it renames the process (#97191)
许杰友 Jieyou Xu (Joe)6e48b962024-02-22 12:10:294//@[macos] only-macos
Urgauc0c57b32024-06-08 11:26:375//@[win] only-windows
许杰友 Jieyou Xu (Joe)6e48b962024-02-22 12:10:296//@ ignore-sgx
Ben Kimock70320c12024-08-11 18:25:007//@ ignore-windows-gnu: gdb on windows-gnu does not print thread names
Wesley Wiser820ffc82022-05-19 21:21:208
9// === GDB TESTS ==================================================================================
10//
11// gdb-command:run
12//
13// gdb-command:info threads
14// gdb-check: 1 Thread [...] [...] "main" [...]
15// gdb-check:* 2 Thread [...] [...] "my new thread" [...]
16
17// === LLDB TESTS =================================================================================
18//
19// lldb-command:run
20//
21// lldb-command:thread info 1
22// lldb-check:thread #1:[...]name = 'main'[...]
23// lldb-command:thread info 2
24// lldb-check:thread #2:[...]name = 'my new thread'[...]
25
26// === CDB TESTS ==================================================================================
27//
28// cdb-command:g
29//
30// cdb-command:~
31// cdb-check: 0 Id: [...] Suspend: 1 Teb: [...] Unfrozen "main"
32// cdb-check:. [...] Id: [...] Suspend: 1 Teb: [...] Unfrozen "my new thread"
33
34use std::thread;
35
36fn main() {
37 let handle = thread::Builder::new().name("my new thread".into()).spawn(|| {
38 zzz(); // #break
39 }).unwrap();
40
41 handle.join().unwrap();
42}
43
44fn zzz() {}