File indexing completed on 2025-09-16 08:37:09
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_INTERPROCESS_INTERPROCESS_PRINTERS_HPP
0008 #define BOOST_INTERPROCESS_INTERPROCESS_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_INTERPROCESS_INTERPROCESS_PRINTERS_HPP\\n\"\n"
0018 ".ascii \"import gdb.printing\\n\"\n"
0019
0020 ".ascii \"class BoostInterprocessOffsetPtrPrinter:\\n\"\n"
0021 ".ascii \" def __init__(self, val):\\n\"\n"
0022 ".ascii \" self.val = val\\n\"\n"
0023
0024 ".ascii \" def to_string(self):\\n\"\n"
0025 ".ascii \" return f\\\"{BoostInterprocessOffsetPtrPrinter.get(self.val)}\\\"\\n\"\n"
0026
0027 ".ascii \" # This is a simplified and inlined version of `offset_ptr::get()`\\n\"\n"
0028 ".ascii \" def get(offset_ptr):\\n\"\n"
0029 ".ascii \" offset = offset_ptr[\\\"internal\\\"][\\\"m_offset\\\"]\\n\"\n"
0030 ".ascii \" pointer = offset_ptr.type.template_argument(0).pointer()\\n\"\n"
0031 ".ascii \" if offset == 1:\\n\"\n"
0032 ".ascii \" return gdb.Value(0).cast(pointer) # nullptr\\n\"\n"
0033 ".ascii \" else:\\n\"\n"
0034 ".ascii \" unsigned_char_pointer = gdb.lookup_type(\\\"unsigned char\\\").pointer()\\n\"\n"
0035 ".ascii \" this = offset_ptr.address\\n\"\n"
0036 ".ascii \" return (this.cast(unsigned_char_pointer) + offset).cast(pointer)\\n\"\n"
0037
0038 ".ascii \" def boost_to_address(offset_ptr):\\n\"\n"
0039 ".ascii \" return BoostInterprocessOffsetPtrPrinter.get(offset_ptr)\\n\"\n"
0040
0041 ".ascii \" # This is a simplified and inlined version of `offset_ptr::operator+=()`\\n\"\n"
0042 ".ascii \" def boost_next(raw_ptr, offset):\\n\"\n"
0043 ".ascii \" unsigned_char_pointer = gdb.lookup_type(\\\"unsigned char\\\").pointer()\\n\"\n"
0044 ".ascii \" pointer = raw_ptr.type\\n\"\n"
0045 ".ascii \" aa = raw_ptr.cast(unsigned_char_pointer)\\n\"\n"
0046 ".ascii \" bb = offset * pointer.target().sizeof\\n\"\n"
0047 ".ascii \" return (aa + bb).cast(pointer)\\n\"\n"
0048
0049 ".ascii \"def boost_interprocess_build_pretty_printer():\\n\"\n"
0050 ".ascii \" pp = gdb.printing.RegexpCollectionPrettyPrinter(\\\"boost_interprocess\\\")\\n\"\n"
0051
0052 ".ascii \" pp.add_printer(\\\"boost::interprocess::offset_ptr\\\", \\\"^boost::interprocess::offset_ptr<.*>$\\\", BoostInterprocessOffsetPtrPrinter)\\n\"\n"
0053
0054 ".ascii \" return pp\\n\"\n"
0055
0056 ".ascii \"gdb.printing.register_pretty_printer(gdb.current_objfile(), boost_interprocess_build_pretty_printer())\\n\"\n"
0057
0058 ".byte 0\n"
0059 ".popsection\n");
0060 #ifdef __clang__
0061 #pragma clang diagnostic pop
0062 #endif
0063 #endif
0064 #endif
0065
0066 #endif