This is the mail archive of the binutils@sources.redhat.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]
Other format: [Raw text]

[PATCH] handle stabs line numbers outside functions


When GAS emits a stabs entry for a line number inside a function, it uses the 
address relative to the start of the function.  If GAS doesn't know that the 
line is within a particular function, it emits an absolute address.  The 
current stabs-reading code in binutils always subtracts the current function 
offset, which gives bad results if GAS emitted the stab with an absolute 
address.  This patch enables the binutils stabs code to read both kinds of 
line number stabs that GAS produces.

2003-02-12  Bob Wilson  <bob.wilson@acm.org>

	* stabs.c (parse_stab): For N_SLINE only include function_start_offset
	if the symbol is within a function; otherwise, the value is absolute.

Index: stabs.c
===================================================================
RCS file: /cvs/src/src/binutils/stabs.c,v
retrieving revision 1.13
diff -c -3 -r1.13 stabs.c
*** stabs.c	30 Nov 2002 08:39:41 -0000	1.13
--- stabs.c	12 Feb 2003 17:36:05 -0000
***************
*** 610,616 ****
  
      case N_SLINE:
        if (! debug_record_line (dhandle, desc,
! 			       value + info->function_start_offset))
  	return FALSE;
        break;
  
--- 610,617 ----
  
      case N_SLINE:
        if (! debug_record_line (dhandle, desc,
! 			       value + (info->within_function
! 					? info->function_start_offset : 0)))
  	return FALSE;
        break;
  

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