|
|
|||
File indexing completed on 2026-05-10 08:42:44
0001 //===-- WatchpointAlgorithms.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_BREAKPOINT_WATCHPOINTALGORITHMS_H 0010 #define LLDB_BREAKPOINT_WATCHPOINTALGORITHMS_H 0011 0012 #include "lldb/Breakpoint/WatchpointResource.h" 0013 #include "lldb/Utility/ArchSpec.h" 0014 #include "lldb/lldb-private.h" 0015 0016 #include <vector> 0017 0018 namespace lldb_private { 0019 0020 class WatchpointAlgorithms { 0021 0022 public: 0023 /// Convert a user's watchpoint request into an array of memory 0024 /// regions, each region watched by one hardware watchpoint register. 0025 /// 0026 /// \param[in] addr 0027 /// The start address specified by the user. 0028 /// 0029 /// \param[in] size 0030 /// The number of bytes the user wants to watch. 0031 /// 0032 /// \param[in] read 0033 /// True if we are watching for read accesses. 0034 /// 0035 /// \param[in] write 0036 /// True if we are watching for write accesses. 0037 /// \a read and \a write may both be true. 0038 /// There is no "modify" style for WatchpointResources - 0039 /// WatchpointResources are akin to the hardware watchpoint 0040 /// registers which are either in terms of read or write. 0041 /// "modify" distinction is done at the Watchpoint layer, where 0042 /// we check the actual range of bytes the user requested. 0043 /// 0044 /// \param[in] supported_features 0045 /// The bit flags in this parameter are set depending on which 0046 /// WatchpointHardwareFeature enum values the current target supports. 0047 /// The eWatchpointHardwareFeatureUnknown bit may be set if we 0048 /// don't have specific information about what the remote stub 0049 /// can support, and a reasonablec default will be used. 0050 /// 0051 /// \param[in] arch 0052 /// The ArchSpec of the current Target. 0053 /// 0054 /// \return 0055 /// A vector of WatchpointResourceSP's, one per hardware watchpoint 0056 /// register needed. We may return more WatchpointResources than the 0057 /// target can watch at once; if all resources cannot be set, the 0058 /// watchpoint cannot be set. 0059 static std::vector<lldb::WatchpointResourceSP> AtomizeWatchpointRequest( 0060 lldb::addr_t addr, size_t size, bool read, bool write, 0061 WatchpointHardwareFeature supported_features, ArchSpec &arch); 0062 0063 protected: 0064 struct Region { 0065 lldb::addr_t addr; 0066 size_t size; 0067 }; 0068 0069 /// Convert a user's watchpoint request into an array of Regions, 0070 /// each of which can be watched by a single hardware watchpoint 0071 /// that can watch power-of-2 size & aligned memory regions. 0072 /// 0073 /// This is the default algorithm if we have no further information; 0074 /// most watchpoint implementations can be assumed to be able to watch up 0075 /// to sizeof(void*) regions of memory, in power-of-2 sizes and alignments. 0076 /// e.g. on a 64-bit target: 1, 2, 4, 8 or bytes with a single hardware 0077 /// watchpoint register. 0078 /// 0079 /// \param[in] user_addr 0080 /// The user's start address. 0081 /// 0082 /// \param[in] user_size 0083 /// The user's specified byte length. 0084 /// 0085 /// \param[in] min_byte_size 0086 /// The minimum byte size of the range of memory that can be watched 0087 /// with one watchpoint register. 0088 /// In most cases, this will be 1. AArch64 MASK watchpoints can 0089 /// watch a minimum of 8 bytes (although Byte Address Select watchpoints 0090 /// can watch 1 to pointer-size bytes in a pointer-size aligned granule). 0091 /// 0092 /// \param[in] max_byte_size 0093 /// The maximum byte size supported for one watchpoint on this target. 0094 /// 0095 /// \param[in] address_byte_size 0096 /// The address byte size on this target. 0097 static std::vector<Region> PowerOf2Watchpoints(lldb::addr_t user_addr, 0098 size_t user_size, 0099 size_t min_byte_size, 0100 size_t max_byte_size, 0101 uint32_t address_byte_size); 0102 }; 0103 0104 } // namespace lldb_private 0105 0106 #endif // LLDB_BREAKPOINT_WATCHPOINTALGORITHMS_H
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|