public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: use gdb_assert not internal_error
@ 2022-12-15 13:10 Andrew Burgess
0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2022-12-15 13:10 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=38665d717a3e65c70e6432243d5eed9728a4888a
commit 38665d717a3e65c70e6432243d5eed9728a4888a
Author: Andrew Burgess <aburgess@redhat.com>
Date: Mon Dec 12 14:09:40 2022 +0000
gdb: use gdb_assert not internal_error
Spotted a couple of places in findvar.c where we use:
if ( ! CONDITION )
internal_error ("...");
this commit changes these to be:
gdb_assert ( CONDITION );
which I think is better.
Unless we happen to hit the internal_error calls (which was bad) there
should be no user visible changes after this commit.
Diff:
---
gdb/findvar.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 91de3fd5c3e..e609358df08 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -152,10 +152,7 @@ extract_long_unsigned_integer (const gdb_byte *addr, int orig_len,
CORE_ADDR
extract_typed_address (const gdb_byte *buf, struct type *type)
{
- if (!type->is_pointer_or_reference ())
- internal_error (_("extract_typed_address: "
- "type is not a pointer or reference"));
-
+ gdb_assert (type->is_pointer_or_reference ());
return gdbarch_pointer_to_address (type->arch (), type, buf);
}
@@ -204,10 +201,7 @@ template void store_integer (gdb_byte *addr, int len,
void
store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
{
- if (!type->is_pointer_or_reference ())
- internal_error (_("store_typed_address: "
- "type is not a pointer or reference"));
-
+ gdb_assert (type->is_pointer_or_reference ());
gdbarch_address_to_pointer (type->arch (), type, buf, addr);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-15 13:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15 13:10 [binutils-gdb] gdb: use gdb_assert not internal_error Andrew Burgess
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).