[7/7] Fix address comparison 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 |
fail
|
Testing failed
|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
fail
|
Testing failed
|
Commit Message
I noticed that lookup_minimal_symbol_by_pc_section is comparing
unrelocated addresses across objfiles when trying to find the best
symbol. However, this seems incorrect to me, as the unrelocated
addresses aren't of interest here. This patch changes this code to
compare the true addresses instead.
This does make me wonder whether this code is necessary at all.
---
gdb/minsyms.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
@@ -1035,8 +1035,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
table. See if it is the best one overall. */
if (minsym != nullptr
&& (best.minsym == nullptr
- || (best.minsym->unrelocated_address ()
- < minsym->unrelocated_address ())))
+ || best.value_address () < minsym->value_address (objfile)))
best = { minsym, objfile };
}