diff options
author | Tom Tromey <tom@tromey.com> | 2024-03-27 10:43:57 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-06-20 10:45:05 -0600 |
commit | 6eb63917ce17236f0189e8d7ff4b60e24741770b (patch) | |
tree | 206081da38a1dac3e5166d55942ffa90061e2d15 /gdb/extract-store-integer.h | |
parent | 4429b54cc831e436d27ba6f0e3c417543c22f486 (diff) | |
download | gdb-6eb63917ce17236f0189e8d7ff4b60e24741770b.zip gdb-6eb63917ce17236f0189e8d7ff4b60e24741770b.tar.gz gdb-6eb63917ce17236f0189e8d7ff4b60e24741770b.tar.bz2 |
Handle "info symbol" in Rust language mode
When I changed the Rust parser to handle 128-bit ints, this
inadvertently broke some other gdb commands. For example, "info
symbol 0xffffffffffffffff" now fails, because the resulting value is
128 bits, but this is rejected by extract_integer.
This patch fixes the problem by changing extract_integer to allow
over-long integers as long as the high bytes are either 0, or (for
signed types) 0xff.
Regression tested on x86-64 Fedora 38.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31565
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/extract-store-integer.h')
-rw-r--r-- | gdb/extract-store-integer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/extract-store-integer.h b/gdb/extract-store-integer.h index b2c0f35..a51ef3d 100644 --- a/gdb/extract-store-integer.h +++ b/gdb/extract-store-integer.h @@ -18,9 +18,9 @@ #ifndef GDB_EXTRACT_STORE_INTEGER_H #define GDB_EXTRACT_STORE_INTEGER_H -#include "gdbsupport/traits.h" +#include <type_traits> -template<typename T, typename = RequireLongest<T>> +template<typename T, typename = std::is_integral<T>> T extract_integer (gdb::array_view<const gdb_byte>, enum bfd_endian byte_order); static inline LONGEST |