Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-17 08:39:05

0001 // Copyright 2025 Braden Ganetsky
0002 // Distributed under the Boost Software License, Version 1.0.
0003 // https://www.boost.org/LICENSE_1_0.txt
0004 
0005 // Generated on 2025-06-29T10:15:10
0006 
0007 #ifndef BOOST_BLOOM_DETAIL_BLOOM_PRINTERS_HPP
0008 #define BOOST_BLOOM_DETAIL_BLOOM_PRINTERS_HPP
0009 
0010 #ifndef BOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS
0011 #if defined(__ELF__)
0012 #ifdef __clang__
0013 #pragma clang diagnostic push
0014 #pragma clang diagnostic ignored "-Woverlength-strings"
0015 #endif
0016 __asm__(".pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n"
0017         ".ascii \"\\4gdb.inlined-script.BOOST_BLOOM_DETAIL_BLOOM_PRINTERS_HPP\\n\"\n"
0018         ".ascii \"import gdb.printing\\n\"\n"
0019         ".ascii \"import gdb.xmethod\\n\"\n"
0020 
0021         ".ascii \"class BoostBloomFilterPrinter:\\n\"\n"
0022         ".ascii \"    def __init__(self, val):\\n\"\n"
0023         ".ascii \"        self.void_pointer = gdb.lookup_type(\\\"void\\\").pointer()\\n\"\n"
0024         ".ascii \"        nullptr = gdb.Value(0).cast(self.void_pointer)\\n\"\n"
0025 
0026         ".ascii \"        has_array = val[\\\"ar\\\"][\\\"data\\\"] != nullptr\\n\"\n"
0027 
0028         ".ascii \"        if has_array:\\n\"\n"
0029         ".ascii \"            stride = int(val[\\\"stride\\\"])\\n\"\n"
0030         ".ascii \"            used_value_size = int(val[\\\"used_value_size\\\"])\\n\"\n"
0031         ".ascii \"            self.array_size = int(val[\\\"hs\\\"][\\\"rng\\\"]) * stride + (used_value_size - stride)\\n\"\n"
0032         ".ascii \"        else:\\n\"\n"
0033         ".ascii \"            self.array_size = 0\\n\"\n"
0034         ".ascii \"        self.capacity = self.array_size * 8\\n\"\n"
0035         ".ascii \"        if has_array:\\n\"\n"
0036         ".ascii \"            self.data = val[\\\"ar\\\"][\\\"array\\\"]\\n\"\n"
0037         ".ascii \"        else:\\n\"\n"
0038         ".ascii \"            self.data = nullptr\\n\"\n"
0039 
0040         ".ascii \"    def to_string(self):\\n\"\n"
0041         ".ascii \"        return f\\\"boost::bloom::filter with {{capacity = {self.capacity}, data = {self.data.cast(self.void_pointer)}, size = {self.array_size}}}\\\"\\n\"\n"
0042 
0043         ".ascii \"    def display_hint(self):\\n\"\n"
0044         ".ascii \"        return \\\"map\\\"\\n\"\n"
0045         ".ascii \"    def children(self):\\n\"\n"
0046         ".ascii \"        def generator():\\n\"\n"
0047         ".ascii \"            data = self.data\\n\"\n"
0048         ".ascii \"            for i in range(self.array_size):\\n\"\n"
0049         ".ascii \"                yield \\\"\\\", f\\\"{i}\\\"\\n\"\n"
0050         ".ascii \"                yield \\\"\\\", data.dereference()\\n\"\n"
0051         ".ascii \"                data = data + 1\\n\"\n"
0052         ".ascii \"        return generator()\\n\"\n"
0053 
0054         ".ascii \"def boost_bloom_build_pretty_printer():\\n\"\n"
0055         ".ascii \"    pp = gdb.printing.RegexpCollectionPrettyPrinter(\\\"boost_bloom\\\")\\n\"\n"
0056         ".ascii \"    add_template_printer = lambda name, printer: pp.add_printer(name, f\\\"^{name}<.*>$\\\", printer)\\n\"\n"
0057 
0058         ".ascii \"    add_template_printer(\\\"boost::bloom::filter\\\", BoostBloomFilterPrinter)\\n\"\n"
0059 
0060         ".ascii \"    return pp\\n\"\n"
0061 
0062         ".ascii \"gdb.printing.register_pretty_printer(gdb.current_objfile(), boost_bloom_build_pretty_printer())\\n\"\n"
0063 
0064         ".ascii \"# https://sourceware.org/gdb/current/onlinedocs/gdb.html/Writing-an-Xmethod.html\\n\"\n"
0065         ".ascii \"class BoostBloomFilterSubscriptMethod(gdb.xmethod.XMethod):\\n\"\n"
0066         ".ascii \"    def __init__(self):\\n\"\n"
0067         ".ascii \"        gdb.xmethod.XMethod.__init__(self, 'subscript')\\n\"\n"
0068 
0069         ".ascii \"    def get_worker(self, method_name):\\n\"\n"
0070         ".ascii \"        if method_name == 'operator[]':\\n\"\n"
0071         ".ascii \"            return BoostBloomFilterSubscriptWorker()\\n\"\n"
0072 
0073         ".ascii \"class BoostBloomFilterSubscriptWorker(gdb.xmethod.XMethodWorker):\\n\"\n"
0074         ".ascii \"    def get_arg_types(self):\\n\"\n"
0075         ".ascii \"        return [gdb.lookup_type('std::size_t')]\\n\"\n"
0076 
0077         ".ascii \"    def get_result_type(self, obj):\\n\"\n"
0078         ".ascii \"        return gdb.lookup_type('unsigned char')\\n\"\n"
0079 
0080         ".ascii \"    def __call__(self, obj, index):\\n\"\n"
0081         ".ascii \"        fp = BoostBloomFilterPrinter(obj)\\n\"\n"
0082         ".ascii \"        if fp.array_size == 0:\\n\"\n"
0083         ".ascii \"            print('Error: Filter is null')\\n\"\n"
0084         ".ascii \"            return\\n\"\n"
0085         ".ascii \"        elif index < 0 or index >= fp.array_size:\\n\"\n"
0086         ".ascii \"            print('Error: Out of bounds')\\n\"\n"
0087         ".ascii \"            return\\n\"\n"
0088         ".ascii \"        else:\\n\"\n"
0089         ".ascii \"            data = fp.data\\n\"\n"
0090         ".ascii \"            return (data + index).dereference()\\n\"\n"
0091 
0092         ".ascii \"class BoostBloomFilterMatcher(gdb.xmethod.XMethodMatcher):\\n\"\n"
0093         ".ascii \"    def __init__(self):\\n\"\n"
0094         ".ascii \"        gdb.xmethod.XMethodMatcher.__init__(self, 'BoostBloomFilterMatcher')\\n\"\n"
0095         ".ascii \"        self.methods = [BoostBloomFilterSubscriptMethod()]\\n\"\n"
0096 
0097         ".ascii \"    def match(self, class_type, method_name):\\n\"\n"
0098         ".ascii \"        if not class_type.tag.startswith('boost::bloom::filter<'):\\n\"\n"
0099         ".ascii \"            return None\\n\"\n"
0100 
0101         ".ascii \"        workers = []\\n\"\n"
0102         ".ascii \"        for method in self.methods:\\n\"\n"
0103         ".ascii \"            if method.enabled:\\n\"\n"
0104         ".ascii \"                worker = method.get_worker(method_name)\\n\"\n"
0105         ".ascii \"                if worker:\\n\"\n"
0106         ".ascii \"                    workers.append(worker)\\n\"\n"
0107         ".ascii \"        return workers\\n\"\n"
0108 
0109         ".ascii \"gdb.xmethod.register_xmethod_matcher(None, BoostBloomFilterMatcher())\\n\"\n"
0110 
0111         ".byte 0\n"
0112         ".popsection\n");
0113 #ifdef __clang__
0114 #pragma clang diagnostic pop
0115 #endif
0116 #endif // defined(__ELF__)
0117 #endif // !defined(BOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS)
0118 
0119 #endif // !defined(BOOST_BLOOM_DETAIL_BLOOM_PRINTERS_HPP)