Skip to content

Commit d6f5d34

Browse files
committed
fix string and tuple struct formatting
1 parent 0819c16 commit d6f5d34

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

src/etc/lldb_commands

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Forces test-compliant formatting to all other types
2+
type synthetic add -l lldb_lookup.synthetic_lookup -x ".*" --category Rust
23
type summary add -F _ -e -x -h "^.*$" --category Rust
34
# Std String
45
type synthetic add -l lldb_lookup.StdStringSyntheticProvider -x "^(alloc::([a-z_]+::)+)String$" --category Rust

src/etc/lldb_providers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def StdStringSummaryProvider(valobj, dict):
194194
length = inner_vec.GetChildMemberWithName("len").GetValueAsUnsigned()
195195

196196
if length <= 0:
197-
return ""
197+
return '""'
198198
error = SBError()
199199
process = pointer.GetProcess()
200200
data = process.ReadMemory(pointer.GetValueAsUnsigned(), length, error)

tests/debuginfo/empty-string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// lldb-command:run
1818

1919
// lldb-command:fr v empty_string
20-
// lldb-check:[...] empty_string = "" { vec = size=0 }
20+
// lldb-check:[...] empty_string = ""
2121

2222
// lldb-command:fr v empty_str
2323
// lldb-check:[...] empty_str = ""

tests/debuginfo/msvc-pretty-enums.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// lldb-check:(msvc_pretty_enums::CStyleEnum) j = High
3131

3232
// lldb-command:v k
33-
// lldb-check:(core::option::Option<alloc::string::String>) k = { value = { 0 = "IAMA optional string!" { vec = size=21 { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 'o' [6] = 'p' [7] = 't' [8] = 'i' [9] = 'o' [10] = 'n' [11] = 'a' [12] = 'l' [13] = ' ' [14] = 's' [15] = 't' [16] = 'r' [17] = 'i' [18] = 'n' [19] = 'g' [20] = '!' } } } }
33+
// lldb-check:(core::option::Option<alloc::string::String>) k = { value = { 0 = "IAMA optional string!" { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 'o' [6] = 'p' [7] = 't' [8] = 'i' [9] = 'o' [10] = 'n' [11] = 'a' [12] = 'l' [13] = ' ' [14] = 's' [15] = 't' [16] = 'r' [17] = 'i' [18] = 'n' [19] = 'g' [20] = '!' } } }
3434

3535
// lldb-command:v l
3636
// lldb-check:(core::result::Result<u32, msvc_pretty_enums::Empty>) l = { value = { 0 = {} } }

tests/debuginfo/pretty-std.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
// lldb-check:[...] str_slice = "IAMA string slice!" { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 's' [6] = 't' [7] = 'r' [8] = 'i' [9] = 'n' [10] = 'g' [11] = ' ' [12] = 's' [13] = 'l' [14] = 'i' [15] = 'c' [16] = 'e' [17] = '!' }
5252

5353
// lldb-command:v string
54-
// lldb-check:[...] string = "IAMA string!" { vec = size=12 { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 's' [6] = 't' [7] = 'r' [8] = 'i' [9] = 'n' [10] = 'g' [11] = '!' } }
54+
// lldb-check:[...] string = "IAMA string!" { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 's' [6] = 't' [7] = 'r' [8] = 'i' [9] = 'n' [10] = 'g' [11] = '!' }
55+
5556

5657
// lldb-command:v some
5758
// lldb-check:[...] some = Some(8)

tests/debuginfo/strings-and-strs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// === LLDB TESTS ==================================================================================
2525
// lldb-command:run
2626
// lldb-command:v plain_string
27-
// lldb-check:(alloc::string::String) plain_string = "Hello" { vec = size=5 { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } }
27+
// lldb-check:(alloc::string::String) plain_string = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' }
2828

2929
// lldb-command:v plain_str
3030
// lldb-check:(&str) plain_str = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' }

0 commit comments

Comments
 (0)