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]

[RFC patch]: Adjust the use of 'long' type in dwarf2.h header


Hello,

This patch addresses issues I've seen in binutils about
cross-compilers and dwarf2 display via objdump -W on hosts, which have
sizeof (long) < target's sizeof(void *). Additionally same issue of
course can be seen on LLP64 targets, too.
Those issues are caused by the fact that the dwarf2.h header in
include/ is using unconditionally the type 'unsigned long' for
vma-scalars.

This patch address additionally the binutils' dwarf.(c|h) files and
make them host bitness independent for gcc base toolchains supporting
the 'long long' type.

I've tested the attached patches for gdb, binutils, and gcc on
i686-w64-mingw32, and x86_64-w64-mingw32 cross-toolchains hosted on
cygwin. And I didn't found until now regressions. Later this day I
want to do a regression test for linux64, too.


binutils, gdb, gcc

ChangeLog include/

2011-02-17  Kai Tietz

	* dwarf2.h (dw2_vma_t): New type.
	(dw2_svma_t): New type.
	(DW2_VMA_FMT): New macro specifying
	to be used width-sepecifier for printing
	new types.


ChangeLog binutils/

2011-02-17  Kai Tietz

	* dwarf.c (read_leb128): Use dw2_vma_t instead of
	long type.
	(process_extended_line_op): Use for adr new type
	and print dw2 values via DW2_VMA_FMT.
	(fetch_indirect_string): Adjust offset's type.
	(decode_location_expression): Adjust argument types
	and uvalue type.
	(read_and_display_attr_value): Likewise.
	(read_and_display_attr): Likewise.
	(decode_location_expression): Adjust printf format.
	(process_debug_info): Likewise.
	(display_debug_lines_raw): Likewise.
	(display_debug_lines_decoded): Likewise.
	(display_debug_pubnames): Likewise.
	(display_debug_loc): Likewise.
	(display_debug_aranges): Likewise.
	* dwarf.h: Add include of dwarf2.h header and
	use of dw2_vma_t instead of long types.
	(read_leb128): Adjust return type.
	
	
Regards,
Kai


PS: On gdb there is at the moment in gdb/common part the include-path
to intl for libintl.h missing

Attachment: b_dw2_inc.txt
Description: Text document

Attachment: d_dw2.txt
Description: Text document

Attachment: g_dwarf2.txt
Description: Text document


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