forked from VoidStarKat/widestring-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebugger_visualizer.rs
More file actions
92 lines (69 loc) · 2.69 KB
/
Copy pathdebugger_visualizer.rs
File metadata and controls
92 lines (69 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
use debugger_test::debugger_test;
use widestring::*;
#[inline(never)]
fn __break() {}
#[debugger_test(
debugger = "cdb",
commands = r#"
.nvlist
dx u16_string
dx u32_string
dx u16_cstring
dx u32_cstring
dx utf16_string
dx utf32_string
dx u16_cstr
dx u32_cstr
"#,
expected_statements = r#"
u16_string : "my u16 string" [Type: widestring::ustring::U16String]
[<Raw View>] [Type: widestring::ustring::U16String]
[len] : 0xd [Type: unsigned __int64]
[chars]
u32_string : "my u32 string" [Type: widestring::ustring::U32String]
[<Raw View>] [Type: widestring::ustring::U32String]
[len] : 0xd [Type: unsigned __int64]
[chars]
u16_cstring : "my u16 cstring" [Type: widestring::ucstring::U16CString]
[<Raw View>] [Type: widestring::ucstring::U16CString]
[len] : 0xf [Type: unsigned __int64]
[chars]
u32_cstring : "my u32 cstring" [Type: widestring::ucstring::U32CString]
[<Raw View>] [Type: widestring::ucstring::U32CString]
[len] : 0xf [Type: unsigned __int64]
[chars]
utf16_string : "my utf16 string" [Type: widestring::utfstring::Utf16String]
[<Raw View>] [Type: widestring::utfstring::Utf16String]
[len] : 0xf [Type: unsigned __int64]
[chars]
utf32_string : "my utf32 string" [Type: widestring::utfstring::Utf32String]
[<Raw View>] [Type: widestring::utfstring::Utf32String]
[len] : 0xf [Type: unsigned __int64]
[chars]
u16_cstr [Type: ref$<widestring::ucstr::U16CStr>]
pattern:\[\+0x000\] data_ptr : 0x[0-9a-f]+ : "my u16 cstr" \[Type: widestring::ucstr::U16CStr \*\]
[+0x008] length : 0xc [Type: unsigned __int64]
u32_cstr [Type: ref$<widestring::ucstr::U32CStr>]
pattern:\[\+0x000\] data_ptr : 0x[0-9a-f]+ : "my u32 cstr" \[Type: widestring::ucstr::U32CStr \*\]
[+0x008] length : 0xc [Type: unsigned __int64]
"#
)]
fn test_debugger_visualizer() {
let u16_string = U16String::from_str("my u16 string");
assert!(!u16_string.is_empty());
let u32_string = U32String::from_str("my u32 string");
assert!(!u32_string.is_empty());
let u16_cstring = U16CString::from_str("my u16 cstring").unwrap();
assert!(!u16_cstring.is_empty());
let u32_cstring = U32CString::from_str("my u32 cstring").unwrap();
assert!(!u32_cstring.is_empty());
let utf16_string = Utf16String::from_str("my utf16 string");
assert!(!utf16_string.is_empty());
let utf32_string = Utf32String::from_str("my utf32 string");
assert!(!utf32_string.is_empty());
let u16_cstr = u16cstr!("my u16 cstr");
assert!(!u16_cstr.is_empty());
let u32_cstr = u32cstr!("my u32 cstr");
assert!(!u32_cstr.is_empty());
__break(); // #break
}