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]

Re: [PATCH 3/6] DWARF-5 basic functionality


Hi Jan,

  Oops - I forgot - I found a bug in this patch whilst running your testcase:
 
> +static void
> +display_loclists_list (struct dwarf_section *section,
> +		       unsigned char **start_ptr,
> +		       unsigned int debug_info_entry,
> +		       unsigned long offset,
> +		       unsigned long base_address,
> +		       int has_frame_base)
> +{
 
> +	case DW_LLE_base_address:
> +	  SAFE_BYTE_GET_AND_INC (base_address, start, pointer_size,
> +				 section_end);
> +	  print_dwarf_vma (base_address, pointer_size);
> +	  printf (_("(base address)\n"));
> +	  break;

The SAFE_BYTE_GET_AND_INC macro will trigger a runtime abort if this
code is compiled for a 32-bit host (where sizeof base_address == 4) and
run on DWARF5 information created for a 64-bit target (where 
pointer_size == 8).

I used a local patch which read the new base address into a bfd_vma 
variable and then assigned it to the real base_address afterwards, but
it occurred to me afterwards that this was wrong and that really the
base_address parameter should be a bfd_vma.  Probably offset should be
one too.

Cheers
  Nick



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