[Bug binutils/2768] readelf and segmented addresses in DWARF2/3 aranges

2006-08-08 Thread nickc at redhat dot com

--- Additional Comments From nickc at redhat dot com  2006-08-08 09:41 
---
Created an attachment (id=1211)
 -- (http://sourceware.org/bugzilla/attachment.cgi?id=1211action=view)
Display 8 byte addresses as 8 byte values


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2768

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/2768] readelf and segmented addresses in DWARF2/3 aranges

2006-08-08 Thread nickc at redhat dot com

--- Additional Comments From nickc at redhat dot com  2006-08-08 09:42 
---
Hi Stephane,

  My apologese for taking so long to get back to this issue.

  You are right - the addresses and lengths are being incorrectly truncated.  I
am going to apply the newly uploaded patch to fix this.

Cheers
  Nick

binutils/ChangeLog
2006-08-08  Nick Clifton  [EMAIL PROTECTED]

PR binutils/2768
* dwarf.c (display_debug_aranges): When the address size is
greater than 4 display addresses and lengths as 16 hex digits,
otherwise use 8 hex digits.

-- 
   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution||FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=2768

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/2768] readelf and segmented addresses in DWARF2/3 aranges

2006-06-28 Thread stephane dot chauveau at philips dot com

--- Additional Comments From stephane dot chauveau at philips dot com  
2006-06-28 10:01 ---
I checked the pathc and it seems to work fine. 
The only remaining problem is the one I described in comment 8
The overall size when both the ponter and segment size are 4 bytes is 64 bit but
only 32bit are displayed. More generally, DWARF2 does not fully specify how to
interpret a segmented address so it would make sense to display each segemented
address (and the length too) as a byte sequence instead of converting it to a
numerical value. 

The current output for a_4_4.elf looks relatively good because the file is
little endian:  

Address  Length
000b 2
0005 9
0200 20
0214 536
 0

If the file was big endian (or if the relative order of the segment and offset
part of each address were swapped), the other 32 bit would be used and the
output would be:

Address  Length
0001 0
0001 0
 0
 0
 0

The output obtained with printing the raw sequences of bytes would be: 
  
AddressLength
0001000b 0x0002
00010005 0x0009
0200 0x0014
0214 0x0218
 0x

I prefixed the length by '0x' to avoid a potential ambiguity because the it is
currently expressed in decimal for non segmented addresses.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2768

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/2768] readelf and segmented addresses in DWARF2/3 aranges

2006-06-22 Thread nickc at redhat dot com

--- Additional Comments From nickc at redhat dot com  2006-06-22 14:36 
---
Hi Stephane,

  Thanks for supplying the test cases.  I have now been able to reproduce the
problem and I am going to upload a patch that fixes it.  If you would care to
try it out and let me know if you encounter any problems I would be most 
grateful.

Cheers
  Nick


-- 
   What|Removed |Added

 Status|WAITING |SUSPENDED


http://sourceware.org/bugzilla/show_bug.cgi?id=2768

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/2768] readelf and segmented addresses in DWARF2/3 aranges

2006-06-22 Thread nickc at redhat dot com


-- 
   What|Removed |Added

 Status|SUSPENDED   |WAITING


http://sourceware.org/bugzilla/show_bug.cgi?id=2768

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/2768] readelf and segmented addresses in DWARF2/3 aranges

2006-06-15 Thread stephane dot chauveau at philips dot com

--- Additional Comments From stephane dot chauveau at philips dot com  
2006-06-15 07:46 ---
Created an attachment (id=1091)
 -- (http://sourceware.org/bugzilla/attachment.cgi?id=1091action=view)
reference elf file (not segmented)

in that version, the arange section is not explictly segmented. The 'segment'
is implicitly encoded in the most significant 8 bit of each 32bit address. So,
for example, 010b describes a range at address 0x0b in segment 0x01
(DATA). 

# readelf --debug-dump=aranges a_4_0.elf 
The section .debug_aranges contains:

  Length:   52
  Version:  2
  Offset into .debug_info:  0
  Pointer Size: 4
  Segment Size: 0

Address  Length
010b 2
0105 9
0200 20
0214 536


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2768

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/2768] readelf and segmented addresses in DWARF2/3 aranges

