diff options
author | Kevin Buettner <kevinb@redhat.com> | 2001-03-27 01:17:47 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2001-03-27 01:17:47 +0000 |
commit | ac2097ab0b42ab4f7a189989fecf9817d0cb748d (patch) | |
tree | d42f97ef5441de5d54f24252823e438ece7db678 /gdb/symtab.c | |
parent | 6fee74e0864bef479137a665187d4a8547d20bcd (diff) | |
download | gdb-ac2097ab0b42ab4f7a189989fecf9817d0cb748d.tar.gz |
* symtab.c (find_pc_sect_line): Revise method used for finding
the ending pc.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 515612e5ba6..a51126a1d8c 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1759,11 +1759,18 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) { best = prev; best_symtab = s; - /* If another line is in the linetable, and its PC is closer - than the best_end we currently have, take it as best_end. */ - if (i < len && (best_end == 0 || best_end > item->pc)) - best_end = item->pc; + + /* Discard BEST_END if it's before the PC of the current BEST. */ + if (best_end <= best->pc) + best_end = 0; } + + /* If another line (denoted by ITEM) is in the linetable and its + PC is after BEST's PC, but before the current BEST_END, then + use ITEM's PC as the new best_end. */ + if (best && i < len && item->pc > best->pc + && (best_end == 0 || best_end > item->pc)) + best_end = item->pc; } if (!best_symtab) |