This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

[PATCH] Don't trim addresses in Dwarf debug info



I've committed this:

2000-03-27  Jim Blandy  <jimb@redhat.com>

	* dwarf2read.c: Revert Andrew Cagney's change of Dec 15, 1997.
	Don't include "bfd-elf.h".
	(address_significant_size): Delete variable.
	(dwarf2_build_psymtabs_hard): Don't set it, or check for
	consistency between it and the Dwarf 2 compilation unit header
	address size.
	(read_address): Don't mask off bits above
	address_significant_size.
	* Makefile.in (dwarf2read.o): Don't depend on $(elf_bfd_h).
	(elf_bfd_h): Remove variable; it's no longer used.
	
Index: gdb/dwarf2read.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/dwarf2read.c,v
retrieving revision 2.37
diff -c -r2.37 dwarf2read.c
*** gdb/dwarf2read.c	2000/02/29 07:14:21	2.37
--- gdb/dwarf2read.c	2000/03/27 20:50:09
***************
*** 27,33 ****
  
  #include "defs.h"
  #include "bfd.h"
- #include "elf-bfd.h"
  #include "symtab.h"
  #include "gdbtypes.h"
  #include "symfile.h"
--- 27,32 ----
***************
*** 546,560 ****
     whatever scope is currently getting read. */
  static int address_size;
  
- /* Some elf32 object file formats while linked for a 32 bit address
-    space contain debug information that has assumed 64 bit
-    addresses. Eg 64 bit MIPS target produced by GCC/GAS/LD where the
-    symbol table contains 32bit address values while its .debug_info
-    section contains 64 bit address values.
-    ADDRESS_SIGNIFICANT_SIZE specifies the number significant bits in
-    the ADDRESS_SIZE bytes read from the file */
- static int address_significant_size;
- 
  /* Externals references.  */
  extern int info_verbose;	/* From main.c; nonzero => verbose */
  
--- 545,550 ----
***************
*** 937,945 ****
    int comp_unit_has_pc_info;
    CORE_ADDR lowpc, highpc;
  
-   /* Number of bytes of any addresses that are signficant */
-   address_significant_size = get_elf_backend_data (abfd)->s->arch_size / 8;
- 
    info_ptr = dwarf_info_buffer;
    abbrev_ptr = dwarf_abbrev_buffer;
  
--- 927,932 ----
***************
*** 980,992 ****
  		 (long) (beg_of_comp_unit - dwarf_info_buffer));
  	  return;
  	}
-       if (address_size < address_significant_size)
- 	{
- 	  error ("Dwarf Error: bad address size (%ld) in compilation unit header (offset 0x%lx + 11).",
- 		 (long) cu_header.addr_size,
- 		 (long) (beg_of_comp_unit - dwarf_info_buffer));
- 	}
- 
        /* Read the abbrevs for this compilation unit into a table */
        dwarf2_read_abbrevs (abfd, cu_header.abbrev_offset);
        make_cleanup (dwarf2_empty_abbrev_table, NULL);
--- 967,972 ----
***************
*** 3499,3516 ****
      default:
        /* *THE* alternative is 8, right? */
        abort ();
-     }
-   /* If the address being read is larger than the address that is
-      applicable for the object file format then mask it down to the
-      correct size.  Take care to avoid unnecessary shift or shift
-      overflow */
-   if (address_size > address_significant_size
-       && address_significant_size < sizeof (CORE_ADDR))
-     {
-       CORE_ADDR mask = ((CORE_ADDR) 0) - 1;
-       retval &= ~(mask << (address_significant_size * 8));
      }
!   return retval;
  }
  
  static char *
--- 3479,3487 ----
      default:
        /* *THE* alternative is 8, right? */
        abort ();
      }
! 
!  return retval;
  }
  
  static char *
Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/Makefile.in,v
retrieving revision 1.760
diff -c -r1.760 Makefile.in
*** gdb/Makefile.in	2000/03/20 04:36:02	1.760
--- gdb/Makefile.in	2000/03/27 20:50:10
***************
*** 507,513 ****
  getopt_h =	$(INCLUDE_DIR)/getopt.h
  floatformat_h =	$(INCLUDE_DIR)/floatformat.h
  bfd_h =		$(BFD_DIR)/bfd.h
- elf_bfd_h =     $(BFD_SRC)/elf-bfd.h
  dis-asm_h =	$(INCLUDE_DIR)/dis-asm.h 
  remote-sim_h =	$(INCLUDE_DIR)/remote-sim.h
  
--- 507,512 ----
***************
*** 1251,1257 ****
  	$(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \
  	$(symtab_h) gdb_string.h
  
! dwarf2read.o: dwarf2read.c $(bfd_h) $(elf_bfd_h) buildsym.h $(defs_h) \
  	$(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \
  	$(symtab_h) gdb_string.h
  
--- 1250,1256 ----
  	$(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \
  	$(symtab_h) gdb_string.h
  
! dwarf2read.o: dwarf2read.c $(bfd_h) buildsym.h $(defs_h) \
  	$(expression_h) $(gdbtypes_h) language.h objfiles.h symfile.h \
  	$(symtab_h) gdb_string.h
  

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