diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-12-12 14:09:40 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-12-15 13:09:51 +0000 |
commit | 38665d717a3e65c70e6432243d5eed9728a4888a (patch) | |
tree | 0ed4534c4164e1ee25bee742046e7f45521989bb /gdb | |
parent | c896441822c9c5a506dfe302a292aaa41412058a (diff) | |
download | gdb-38665d717a3e65c70e6432243d5eed9728a4888a.zip gdb-38665d717a3e65c70e6432243d5eed9728a4888a.tar.gz gdb-38665d717a3e65c70e6432243d5eed9728a4888a.tar.bz2 |
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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/findvar.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c index 91de3fd..e609358 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); } |