diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2020-04-02 15:43:41 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2020-04-02 15:43:41 -0400 |
commit | e2ff18a0a54f98c38f8d9b80c36faa7aacacf6d6 (patch) | |
tree | 5959139d65e073812e1623aad0c4547323758cb8 /gdb/psymtab.c | |
parent | 0830d301901d225403eaf6629c20a6c09f3ec8f6 (diff) | |
download | binutils-gdb-e2ff18a0a54f98c38f8d9b80c36faa7aacacf6d6.tar.gz |
gdb: replace some calls to internal_error with gdb_assert
There are a few spots using the pattern:
if (condition)
internal_error (__FILE__, __LINE__,
_("failed internal consistency check"));
The message brings no value, since it's pretty the description of a
failed assertion. Replace a few of these that are obvious with
gdb_assert.
gdb/ChangeLog:
* exec.c (build_section_table): Replace internal_error with
gdb_assert.
(section_table_xfer_memory_partial): Likewise.
* mdebugread.c (parse_partial_symbols): Likewise.
* psymtab.c (lookup_partial_symbol): Likewise.
* utils.c (wrap_here): Likewise.
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r-- | gdb/psymtab.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 26c55e9bd33..129eecb0671 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -683,9 +683,9 @@ lookup_partial_symbol (struct objfile *objfile, while (top > bottom) { center = bottom + (top - bottom) / 2; - if (!(center < top)) - internal_error (__FILE__, __LINE__, - _("failed internal consistency check")); + + gdb_assert (center < top); + if (strcmp_iw_ordered ((*center)->ginfo.search_name (), lookup_name.c_str ()) >= 0) { @@ -696,9 +696,8 @@ lookup_partial_symbol (struct objfile *objfile, bottom = center + 1; } } - if (!(top == bottom)) - internal_error (__FILE__, __LINE__, - _("failed internal consistency check")); + + gdb_assert (top == bottom); /* For `case_sensitivity == case_sensitive_off' strcmp_iw_ordered will search more exactly than what matches SYMBOL_MATCHES_SEARCH_NAME. */ |