fix tests

This commit is contained in:
Walnut
2025-11-15 04:28:56 -06:00
parent b17670d3de
commit eca09dedef
2 changed files with 24 additions and 13 deletions
+12 -1
View File
@@ -91,7 +91,18 @@ def classify_rust_type(type: lldb.SBType, is_msvc: bool) -> RustType:
def synthetic_lookup(valobj: lldb.SBValue, _dict: LLDBOpaque) -> object:
"""Returns the synthetic provider for the given value"""
is_msvc = valobj.GetTarget().GetTriple().endswith("msvc")
# small hack to check for the DWARF debug info section, since SBTarget.triple and
# SBProcess.triple report lldb's target rather than the executable's. SBProcessInfo.triple
# returns a triple without the ABI. It is also possible for any of those functions to return a
# None object.
# Instead, we look for the GNU `.debug_info` section, as MSVC does not have one with the same
# name
# FIXME: I don't know if this works when the DWARF lives in a separate file
# (see: https://gcc.gnu.org/wiki/DebugFissionDWP). Splitting the DWARF is very uncommon afaik so
# it should be okay for the time being.
is_msvc = not valobj.GetFrame().GetModule().FindSection(".debug_info").IsValid()
rust_type = classify_rust_type(valobj.GetType(), is_msvc)
if rust_type == RustType.Struct or rust_type == RustType.Union:
+12 -12
View File
@@ -199,40 +199,40 @@
//@ lldb-command:run
//@ lldb-command:v/d nz_i8
//@ lldb-check:[...] 11 { __0 = { 0 = 11 } }
//@ lldb-check:[...] 11 { 0 = { 0 = 11 } }
//@ lldb-command:v nz_i16
//@ lldb-check:[...] 22 { __0 = { 0 = 22 } }
//@ lldb-check:[...] 22 { 0 = { 0 = 22 } }
//@ lldb-command:v nz_i32
//@ lldb-check:[...] 33 { __0 = { 0 = 33 } }
//@ lldb-check:[...] 33 { 0 = { 0 = 33 } }
//@ lldb-command:v nz_i64
//@ lldb-check:[...] 44 { __0 = { 0 = 44 } }
//@ lldb-check:[...] 44 { 0 = { 0 = 44 } }
//@ lldb-command:v nz_i128
//@ lldb-check:[...] 55 { __0 = { 0 = 55 } }
//@ lldb-check:[...] 55 { 0 = { 0 = 55 } }
//@ lldb-command:v nz_isize
//@ lldb-check:[...] 66 { __0 = { 0 = 66 } }
//@ lldb-check:[...] 66 { 0 = { 0 = 66 } }
//@ lldb-command:v/d nz_u8
//@ lldb-check:[...] 77 { __0 = { 0 = 77 } }
//@ lldb-check:[...] 77 { 0 = { 0 = 77 } }
//@ lldb-command:v nz_u16
//@ lldb-check:[...] 88 { __0 = { 0 = 88 } }
//@ lldb-check:[...] 88 { 0 = { 0 = 88 } }
//@ lldb-command:v nz_u32
//@ lldb-check:[...] 99 { __0 = { 0 = 99 } }
//@ lldb-check:[...] 99 { 0 = { 0 = 99 } }
//@ lldb-command:v nz_u64
//@ lldb-check:[...] 100 { __0 = { 0 = 100 } }
//@ lldb-check:[...] 100 { 0 = { 0 = 100 } }
//@ lldb-command:v nz_u128
//@ lldb-check:[...] 111 { __0 = { 0 = 111 } }
//@ lldb-check:[...] 111 { 0 = { 0 = 111 } }
//@ lldb-command:v nz_usize
//@ lldb-check:[...] 122 { __0 = { 0 = 122 } }
//@ lldb-check:[...] 122 { 0 = { 0 = 122 } }
use std::num::*;
use std::sync::atomic::*;