Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:44

0001 //===-- DumpDataExtractor.h -------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_CORE_DUMPDATAEXTRACTOR_H
0010 #define LLDB_CORE_DUMPDATAEXTRACTOR_H
0011 
0012 #include "lldb/lldb-enumerations.h"
0013 #include "lldb/lldb-types.h"
0014 
0015 #include <cstddef>
0016 #include <cstdint>
0017 
0018 namespace lldb_private {
0019 class DataExtractor;
0020 class ExecutionContextScope;
0021 class Stream;
0022 
0023 /// Dumps \a item_count objects into the stream \a s.
0024 ///
0025 /// Dumps \a item_count objects using \a item_format, each of which
0026 /// are \a item_byte_size bytes long starting at offset \a offset
0027 /// bytes into the contained data, into the stream \a s. \a
0028 /// num_per_line objects will be dumped on each line before a new
0029 /// line will be output. If \a base_addr is a valid address, then
0030 /// each new line of output will be preceded by the address value
0031 /// plus appropriate offset, and a colon and space. Bitfield values
0032 /// can be dumped by calling this function multiple times with the
0033 /// same start offset, format and size, yet differing \a
0034 /// item_bit_size and \a item_bit_offset values.
0035 ///
0036 /// \param[in] s
0037 ///     The stream to dump the output to. This value can not be nullptr.
0038 ///
0039 /// \param[in] offset
0040 ///     The offset into the data at which to start dumping.
0041 ///
0042 /// \param[in] item_format
0043 ///     The format to use when dumping each item.
0044 ///
0045 /// \param[in] item_byte_size
0046 ///     The byte size of each item.
0047 ///
0048 /// \param[in] item_count
0049 ///     The number of items to dump.
0050 ///
0051 /// \param[in] num_per_line
0052 ///     The number of items to display on each line.
0053 ///
0054 /// \param[in] base_addr
0055 ///     The base address that gets added to the offset displayed on
0056 ///     each line if the value is valid. Is \a base_addr is
0057 ///     LLDB_INVALID_ADDRESS then no address values will be prepended
0058 ///     to any lines.
0059 ///
0060 /// \param[in] item_bit_size
0061 ///     If the value to display is a bitfield, this value should
0062 ///     be the number of bits that the bitfield item has within the
0063 ///     item's byte size value. This function will need to be called
0064 ///     multiple times with identical \a offset and \a item_byte_size
0065 ///     values in order to display multiple bitfield values that
0066 ///     exist within the same integer value. If the items being
0067 ///     displayed are not bitfields, this value should be zero.
0068 ///
0069 /// \param[in] item_bit_offset
0070 ///     If the value to display is a bitfield, this value should
0071 ///     be the offset in bits, or shift right amount, that the
0072 ///     bitfield item occupies within the item's byte size value.
0073 ///     This function will need to be called multiple times with
0074 ///     identical \a offset and \a item_byte_size values in order
0075 ///     to display multiple bitfield values that exist within the
0076 ///     same integer value. If the items being displayed are not
0077 ///     bitfields, this value should be zero.
0078 ///
0079 /// \param[in] exe_scope
0080 ///     If provided, this will be used to lookup language specific
0081 ///     information, address information and memory tags.
0082 ///     (if they are requested by the other options)
0083 ///
0084 /// \param[in] show_memory_tags
0085 ///     If exe_scope and base_addr are valid, include memory tags
0086 ///     in the output. This does not apply to certain formats.
0087 ///
0088 /// \return
0089 ///     The offset at which dumping ended.
0090 lldb::offset_t
0091 DumpDataExtractor(const DataExtractor &DE, Stream *s, lldb::offset_t offset,
0092                   lldb::Format item_format, size_t item_byte_size,
0093                   size_t item_count, size_t num_per_line, uint64_t base_addr,
0094                   uint32_t item_bit_size, uint32_t item_bit_offset,
0095                   ExecutionContextScope *exe_scope = nullptr,
0096                   bool show_memory_tags = false);
0097 
0098 void DumpHexBytes(Stream *s, const void *src, size_t src_len,
0099                   uint32_t bytes_per_line, lldb::addr_t base_addr);
0100 }
0101 
0102 #endif