Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alan Hayward <Alan.Hayward@arm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: nd <nd@arm.com>
Subject: [PATCH] Remove MAX_REGISTER_SIZE define
Date: Wed, 07 Mar 2018 15:53:00 -0000	[thread overview]
Message-ID: <5761B350-C237-4774-A305-B12193EF8577@arm.com> (raw)

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;


             reply	other threads:[~2018-03-07 15:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 15:53 Alan Hayward [this message]
2018-03-07 16:23 ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5761B350-C237-4774-A305-B12193EF8577@arm.com \
    --to=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox