[3/7] Hoist a call to frob_address
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
This hoists the call to frob_address in
lookup_minimal_symbol_by_pc_section, so that it now appears earlier in
the loop. This is useful to help with a refactoring in the next
patch. Making this change also made it clear that 'pc' is not used,
so this removes the local variable as well.
---
gdb/minsyms.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -796,7 +796,9 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
for (objfile *objfile : section->objfile->separate_debug_objfiles ())
{
- CORE_ADDR pc = pc_in;
+ unrelocated_addr unrel_pc;
+ if (!frob_address (objfile, pc_in, &unrel_pc))
+ continue;
/* If this objfile has a minimal symbol table, go search it
using a binary search. */
@@ -827,9 +829,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
Warning: this code is trickier than it would appear at first. */
- unrelocated_addr unrel_pc;
- if (frob_address (objfile, pc, &unrel_pc)
- && unrel_pc >= msymbol[lo].unrelocated_address ())
+ if (unrel_pc >= msymbol[lo].unrelocated_address ())
{
while (msymbol[hi].unrelocated_address () > unrel_pc)
{