* [PATCH] Remove MAX_REGISTER_SIZE define
@ 2018-03-07 15:53 Alan Hayward
2018-03-07 16:23 ` Yao Qi
0 siblings, 1 reply; 2+ messages in thread
From: Alan Hayward @ 2018-03-07 15:53 UTC (permalink / raw)
To: gdb-patches; +Cc: nd
Many thanks to Yao for helping me remove all the other uses of
MAX_REGISTER_SIZE over the last year or so!
This patch removes the last uses of MAX_REGISTER_SIZE and deletes the define.
Built on x86 and aarch64. Grepped to ensured no more stray
MAX_REGISTER_SIZEs left in the code.
Alan
2018-03-07 Alan Hayward <alan.hayward@arm.com>
* defs.h: Remove MAX_REGISTER_SIZE
* regcache.c (init_regcache_descr): Remove MAX_REGISTER_SIZE
asserts.
* python/py-unwind.c (pyuw_sniffer): Likewise.
diff --git a/gdb/defs.h b/gdb/defs.h
index a924573b57f8322f7b674c0bf0f749ab318983e2..91988758a3a8fb5125624381dfa0277730c6c373 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -531,11 +531,6 @@ enum symbol_needs_kind
/* Dynamic target-system-dependent parameters for GDB. */
#include "gdbarch.h"
-/* * Maximum size of a register. Something small, but large enough for
- all known ISAs. If it turns out to be too small, make it bigger. */
-
-enum { MAX_REGISTER_SIZE = 64 };
-
/* In findvar.c. */
template<typename T, typename = RequireLongest<T>>
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c
index a7e3a93ebc48c58661a14c73bd4618d47ffbb81b..906a00447e691bd248ec3a83bd54b80b6b85eeff 100644
--- a/gdb/python/py-unwind.c
+++ b/gdb/python/py-unwind.c
@@ -583,7 +583,6 @@ pyuw_sniffer (const struct frame_unwind *self, struct frame_info *this_frame,
/* `value' validation was done before, just assert. */
gdb_assert (value != NULL);
gdb_assert (data_size == TYPE_LENGTH (value_type (value)));
- gdb_assert (data_size <= MAX_REGISTER_SIZE);
cached_frame->reg[i].data = (gdb_byte *) xmalloc (data_size);
memcpy (cached_frame->reg[i].data, value_contents (value), data_size);
diff --git a/gdb/regcache.c b/gdb/regcache.c
index c73582f66ae38f288b9b68d6d054a7f82ac16e60..ebd0fd3d5f786ad35a80b7ef4aeb445036aae92e 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -117,7 +117,6 @@ init_regcache_descr (struct gdbarch *gdbarch)
descr->sizeof_register[i] = TYPE_LENGTH (descr->register_type[i]);
descr->register_offset[i] = offset;
offset += descr->sizeof_register[i];
- gdb_assert (MAX_REGISTER_SIZE >= descr->sizeof_register[i]);
}
/* Set the real size of the raw register cache buffer. */
descr->sizeof_raw_registers = offset;
@@ -127,7 +126,6 @@ init_regcache_descr (struct gdbarch *gdbarch)
descr->sizeof_register[i] = TYPE_LENGTH (descr->register_type[i]);
descr->register_offset[i] = offset;
offset += descr->sizeof_register[i];
- gdb_assert (MAX_REGISTER_SIZE >= descr->sizeof_register[i]);
}
/* Set the real size of the readonly register cache buffer. */
descr->sizeof_cooked_registers = offset;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Remove MAX_REGISTER_SIZE define
2018-03-07 15:53 [PATCH] Remove MAX_REGISTER_SIZE define Alan Hayward
@ 2018-03-07 16:23 ` Yao Qi
0 siblings, 0 replies; 2+ messages in thread
From: Yao Qi @ 2018-03-07 16:23 UTC (permalink / raw)
To: Alan Hayward; +Cc: gdb-patches, nd
On Wed, Mar 7, 2018 at 3:53 PM, Alan Hayward <Alan.Hayward@arm.com> wrote:
> 2018-03-07 Alan Hayward <alan.hayward@arm.com>
>
> * defs.h: Remove MAX_REGISTER_SIZE
> * regcache.c (init_regcache_descr): Remove MAX_REGISTER_SIZE
> asserts.
> * python/py-unwind.c (pyuw_sniffer): Likewise.
>
Patch is good to me.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-07 16:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-07 15:53 [PATCH] Remove MAX_REGISTER_SIZE define Alan Hayward
2018-03-07 16:23 ` Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox