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

[Patch] Introduce DWARF2_VERSION


Hi,

the VMS/ia64 backtrace symbolizer expect dwarf3 debugging info.
So I have define the DWARF2_VERSION macro in dwarf2dbg.c and the code
now uses it each time the dwarf version is generated.  This part makes the
code slightly more readable IMHO.

And of course, this macro is defined to 3 (!) only when the target is VMS/ia64.

Ok for trunk ?

Tristan.

gas/
2011-03-28  Tristan Gingold  <gingold@adacore.com>

	* dwarf2dbg.c (DWARF2_VERSION): Define.
	(out_debug_line): Use it.
	(out_debug_aranges): Ditto.
	(out_debug_info): Ditto.
	* config/tc-ia64.h (DWARF2_VERSION): Override it.

Index: dwarf2dbg.c
===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
retrieving revision 1.110
diff -c -r1.110 dwarf2dbg.c
*** dwarf2dbg.c	10 Mar 2011 18:26:28 -0000	1.110
--- dwarf2dbg.c	28 Mar 2011 12:19:02 -0000
***************
*** 89,94 ****
--- 89,98 ----
  #define DWARF2_FILE_SIZE_NAME(FILENAME,DIRNAME) 0
  #endif
  
+ #ifndef DWARF2_VERSION
+ #define DWARF2_VERSION 2
+ #endif
+ 
  #include "subsegs.h"
  
  #include "dwarf2.h"
***************
*** 1420,1426 ****
    line_end = exp.X_add_symbol;
  
    /* Version.  */
!   out_two (2);
  
    /* Length of the prologue following this length.  */
    prologue_end = symbol_temp_make ();
--- 1424,1430 ----
    line_end = exp.X_add_symbol;
  
    /* Version.  */
!   out_two (DWARF2_VERSION);
  
    /* Length of the prologue following this length.  */
    prologue_end = symbol_temp_make ();
***************
*** 1524,1530 ****
    aranges_end = exp.X_add_symbol;
  
  
    /* DWARF version.  */
!   out_two (DWARF2_VERSION);
  
    /* .debug_abbrev offset */
    TC_DWARF2_EMIT_OFFSET (section_symbol (abbrev_seg), sizeof_offset);
Index: config/tc-ia64.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.h,v
retrieving revision 1.47
diff -c -r1.47 tc-ia64.h
*** config/tc-ia64.h	25 Mar 2010 21:12:28 -0000	1.47
--- config/tc-ia64.h	28 Mar 2011 12:19:02 -0000
***************
*** 323,325 ****
--- 323,330 ----
     && (!(FIX)->fx_pcrel					\
         || (FIX)->fx_r_type == BFD_RELOC_IA64_PLTOFF22	\
         || TC_FORCE_RELOCATION (FIX)))
+ 
+ /* VMS backtraces expect dwarf version 3.  */
+ #ifdef TE_VMS
+ #define DWARF2_VERSION 3
+ #endif


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