This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/users/ccoutant/two-level-line-tables] Fix problems with DW_LNS_pop_context in logicals table.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ab071889a98a434e1454d66539f987732c5d099e

commit ab071889a98a434e1454d66539f987732c5d099e
Author: Cary Coutant <ccoutant@google.com>
Date:   Thu Jan 15 13:48:31 2015 -0800

    Fix problems with DW_LNS_pop_context in logicals table.
    
    2015-01-15  Cary Coutant  <ccoutant@google.com>
    
    gas/
    	* dwarf2dbg.c (emit_logicals): Fix bug in generating
    	DW_LNS_pop_context.
    	(process_entries): Don't always emit DW_LNS_set_address_from_logical
    	when crossing frag boundaries.

Diff:
---
 gas/dwarf2dbg.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 811feb1..d9edc0b 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -1546,7 +1546,7 @@ emit_logicals (void)
 
       if (context != e->context || subprog != e->subprog)
         {
-	  unsigned int caller = e->context;
+	  unsigned int caller = context;
 	  unsigned int npop = 0;
 
 	  // See if a sequence of DW_LNS_pop_context ops will get
@@ -1554,7 +1554,7 @@ emit_logicals (void)
 	  while (caller > 0 && caller <= logicals_in_use)
 	    {
 	      ++npop;
-	      if (logicals[caller - 1].subprog == subprog)
+	      if (logicals[caller - 1].subprog == e->subprog)
 		break;
 	      caller = logicals[caller - 1].context;
 	    }
@@ -1757,17 +1757,18 @@ process_entries (segT seg, struct line_entry *e)
       frag = symbol_get_frag (lab);
       frag_ofs = S_GET_VALUE (lab);
 
-      if (logicals_in_use > 0
-	  && frag != last_frag
-	  && logicals[e->loc.logical - 1].label == lab)
+      if (last_frag == NULL)
 	{
-	  out_set_addr_from_logical (line_delta);
-	  out_opcode (DW_LNS_copy);
-	}
-      else if (last_frag == NULL)
-	{
-	  out_set_addr (lab);
-	  out_inc_line_addr (line_delta, 0);
+	  if (logicals_in_use > 0 && logicals[e->loc.logical - 1].label == lab)
+	    {
+	      out_set_addr_from_logical (line_delta);
+	      out_opcode (DW_LNS_copy);
+	    }
+	  else
+	    {
+	      out_set_addr (lab);
+	      out_inc_line_addr (line_delta, 0);
+	    }
 	}
       else if (frag == last_frag && ! DWARF2_USE_FIXED_ADVANCE_PC)
 	out_inc_line_addr (line_delta, frag_ofs - last_frag_ofs);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]