fix string and tuple struct formatting

This commit is contained in:
Walnut 2025-02-12 01:30:09 -06:00
parent 0819c1638c
commit d6f5d34744
6 changed files with 7 additions and 5 deletions

View file

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

View file

@ -194,7 +194,7 @@ def StdStringSummaryProvider(valobj, dict):
length = inner_vec.GetChildMemberWithName("len").GetValueAsUnsigned() length = inner_vec.GetChildMemberWithName("len").GetValueAsUnsigned()
if length <= 0: if length <= 0:
return "" return '""'
error = SBError() error = SBError()
process = pointer.GetProcess() process = pointer.GetProcess()
data = process.ReadMemory(pointer.GetValueAsUnsigned(), length, error) data = process.ReadMemory(pointer.GetValueAsUnsigned(), length, error)

View file

@ -17,7 +17,7 @@
// lldb-command:run // lldb-command:run
// lldb-command:fr v empty_string // lldb-command:fr v empty_string
// lldb-check:[...] empty_string = "" { vec = size=0 } // lldb-check:[...] empty_string = ""
// lldb-command:fr v empty_str // lldb-command:fr v empty_str
// lldb-check:[...] empty_str = "" // lldb-check:[...] empty_str = ""

View file

@ -30,7 +30,7 @@
// lldb-check:(msvc_pretty_enums::CStyleEnum) j = High // lldb-check:(msvc_pretty_enums::CStyleEnum) j = High
// lldb-command:v k // lldb-command:v k
// 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] = '!' } } } } // 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] = '!' } } }
// lldb-command:v l // lldb-command:v l
// lldb-check:(core::result::Result<u32, msvc_pretty_enums::Empty>) l = { value = { 0 = {} } } // lldb-check:(core::result::Result<u32, msvc_pretty_enums::Empty>) l = { value = { 0 = {} } }

View file

@ -51,7 +51,8 @@
// 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] = '!' } // 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] = '!' }
// lldb-command:v string // lldb-command:v string
// 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] = '!' } } // 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] = '!' }
// lldb-command:v some // lldb-command:v some
// lldb-check:[...] some = Some(8) // lldb-check:[...] some = Some(8)

View file

@ -24,7 +24,7 @@
// === LLDB TESTS ================================================================================== // === LLDB TESTS ==================================================================================
// lldb-command:run // lldb-command:run
// lldb-command:v plain_string // lldb-command:v plain_string
// lldb-check:(alloc::string::String) plain_string = "Hello" { vec = size=5 { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } } // lldb-check:(alloc::string::String) plain_string = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' }
// lldb-command:v plain_str // lldb-command:v plain_str
// lldb-check:(&str) plain_str = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' } // lldb-check:(&str) plain_str = "Hello" { [0] = 'H' [1] = 'e' [2] = 'l' [3] = 'l' [4] = 'o' }