summaryrefslogtreecommitdiff
path: root/include/lldb/Core/DataExtractor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Core/DataExtractor.h')
-rw-r--r--include/lldb/Core/DataExtractor.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/include/lldb/Core/DataExtractor.h b/include/lldb/Core/DataExtractor.h
index c9db2dab73d24..516953b00c331 100644
--- a/include/lldb/Core/DataExtractor.h
+++ b/include/lldb/Core/DataExtractor.h
@@ -13,9 +13,13 @@
#include "lldb/lldb-private.h"
+
+#include "llvm/ADT/SmallVector.h"
+
#include <limits.h>
#include <stdint.h>
#include <string.h>
+#include <vector>
namespace lldb_private {
@@ -85,8 +89,11 @@ public:
///
/// @param[in] addr_size
/// A new address byte size value.
+ ///
+ /// @param[in] target_byte_size
+ /// A size of a target byte in 8-bit host bytes
//------------------------------------------------------------------
- DataExtractor (const void* data, lldb::offset_t data_length, lldb::ByteOrder byte_order, uint32_t addr_size);
+ DataExtractor (const void* data, lldb::offset_t data_length, lldb::ByteOrder byte_order, uint32_t addr_size, uint32_t target_byte_size = 1);
//------------------------------------------------------------------
/// Construct with shared data.
@@ -104,8 +111,11 @@ public:
///
/// @param[in] addr_size
/// A new address byte size value.
+ ///
+ /// @param[in] target_byte_size
+ /// A size of a target byte in 8-bit host bytes
//------------------------------------------------------------------
- DataExtractor (const lldb::DataBufferSP& data_sp, lldb::ByteOrder byte_order, uint32_t addr_size);
+ DataExtractor (const lldb::DataBufferSP& data_sp, lldb::ByteOrder byte_order, uint32_t addr_size, uint32_t target_byte_size = 1);
//------------------------------------------------------------------
/// Construct with a subset of \a data.
@@ -129,8 +139,11 @@ public:
///
/// @param[in] length
/// The length in bytes of the subset of data.
+ ///
+ /// @param[in] target_byte_size
+ /// A size of a target byte in 8-bit host bytes
//------------------------------------------------------------------
- DataExtractor (const DataExtractor& data, lldb::offset_t offset, lldb::offset_t length);
+ DataExtractor (const DataExtractor& data, lldb::offset_t offset, lldb::offset_t length, uint32_t target_byte_size = 1);
DataExtractor (const DataExtractor& rhs);
//------------------------------------------------------------------
@@ -863,7 +876,7 @@ public:
*offset_ptr += 1;
return val;
}
-
+
uint16_t
GetU16_unchecked (lldb::offset_t *offset_ptr) const;
@@ -1300,6 +1313,11 @@ public:
return size - offset;
return 0;
}
+
+ void
+ Checksum (llvm::SmallVectorImpl<uint8_t> &dest,
+ uint64_t max_data = 0);
+
protected:
@@ -1311,6 +1329,7 @@ protected:
lldb::ByteOrder m_byte_order; ///< The byte order of the data we are extracting from.
uint32_t m_addr_size; ///< The address size to use when extracting pointers or addresses
mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can be shared among multilple instances
+ const uint32_t m_target_byte_size;
};
} // namespace lldb_private