From e50841a3804045823e6d38e1de0c47640e9c0ed8 Mon Sep 17 00:00:00 2001 From: drow Date: Mon, 13 Jan 2003 21:59:49 +0000 Subject: [PATCH] * symtab.c (find_pc_sect_line): Don't consider end-of-function lines. --- gdb/ChangeLog | 5 +++++ gdb/symtab.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bb81289001..82d63fddf1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2003-01-13 Daniel Jacobowitz + * symtab.c (find_pc_sect_line): Don't consider end-of-function + lines. + +2003-01-13 Daniel Jacobowitz + * thread-db.c (attach_thread): Prototype. (struct private_thread_info): Remove lwpid. Add thread handle (th), thread information (ti), and valid flags (th_valid, ti_valid). diff --git a/gdb/symtab.c b/gdb/symtab.c index 7eab19f53d..15f4c3f15b 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1,8 +1,8 @@ /* Symbol table lookup for the GNU debugger, GDB. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, - 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software - Foundation, Inc. + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. This file is part of GDB. @@ -2012,9 +2012,11 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) the first line, prev will not be set. */ /* Is this file's best line closer than the best in the other files? - If so, record this file, and its best line, as best so far. */ + If so, record this file, and its best line, as best so far. Don't + save prev if it represents the end of a function (i.e. line number + 0) instead of a real line. */ - if (prev && (!best || prev->pc > best->pc)) + if (prev && prev->line && (!best || prev->pc > best->pc)) { best = prev; best_symtab = s; -- 2.11.0