Auto update

This commit is contained in:
Fcitx5 Android Bot 2026-04-25 14:35:08 +00:00
parent 642312f996
commit 6672fa19bd
4907 changed files with 206456 additions and 171700 deletions

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 Joaquin M Lopez Munoz.
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
See https://www.boost.org/libs/bloom for library home page.
-->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="boost::bloom::filter&lt;*&gt;" Inheritable="false">
<Intrinsic Name="core" Expression="*static_cast&lt;super*&gt;(this)" />
<Intrinsic Name="has_array" Expression="core().ar.data!=nullptr" />
<Intrinsic Name="data" Expression="has_array()?core().ar.array:nullptr" />
<Intrinsic
Name="array_size"
Expression="
has_array()?
core().hs.rng*super::stride+(super::used_value_size-super::stride):
0"
/>
<Intrinsic Name="capacity" Expression="array_size()*8" />
<DisplayString>{{ capacity={capacity()} }}</DisplayString>
<Expand>
<Item Name="[hash_function]">
*reinterpret_cast&lt;hasher*&gt;(static_cast&lt;hash_base*&gt;(this))
</Item>
<Item Name="[allocator]">
*reinterpret_cast&lt;super::allocator_type*&gt;(static_cast&lt;super::allocator_base*&gt;(this))
</Item>
<Item Name="[capacity]">
capacity()
</Item>
<Synthetic Name="[array]">
<DisplayString>{{ data={(void*)data()} size={array_size()} }}</DisplayString>
<Expand>
<ArrayItems>
<Size>array_size()</Size>
<ValuePointer>data()</ValuePointer>
</ArrayItems>
</Expand>
</Synthetic>
</Expand>
</Type>
</AutoVisualizer>

View file

@ -0,0 +1,96 @@
# Copyright 2025 Braden Ganetsky
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
import gdb.printing
import gdb.xmethod
class BoostBloomFilterPrinter:
def __init__(self, val):
self.void_pointer = gdb.lookup_type("void").pointer()
nullptr = gdb.Value(0).cast(self.void_pointer)
has_array = val["ar"]["data"] != nullptr
if has_array:
stride = int(val["stride"])
used_value_size = int(val["used_value_size"])
self.array_size = int(val["hs"]["rng"]) * stride + (used_value_size - stride)
else:
self.array_size = 0
self.capacity = self.array_size * 8
if has_array:
self.data = val["ar"]["array"]
else:
self.data = nullptr
def to_string(self):
return f"boost::bloom::filter with {{capacity = {self.capacity}, data = {self.data.cast(self.void_pointer)}, size = {self.array_size}}}"
def display_hint(self):
return "map"
def children(self):
def generator():
data = self.data
for i in range(self.array_size):
yield "", f"{i}"
yield "", data.dereference()
data = data + 1
return generator()
def boost_bloom_build_pretty_printer():
pp = gdb.printing.RegexpCollectionPrettyPrinter("boost_bloom")
add_template_printer = lambda name, printer: pp.add_printer(name, f"^{name}<.*>$", printer)
add_template_printer("boost::bloom::filter", BoostBloomFilterPrinter)
return pp
gdb.printing.register_pretty_printer(gdb.current_objfile(), boost_bloom_build_pretty_printer())
# https://sourceware.org/gdb/current/onlinedocs/gdb.html/Writing-an-Xmethod.html
class BoostBloomFilterSubscriptMethod(gdb.xmethod.XMethod):
def __init__(self):
gdb.xmethod.XMethod.__init__(self, 'subscript')
def get_worker(self, method_name):
if method_name == 'operator[]':
return BoostBloomFilterSubscriptWorker()
class BoostBloomFilterSubscriptWorker(gdb.xmethod.XMethodWorker):
def get_arg_types(self):
return [gdb.lookup_type('std::size_t')]
def get_result_type(self, obj):
return gdb.lookup_type('unsigned char')
def __call__(self, obj, index):
fp = BoostBloomFilterPrinter(obj)
if fp.array_size == 0:
print('Error: Filter is null')
return
elif index < 0 or index >= fp.array_size:
print('Error: Out of bounds')
return
else:
data = fp.data
return (data + index).dereference()
class BoostBloomFilterMatcher(gdb.xmethod.XMethodMatcher):
def __init__(self):
gdb.xmethod.XMethodMatcher.__init__(self, 'BoostBloomFilterMatcher')
self.methods = [BoostBloomFilterSubscriptMethod()]
def match(self, class_type, method_name):
if not class_type.tag.startswith('boost::bloom::filter<'):
return None
workers = []
for method in self.methods:
if method.enabled:
worker = method.get_worker(method_name)
if worker:
workers.append(worker)
return workers
gdb.xmethod.register_xmethod_matcher(None, BoostBloomFilterMatcher())