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]

Re: path for gdb/dwarf2read.c, support 16-bit targets in dwarf-2


Jim Blandy wrote:

> Or maybe I'm misunderstanding things.  Andrew, as the committer of
> this change, can you comment?

From something in '97, I'll try :-)

> Mon Dec 15 11:38:52 1997  Andrew Cagney  <cagney@b1.cygnus.com>
> 
>         * dwarf2read.c: From change proposed by Gavin Koch.
>         (address_significant_size): New static variable.
>         (dwarf2_build_psymtabs_hard): Check consistency between
>         `address_size' and `address_significant_size'.
>         (read_address): MASK out all but the significant bits, as
>         determined by `address_significant_size', of any addresses.
>         (elf-bfd.h): Include.
>         (dwarf2_build_psymtabs_hard): Set `address_significant_size'
>         according to the arch_size of the elf object file.

I believe it is for an embedded 64 bit mips target (o64?) that is using
64 bit addresses within an elf32 executable.  (but the addresses are
assumed to be 32bit sign extended).  Due to elf32, some debug info is 64
bits, but other (symbol table?) is only 32 bits.

The mask has two effects:

	o	it makes data from the two tables
		match.

	o	it gives the user a better experience:
			(gdb) x/i 0x800000200
			0x800000200 <start>: ldi $1, 0
			(gdb) print &start
			$1 = 0x800000200
		vs
			x/i 0xffffffff800000200
			0xffffffff800000200 <start>: ldi $1, 0
			(gdb) print &start
			$2 = 0xffffffff800000200
		at the cost of carrying around wrong
		information and complicating the target.

As for ``fixing'' it.
One part is deprecating that object file format and changing it to
elf64.  I believe that, at the time the above format was created, BFD
didn't support elf64.
Also on the list is getting GDB to provide the above experience without
having the internal structures lie (ie have symtab contain correct
information).  This is likely to be important any way as people are
starting to work on the problem of a single GDB being able to debug both
elf32 and elf64 binaries.

I think I've got this right :-/

	Andrew

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