This is the mail archive of the binutils@sourceware.cygnus.com 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]

patch for binutils/readelf.c, DW_LNS_const_add_pc bug


The offset needs to be multiplied by the minimum instruction size.

Thu Aug 26 15:36:01 1999  Jim Wilson  <wilson@cygnus.com>

	* readelf.c (display_debug_lines, case DW_LNS_const_add_pc): Multiply
	adv by info.li_min_insn_length.

Index: readelf.c
===================================================================
RCS file: /cvs/cvsfiles/devo/binutils/readelf.c,v
retrieving revision 1.85
diff -p -r1.85 readelf.c
*** readelf.c	1999/08/26 03:52:31	1.85
--- readelf.c	1999/08/26 22:35:40
*************** display_debug_lines (section, start, fil
*** 4398,4404 ****
  	      break;
  	      
  	    case DW_LNS_const_add_pc:
! 	      adv = (255 - info.li_opcode_base) / info.li_line_range;
  	      state_machine_regs.address += adv;
  	      printf (_("  Advance PC by constant %d to 0x%lx\n"), adv,
  		      state_machine_regs.address);
--- 4398,4405 ----
  	      break;
  	      
  	    case DW_LNS_const_add_pc:
! 	      adv = (((255 - info.li_opcode_base) / info.li_line_range)
! 		     * info.li_min_insn_length);
  	      state_machine_regs.address += adv;
  	      printf (_("  Advance PC by constant %d to 0x%lx\n"), adv,
  		      state_machine_regs.address);

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