From 09a798eacc256a0368dc1e8805372d319cffd9b6 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 26 Aug 1999 12:13:01 +0000 Subject: [PATCH] This makes the line number info for the end of a function match what the standard specifies. The current code could confuse a debugger. --- gas/ChangeLog | 7 +++++++ gas/dwarf2dbg.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 495eb4978a1..7512e93840c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +1999-08-26 David Mosberger + + * dwarf2dbg.c (out_end_sequence): If address changed, directly + output "advance_pc" opcode instead of calling gen_addr_line(). + The latter has the undesired side-effect of creating a new row + in the debug line info matrix. + 1999-08-26 Jim Wilson * dwarf2dbg.c (out_end_sequence): Correct comments. Set last to diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 230e189d878..c45d598ffc0 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -341,9 +341,15 @@ out_end_sequence () } else { - delta = addr - ls.sm.addr; + delta = (addr - ls.sm.addr) / DWARF2_LINE_MIN_INSN_LENGTH; if (delta > 0) - gen_addr_line (0, delta / DWARF2_LINE_MIN_INSN_LENGTH); + { + /* Advance address without updating the line-debug + matrix---the end_sequence entry is used only to tell + the debugger the end of the sequence.*/ + out_opcode (DW_LNS_advance_pc); + out_uleb128 (delta); + } } } else -- 2.30.2