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 | 25d53da1c8662a33aa767509d349115d7f7b0944 (patch) | |
tree | a9d4a3d8961e375b97e25c8831d2e85f7c8bcba2 /gdb | |
parent | d85e9ff7b10d0f7c5aec88d922f4f2b88ed4ca3d (diff) | |
download | gdb-25d53da1c8662a33aa767509d349115d7f7b0944.zip gdb-25d53da1c8662a33aa767509d349115d7f7b0944.tar.gz gdb-25d53da1c8662a33aa767509d349115d7f7b0944.tar.bz2 |
* symtab.c (find_pc_sect_line): Revise method used for finding
the ending pc.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/symtab.c | 15 |
2 files changed, 16 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1a21bc9..e880aeb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2001-03-26 Kevin Buettner <kevinb@redhat.com> + + * symtab.c (find_pc_sect_line): Revise method used for finding + the ending pc. + 2001-03-26 Mark Kettenis <kettenis@gnu.org> * i386-linux-tdep.c (i386_linux_sigtramp_saved_pc, diff --git a/gdb/symtab.c b/gdb/symtab.c index 515612e..a51126a 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) |