2006-06-15 Thread stephane dot chauveau at philips dot com

--- Additional Comments From stephane dot chauveau at philips dot com  
2006-06-15 07:53 ---
Created an attachment (id=1092)
 -- (http://sourceware.org/bugzilla/attachment.cgi?id=1092action=view)
elf file with address_size=3 bytes and segmen_sizet=1byte

In that version, I indicate explicitly that an address is compose of a 3 bytes
offset and a 1 byte segment so still a total of 4 bytes.
Readelf does not like it at all:
 
# readelf a_3_1.elf
The section .debug_aranges contains:

  Length:   52
  Version:  2
  Offset into .debug_info:  0
  Pointer Size: 3
  Segment Size: 1

Address  Length
readelf: Error: Unhandled data length: 3
Aborted


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2768

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/2768] readelf and segmented addresses in DWARF2/3 aranges

2006-06-15 Thread stephane dot chauveau at philips dot com

--- Additional Comments From stephane dot chauveau at philips dot com  
2006-06-15 08:24 ---
(From update of attachment 1093)
The ELF file is incorrect (the end marker in a .debug_arange section is
2*4bytes instead of 2*8bytes)


-- 
   What|Removed |Added

Attachment #1093 is|0   |1
   obsolete||


http://sourceware.org/bugzilla/show_bug.cgi?id=2768

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/2768] readelf and segmented addresses in DWARF2/3 aranges

2006-06-15 Thread stephane dot chauveau at philips dot com

--- Additional Comments From stephane dot chauveau at philips dot com  
2006-06-15 08:33 ---
Created an attachment (id=1094)
 -- (http://sourceware.org/bugzilla/attachment.cgi?id=1094action=view)
Proper version of a_4_4.elf

A proper version of the previous sample a_4_4.elf.
Readelf does not crash but interpret each offsetsegment as a pair
addresslength. 

# readelf --debug-dump=aranges a_4_4.elf 
The section .debug_aranges contains:

  Length:   92
  Version:  2
  Offset into .debug_info:  0
  Pointer Size: 4
  Segment Size: 4

Address  Length
000b 1
0002 1
0005 1
0009 1
0200 0
0014 0
0214 0
0218 0


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2768

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/2768] readelf and segmented addresses in DWARF2/3 aranges

2006-06-15 Thread stephane dot chauveau at philips dot com

--- Additional Comments From stephane dot chauveau at philips dot com  
2006-06-15 09:21 ---
A few more remarks:

(1) Because of the alignment constraints, it is probably safe to assume that the
total size of each address (including the segment) will be a power of two.  
Readelf should be safe if it covers the total address sizes of 2, 4  8. 
The case address_size=2 and segment_size=2 is a likely to happen since DSPs with
16bit addresses and complex memory features (paging, PROG/DATA, ...) are quite
common. I do not have any samples yet. 

(2) The DWARF specs do not specify how the segments is encoded in the address so
readelf should simply dump the overall value.

(3) The cases such as address_size=4  segment_size=4 are problematic when
readelf is built without 64bit support. 
The functions get_byte_little_endian() and get_byte_big_endian() are only
providing 4 of the required 8 bytes. 
Displaying only part of the values is a minor issue.
What is more problematic is that the detection of the end marker (2 times ZERO)
could be incorrect.   

A simple way to have a very generic implementation could be to process the
address  length not using get_byte() but using two new functions:
   - one to dump an arbitrary sequence of bytes as a little or big endian
hexadecimal number. 
   - one to test if a sequence of bytes is only composed of zeros.



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2768

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/2768] readelf and segmented addresses in DWARF2/3 aranges

2006-06-14 Thread nickc at redhat dot com

--- Additional Comments From nickc at redhat dot com  2006-06-14 16:36 
---
Hi Stephane,

  Can you provide an example object file containing debug information for a
segmented address architecture ?

Cheers
  Nick



-- 
   What|Removed |Added

 Status|NEW |WAITING


http://sourceware.org/bugzilla/show_bug.cgi?id=2768

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils