From e8717518fcdbb494188cbbfeb57037be3fe7bc11 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Fri, 22 Feb 2002 00:17:13 +0000 Subject: [PATCH] Approved by Jim Blandy (jimb@redhat.com). 2002-02-21 Fred Fish * dbxread.c (process_one_symbol): When finding an N_FUN symbol that marks the end of the range of a function, enter a line number entry that has a line number of zero and a PC offset that matches the end of the function. This starts a range of PC's for which no line number information is known. * symtab.c (find_pc_sect_line): If our best fit is in a range of PC's for which no line number info is found (line number is zero) then we didn't find any valid line information. * symtab.h: Document use of zero line number entry. --- gdb/ChangeLog | 12 ++++++++++++ gdb/dbxread.c | 1 + gdb/symtab.c | 7 +++++++ gdb/symtab.h | 5 ++++- 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d1385a23003..4a1808ecb49 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2002-02-21 Fred Fish + + * dbxread.c (process_one_symbol): When finding an N_FUN symbol + that marks the end of the range of a function, enter a line number + entry that has a line number of zero and a PC offset that matches + the end of the function. This starts a range of PC's for which no + line number information is known. + * symtab.c (find_pc_sect_line): If our best fit is in a range of + PC's for which no line number info is found (line number is zero) + then we didn't find any valid line information. + * symtab.h: Document use of zero line number entry. + 2002-02-21 Elena Zannoni * ppc-linux-nat.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Define. diff --git a/gdb/dbxread.c b/gdb/dbxread.c index e9c2a854afb..26be70c18bb 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2741,6 +2741,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, { /* This N_FUN marks the end of a function. This closes off the current block. */ + record_line (current_subfile, 0, function_start_offset + valu); within_function = 0; new = pop_context (); diff --git a/gdb/symtab.c b/gdb/symtab.c index 743253f1d9c..d03a7c91076 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1823,6 +1823,13 @@ find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent) val.end = alt->pc; } } + else if (best->line == 0) + { + /* If our best fit is in a range of PC's for which no line + number info is available (line number is zero) then we didn't + find any valid line information. */ + val.pc = pc; + } else { val.symtab = best_symtab; diff --git a/gdb/symtab.h b/gdb/symtab.h index f01cbbe012d..75470e60f75 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -801,7 +801,10 @@ struct linetable_entry 30 0x300 10 0x400 - for the increment part of a for stmt. - */ + If an entry has a line number of zero, it marks the start of a PC + range for which no line number information is available. It is + acceptable, though wasteful of table space, for such a range to be + zero length. */ struct linetable { -- 2.30.2