Fix debuginfo providers/tests

This commit is contained in:
Ben Kimock 2024-08-09 21:54:48 -04:00
parent da15248d26
commit 28a8301de9
4 changed files with 22 additions and 22 deletions

View File

@ -389,11 +389,11 @@ class StdVecSyntheticProvider:
def update(self):
# type: () -> None
self.length = self.valobj.GetChildMemberWithName("len").GetValueAsUnsigned()
self.buf = self.valobj.GetChildMemberWithName("buf")
self.buf = self.valobj.GetChildMemberWithName("buf").GetChildMemberWithName("inner")
self.data_ptr = unwrap_unique_or_non_null(self.buf.GetChildMemberWithName("ptr"))
self.element_type = self.data_ptr.GetType().GetPointeeType()
self.element_type = self.valobj.GetType().GetTemplateArgumentType(0)
self.element_type_size = self.element_type.GetByteSize()
def has_children(self):
@ -474,7 +474,7 @@ class StdVecDequeSyntheticProvider:
# type: () -> None
self.head = self.valobj.GetChildMemberWithName("head").GetValueAsUnsigned()
self.size = self.valobj.GetChildMemberWithName("len").GetValueAsUnsigned()
self.buf = self.valobj.GetChildMemberWithName("buf")
self.buf = self.valobj.GetChildMemberWithName("buf").GetChildMemberWithName("inner")
cap = self.buf.GetChildMemberWithName("cap")
if cap.GetType().num_fields == 1:
cap = cap.GetChildAtIndex(0)
@ -482,7 +482,7 @@ class StdVecDequeSyntheticProvider:
self.data_ptr = unwrap_unique_or_non_null(self.buf.GetChildMemberWithName("ptr"))
self.element_type = self.data_ptr.GetType().GetPointeeType()
self.element_type = self.valobj.GetType().GetTemplateArgumentType(0)
self.element_type_size = self.element_type.GetByteSize()
def has_children(self):

View File

@ -4,10 +4,10 @@
<DisplayString>{{ len={len} }}</DisplayString>
<Expand>
<Item Name="[len]" ExcludeView="simple">len</Item>
<Item Name="[capacity]" ExcludeView="simple">buf.cap.__0</Item>
<Item Name="[capacity]" ExcludeView="simple">buf.inner.cap.__0</Item>
<ArrayItems>
<Size>len</Size>
<ValuePointer>buf.ptr.pointer.pointer</ValuePointer>
<ValuePointer>($T1*)buf.inner.ptr.pointer.pointer</ValuePointer>
</ArrayItems>
</Expand>
</Type>
@ -15,7 +15,7 @@
<DisplayString>{{ len={len} }}</DisplayString>
<Expand>
<Item Name="[len]" ExcludeView="simple">len</Item>
<Item Name="[capacity]" ExcludeView="simple">buf.cap.__0</Item>
<Item Name="[capacity]" ExcludeView="simple">buf.inner.cap.__0</Item>
<CustomListItems>
<Variable Name="i" InitialValue="0" />
<Size>len</Size>
@ -23,7 +23,7 @@
<If Condition="i == len">
<Break/>
</If>
<Item>buf.ptr.pointer.pointer[(i + head) % buf.cap.__0]</Item>
<Item>(($T1*)buf.inner.ptr.pointer.pointer)[(i + head) % buf.inner.cap.__0]</Item>
<Exec>i = i + 1</Exec>
</Loop>
</CustomListItems>
@ -41,17 +41,17 @@
</Expand>
</Type>
<Type Name="alloc::string::String">
<DisplayString>{(char*)vec.buf.ptr.pointer.pointer,[vec.len]s8}</DisplayString>
<StringView>(char*)vec.buf.ptr.pointer.pointer,[vec.len]s8</StringView>
<DisplayString>{(char*)vec.buf.inner.ptr.pointer.pointer,[vec.len]s8}</DisplayString>
<StringView>(char*)vec.buf.inner.ptr.pointer.pointer,[vec.len]s8</StringView>
<Expand>
<Item Name="[len]" ExcludeView="simple">vec.len</Item>
<Item Name="[capacity]" ExcludeView="simple">vec.buf.cap.__0</Item>
<Item Name="[capacity]" ExcludeView="simple">vec.buf.inner.cap.__0</Item>
<Synthetic Name="[chars]">
<DisplayString>{(char*)vec.buf.ptr.pointer.pointer,[vec.len]s8}</DisplayString>
<DisplayString>{(char*)vec.buf.inner.ptr.pointer.pointer,[vec.len]s8}</DisplayString>
<Expand>
<ArrayItems>
<Size>vec.len</Size>
<ValuePointer>(char*)vec.buf.ptr.pointer.pointer</ValuePointer>
<ValuePointer>(char*)vec.buf.inner.ptr.pointer.pointer</ValuePointer>
</ArrayItems>
</Expand>
</Synthetic>

View File

@ -104,14 +104,14 @@
</Type>
<Type Name="std::ffi::os_str::OsString">
<DisplayString>{(char*)inner.inner.bytes.buf.ptr.pointer.pointer,[inner.inner.bytes.len]}</DisplayString>
<DisplayString>{(char*)inner.inner.bytes.buf.inner.ptr.pointer.pointer,[inner.inner.bytes.len]}</DisplayString>
<Expand>
<Synthetic Name="[chars]">
<DisplayString>{(char*)inner.inner.bytes.buf.ptr.pointer.pointer,[inner.inner.bytes.len]}</DisplayString>
<DisplayString>{(char*)inner.inner.bytes.buf.inner.ptr.pointer.pointer,[inner.inner.bytes.len]}</DisplayString>
<Expand>
<ArrayItems>
<Size>inner.inner.bytes.len</Size>
<ValuePointer>(char*)inner.inner.bytes.buf.ptr.pointer.pointer</ValuePointer>
<ValuePointer>(char*)inner.inner.bytes.buf.inner.ptr.pointer.pointer</ValuePointer>
</ArrayItems>
</Expand>
</Synthetic>

View File

@ -81,10 +81,10 @@
// cdb-check:vec,d [...] : { len=4 } [Type: [...]::Vec<u64,alloc::alloc::Global>]
// cdb-check: [len] : 4 [Type: [...]]
// cdb-check: [capacity] : [...] [Type: [...]]
// cdb-check: [0] : 4 [Type: unsigned __int64]
// cdb-check: [1] : 5 [Type: unsigned __int64]
// cdb-check: [2] : 6 [Type: unsigned __int64]
// cdb-check: [3] : 7 [Type: unsigned __int64]
// cdb-check: [0] : 4 [Type: u64]
// cdb-check: [1] : 5 [Type: u64]
// cdb-check: [2] : 6 [Type: u64]
// cdb-check: [3] : 7 [Type: u64]
// cdb-command: dx str_slice
// cdb-check:str_slice : "IAMA string slice!" [Type: ref$<str$>]
@ -141,8 +141,8 @@
// cdb-check: [<Raw View>] [Type: alloc::collections::vec_deque::VecDeque<i32,alloc::alloc::Global>]
// cdb-check: [len] : 0x2 [Type: unsigned [...]]
// cdb-check: [capacity] : 0x8 [Type: unsigned [...]]
// cdb-check: [0x0] : 90 [Type: int]
// cdb-check: [0x1] : 20 [Type: int]
// cdb-check: [0x0] : 90 [Type: i32]
// cdb-check: [0x1] : 20 [Type: i32]
#![allow(unused_variables)]
use std::collections::{LinkedList, VecDeque};