|
| 1 | +// Copyright 2024 Braden Ganetsky |
| 2 | +// Distributed under the Boost Software License, Version 1.0. |
| 3 | +// https://www.boost.org/LICENSE_1_0.txt |
| 4 | + |
| 5 | +// Generated on 2024-08-16T22:13:13 |
| 6 | + |
| 7 | +#ifndef BOOST_INTERPROCESS_INTERPROCESS_PRINTERS_HPP |
| 8 | +#define BOOST_INTERPROCESS_INTERPROCESS_PRINTERS_HPP |
| 9 | + |
| 10 | +#ifndef BOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS |
| 11 | +#if defined(__ELF__) |
| 12 | +#ifdef __clang__ |
| 13 | +#pragma clang diagnostic push |
| 14 | +#pragma clang diagnostic ignored "-Woverlength-strings" |
| 15 | +#endif |
| 16 | +__asm__(".pushsection \".debug_gdb_scripts\", \"MS\",@progbits,1\n" |
| 17 | + ".ascii \"\\4gdb.inlined-script.BOOST_INTERPROCESS_INTERPROCESS_PRINTERS_HPP\\n\"\n" |
| 18 | + ".ascii \"import gdb.printing\\n\"\n" |
| 19 | + |
| 20 | + ".ascii \"class BoostInterprocessOffsetPtrPrinter:\\n\"\n" |
| 21 | + ".ascii \" def __init__(self, val):\\n\"\n" |
| 22 | + ".ascii \" self.val = val\\n\"\n" |
| 23 | + |
| 24 | + ".ascii \" def to_string(self):\\n\"\n" |
| 25 | + ".ascii \" return f\\\"{BoostInterprocessOffsetPtrPrinter.get(self.val)}\\\"\\n\"\n" |
| 26 | + |
| 27 | + ".ascii \" # This is a simplified and inlined version of `offset_ptr::get()`\\n\"\n" |
| 28 | + ".ascii \" def get(offset_ptr):\\n\"\n" |
| 29 | + ".ascii \" offset = offset_ptr[\\\"internal\\\"][\\\"m_offset\\\"]\\n\"\n" |
| 30 | + ".ascii \" pointer = offset_ptr.type.template_argument(0).pointer()\\n\"\n" |
| 31 | + ".ascii \" if offset == 1:\\n\"\n" |
| 32 | + ".ascii \" return gdb.Value(0).cast(pointer) # nullptr\\n\"\n" |
| 33 | + ".ascii \" else:\\n\"\n" |
| 34 | + ".ascii \" unsigned_char_pointer = gdb.lookup_type(\\\"unsigned char\\\").pointer()\\n\"\n" |
| 35 | + ".ascii \" this = offset_ptr.address\\n\"\n" |
| 36 | + ".ascii \" return (this.cast(unsigned_char_pointer) + offset).cast(pointer)\\n\"\n" |
| 37 | + |
| 38 | + ".ascii \" def boost_to_address(offset_ptr):\\n\"\n" |
| 39 | + ".ascii \" return BoostInterprocessOffsetPtrPrinter.get(offset_ptr)\\n\"\n" |
| 40 | + |
| 41 | + ".ascii \" # This is a simplified and inlined version of `offset_ptr::operator+=()`\\n\"\n" |
| 42 | + ".ascii \" def boost_next(raw_ptr, offset):\\n\"\n" |
| 43 | + ".ascii \" unsigned_char_pointer = gdb.lookup_type(\\\"unsigned char\\\").pointer()\\n\"\n" |
| 44 | + ".ascii \" pointer = raw_ptr.type\\n\"\n" |
| 45 | + ".ascii \" aa = raw_ptr.cast(unsigned_char_pointer)\\n\"\n" |
| 46 | + ".ascii \" bb = offset * pointer.target().sizeof\\n\"\n" |
| 47 | + ".ascii \" return (aa + bb).cast(pointer)\\n\"\n" |
| 48 | + |
| 49 | + ".ascii \"def boost_interprocess_build_pretty_printer():\\n\"\n" |
| 50 | + ".ascii \" pp = gdb.printing.RegexpCollectionPrettyPrinter(\\\"boost_interprocess\\\")\\n\"\n" |
| 51 | + |
| 52 | + ".ascii \" pp.add_printer(\\\"boost::interprocess::offset_ptr\\\", \\\"^boost::interprocess::offset_ptr<.*>$\\\", BoostInterprocessOffsetPtrPrinter)\\n\"\n" |
| 53 | + |
| 54 | + ".ascii \" return pp\\n\"\n" |
| 55 | + |
| 56 | + ".ascii \"gdb.printing.register_pretty_printer(gdb.current_objfile(), boost_interprocess_build_pretty_printer())\\n\"\n" |
| 57 | + |
| 58 | + ".byte 0\n" |
| 59 | + ".popsection\n"); |
| 60 | +#ifdef __clang__ |
| 61 | +#pragma clang diagnostic pop |
| 62 | +#endif |
| 63 | +#endif // defined(__ELF__) |
| 64 | +#endif // !defined(BOOST_ALL_NO_EMBEDDED_GDB_SCRIPTS) |
| 65 | + |
| 66 | +#endif // !defined(BOOST_INTERPROCESS_INTERPROCESS_PRINTERS_HPP) |
0 commit comments