diff options
author | Pedro Franco de Carvalho <pedromfc@linux.ibm.com> | 2018-08-06 16:24:55 -0300 |
---|---|---|
committer | Pedro Franco de Carvalho <pedromfc@linux.ibm.com> | 2018-08-06 16:38:58 -0300 |
commit | a04b9d62a234923826e431a209d396a628661548 (patch) | |
tree | dc4d7aff9b370d4a13f4b0f9e30fd84545f9782b /gdb/tracepoint.h | |
parent | 4277c4b87addb5354cc47b98d7a73e44cfaf22c2 (diff) | |
download | binutils-gdb-a04b9d62a234923826e431a209d396a628661548.tar.gz |
Variable size for regs mask in collection list
This patch changes collection_list to allow larger register masks.
The mask is changed from an array to a vector and is initialized to
hold the maximum possible remote register number. The stringify
method is updated to resize temp_buf if needed.
gdb/ChangeLog:
2018-08-06 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* tracepoint.h (collection_list) <m_regs_mask>: Change type to
std::vector<unsigned char>.
* tracepoint.c (collection_list::collection_list): Remove
m_regs_mask initializer from initializer list. Resize
m_regs_mask using the largest remote register number.
(collection_list::add_remote_register): Remove size check on
m_regs_mask. Use at to access element.
(collection_list::stringify): Change type of temp_buf to
gdb::char_vector. Update uses of temp_buf. Resize if needed to
stringify the register mask. Use pack_hex_byte for the register
mask.
Diffstat (limited to 'gdb/tracepoint.h')
-rw-r--r-- | gdb/tracepoint.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h index 8bdad3567e9..c185672cc1b 100644 --- a/gdb/tracepoint.h +++ b/gdb/tracepoint.h @@ -292,8 +292,9 @@ public: { return m_computed; } private: - /* room for up to 256 regs */ - unsigned char m_regs_mask[32]; + /* We need the allocator zero-initialize the mask, so we don't use + gdb::byte_vector. */ + std::vector<unsigned char> m_regs_mask; std::vector<memrange> m_memranges; |