[2/7] Remove unnecessary null check in lookup_minimal_symbol_by_pc_section
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
lookup_minimal_symbol_by_pc_section asserts that section != NULL early
in the function, rendering a later check (and comment) unnecessary.
---
gdb/minsyms.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
@@ -876,13 +876,11 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
continue;
}
- /* If SECTION was specified, skip any symbol from
- wrong section. */
- if (section
- /* Some types of debug info, such as COFF,
+ /* Skip any symbol from wrong section. */
+ if (/* Some types of debug info, such as COFF,
don't fill the bfd_section member, so don't
throw away symbols on those platforms. */
- && msymbol[hi].obj_section (objfile) != nullptr
+ msymbol[hi].obj_section (objfile) != nullptr
&& (!matching_obj_sections
(msymbol[hi].obj_section (objfile),
section)))