XS-libboost-mini
view release on metacpan or search on metacpan
include/boost/unordered/unordered_printers.hpp view on Meta::CPAN
// Copyright 2024 Braden Ganetsky
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
// Generated on 2024-08-25T17:48:54
#ifndef BOOST_UNORDERED_UNORDERED_PRINTERS_HPP
#define BOOST_UNORDERED_UNORDERED_PRINTERS_HPP
#ifndef BOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS
#if defined(__ELF__)
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverlength-strings"
#endif
__asm__(".pushsection \".debug_gdb_scripts\", \"MS\",@progbits,1\n"
".ascii \"\\4gdb.inlined-script.BOOST_UNORDERED_UNORDERED_PRINTERS_HPP\\n\"\n"
".ascii \"import gdb.printing\\n\"\n"
".ascii \"import gdb.xmethod\\n\"\n"
".ascii \"import re\\n\"\n"
".ascii \"import math\\n\"\n"
".ascii \"class BoostUnorderedHelpers:\\n\"\n"
".ascii \" def maybe_unwrap_atomic(n):\\n\"\n"
".ascii \" if f\\\"{n.type.strip_typedefs()}\\\".startswith(\\\"std::atomic<\\\"):\\n\"\n"
".ascii \" underlying_type = n.type.template_argument(0)\\n\"\n"
".ascii \" return n.cast(underlying_type)\\n\"\n"
".ascii \" else:\\n\"\n"
".ascii \" return n\\n\"\n"
".ascii \" def maybe_unwrap_foa_element(e):\\n\"\n"
".ascii \" if f\\\"{e.type.strip_typedefs()}\\\".startswith(\\\"boost::unordered::detail::foa::element_type<\\\"):\\n\"\n"
".ascii \" return e[\\\"p\\\"]\\n\"\n"
".ascii \" else:\\n\"\n"
".ascii \" return e\\n\"\n"
".ascii \" def maybe_unwrap_reference(value):\\n\"\n"
".ascii \" if value.type.code == gdb.TYPE_CODE_REF:\\n\"\n"
".ascii \" return value.referenced_value()\\n\"\n"
".ascii \" else:\\n\"\n"
".ascii \" return value\\n\"\n"
".ascii \" def countr_zero(n):\\n\"\n"
".ascii \" for i in range(32):\\n\"\n"
".ascii \" if (n & (1 << i)) != 0:\\n\"\n"
".ascii \" return i\\n\"\n"
".ascii \" return 32\\n\"\n"
".ascii \"class BoostUnorderedPointerCustomizationPoint:\\n\"\n"
".ascii \" def __init__(self, any_ptr):\\n\"\n"
".ascii \" vis = gdb.default_visualizer(any_ptr)\\n\"\n"
".ascii \" if vis is None:\\n\"\n"
".ascii \" self.to_address = lambda ptr: ptr\\n\"\n"
".ascii \" self.next = lambda ptr, offset: ptr + offset\\n\"\n"
".ascii \" else:\\n\"\n"
".ascii \" self.to_address = lambda ptr: ptr if (ptr.type.code == gdb.TYPE_CODE_PTR) else type(vis).boost_to_address(ptr)\\n\"\n"
".ascii \" self.next = lambda ptr, offset: type(vis).boost_next(ptr, offset)\\n\"\n"
".ascii \"class BoostUnorderedFcaPrinter:\\n\"\n"
".ascii \" def __init__(self, val):\\n\"\n"
".ascii \" self.val = BoostUnorderedHelpers.maybe_unwrap_reference(val)\\n\"\n"
".ascii \" self.name = f\\\"{self.val.type.strip_typedefs()}\\\".split(\\\"<\\\")[0]\\n\"\n"
".ascii \" self.name = self.name.replace(\\\"boost::unordered::\\\", \\\"boost::\\\")\\n\"\n"
".ascii \" self.is_map = self.name.endswith(\\\"map\\\")\\n\"\n"
".ascii \" self.cpo = BoostUnorderedPointerCustomizationPoint(self.val[\\\"table_\\\"][\\\"buckets_\\\"][\\\"buckets\\\"])\\n\"\n"
".ascii \" def to_string(self):\\n\"\n"
".ascii \" size = self.val[\\\"table_\\\"][\\\"size_\\\"]\\n\"\n"
".ascii \" return f\\\"{self.name} with {size} elements\\\"\\n\"\n"
include/boost/unordered/unordered_printers.hpp view on Meta::CPAN
".ascii \" workers.append(worker)\\n\"\n"
".ascii \" return workers\\n\"\n"
".ascii \"gdb.xmethod.register_xmethod_matcher(None, BoostUnorderedFoaMatcher())\\n\"\n"
".ascii \"\\\"\\\"\\\" Fancy pointer support \\\"\\\"\\\"\\n\"\n"
".ascii \"\\\"\\\"\\\"\\n\"\n"
".ascii \"To allow your own fancy pointer type to interact with Boost.Unordered GDB pretty-printers,\\n\"\n"
".ascii \"create a pretty-printer for your own type with the following additional methods.\\n\"\n"
".ascii \"(Note, this is assuming the presence of a type alias `pointer` for the underlying\\n\"\n"
".ascii \"raw pointer type, Substitute whichever name is applicable in your case.)\\n\"\n"
".ascii \"`boost_to_address(fancy_ptr)`\\n\"\n"
".ascii \" * A static method, but `@staticmethod` is not required\\n\"\n"
".ascii \" * Parameter `fancy_ptr` of type `gdb.Value`\\n\"\n"
".ascii \" * Its `.type` will be your fancy pointer type\\n\"\n"
".ascii \" * Returns a `gdb.Value` with the raw pointer equivalent to your fancy pointer\\n\"\n"
".ascii \" * This method should be equivalent to calling `operator->()` on your fancy pointer in C++\\n\"\n"
".ascii \"`boost_next(raw_ptr, offset)`\\n\"\n"
".ascii \" * Parameter `raw_ptr` of type `gdb.Value`\\n\"\n"
".ascii \" * Its `.type` will be `pointer`\\n\"\n"
".ascii \" * Parameter `offset`\\n\"\n"
".ascii \" * Either has integer type, or is of type `gdb.Value` with an underlying integer\\n\"\n"
".ascii \" * Returns a `gdb.Value` with the raw pointer equivalent to your fancy pointer, as if you did the following operations\\n\"\n"
".ascii \" 1. Convert the incoming raw pointer to your fancy pointer\\n\"\n"
".ascii \" 2. Use operator+= to add the offset to the fancy pointer\\n\"\n"
".ascii \" 3. Convert back to the raw pointer\\n\"\n"
".ascii \" * Note, you will not actually do these operations as stated. You will do equivalent lower-level operations that emulate having done the above\\n\"\n"
".ascii \" * Ultimately, it will be as if you called `operator+()` on your fancy pointer in C++, but using only raw pointers\\n\"\n"
".ascii \"Example\\n\"\n"
".ascii \"```\\n\"\n"
".ascii \"class MyFancyPtrPrinter:\\n\"\n"
".ascii \" ...\\n\"\n"
".ascii \" # Equivalent to `operator->()`\\n\"\n"
".ascii \" def boost_to_address(fancy_ptr):\\n\"\n"
".ascii \" ...\\n\"\n"
".ascii \" return ...\\n\"\n"
".ascii \" # Equivalent to `operator+()`\\n\"\n"
".ascii \" def boost_next(raw_ptr, offset):\\n\"\n"
".ascii \" ...\\n\"\n"
".ascii \" return ...\\n\"\n"
".ascii \" ...\\n\"\n"
".ascii \"```\\n\"\n"
".ascii \"\\\"\\\"\\\"\\n\"\n"
".byte 0\n"
".popsection\n");
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif // defined(__ELF__)
#endif // !defined(BOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS)
#endif // !defined(BOOST_UNORDERED_UNORDERED_PRINTERS_HPP)
( run in 1.662 second using v1.01-cache-2.11-cpan-0b58ddf2af1 )