+2009-06-18 Roland McGrath <roland@redhat.com>
+
+ * libdwP.h (__libdw_read_address_inc): Constify.
+ (__libdw_read_offset_inc): Likewise.
+ * dwarf_getaranges.c: Likewise.
+ * dwarf_getlocation.c: Likewise.
+ * dwarf_getsrclines.c: Likewise.
+ * dwarf_nextcu.c: Likewise.
+
2009-05-05 Petr Machata <pmachata@redhat.com>
* libdwP.h (__libdw_formptr): Declare new function.
/* Return list address ranges.
- Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2008 Red Hat, Inc.
+ Copyright (C) 2000-2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
struct arangelist *arangelist = NULL;
unsigned int narangelist = 0;
- const char *readp
- = (const char *) dbg->sectiondata[IDX_debug_aranges]->d_buf;
- const char *readendp = readp + dbg->sectiondata[IDX_debug_aranges]->d_size;
+ const unsigned char *readp = dbg->sectiondata[IDX_debug_aranges]->d_buf;
+ const unsigned char *readendp
+ = readp + dbg->sectiondata[IDX_debug_aranges]->d_size;
while (readp < readendp)
{
- const char *hdrstart = readp;
+ const unsigned char *hdrstart = readp;
/* Each entry starts with a header:
Dwarf_Word offset;
if (__libdw_read_offset_inc (dbg,
- IDX_debug_aranges, (unsigned char **)&readp,
+ IDX_debug_aranges, &readp,
length_bytes, &offset, IDX_debug_info, 4))
return -1;
Dwarf_Word range_address;
Dwarf_Word range_length;
- if (__libdw_read_address_inc (dbg, IDX_debug_aranges,
- (unsigned char **)&readp,
+ if (__libdw_read_address_inc (dbg, IDX_debug_aranges, &readp,
address_size, &range_address))
return -1;
/* Return location expression list.
- Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2000-2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
{
case DW_OP_addr:
/* Address, depends on address size of CU. */
- if (__libdw_read_address_inc (dbg, sec_index, (unsigned char **)&data,
+ if (__libdw_read_address_inc (dbg, sec_index, &data,
cu->address_size, &newloc->number))
return -1;
break;
/* The value is an address. The size is defined as
apporiate for the target machine. We use the
address size field from the CU header. */
- if (__libdw_read_address_inc (dbg, IDX_debug_line,
- (unsigned char **)&linep,
+ if (__libdw_read_address_inc (dbg, IDX_debug_line, &linep,
cu->address_size, &address))
goto out;
break;
/* Advance to next CU header.
- Copyright (C) 2002, 2003, 2004, 2005, 2008 Red Hat, Inc.
+ Copyright (C) 2002-2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
/* This points into the .debug_info section to the beginning of the
CU entry. */
- unsigned char *data = dwarf->sectiondata[IDX_debug_info]->d_buf;
- unsigned char *bytes = data + off;
+ const unsigned char *data = dwarf->sectiondata[IDX_debug_info]->d_buf;
+ const unsigned char *bytes = data + off;
/* The format of the CU header is described in dwarf2p1 7.5.1:
static inline int
__libdw_read_address_inc (Dwarf *dbg,
- int sec_index, unsigned char **addrp,
+ int sec_index, const unsigned char **addrp,
int width, Dwarf_Addr *ret)
{
- unsigned char *addr = *addrp;
+ const unsigned char *addr = *addrp;
READ_AND_RELOCATE (__libdw_relocate_address, (*ret));
*addrp = addr;
return 0;
static inline int
__libdw_read_offset_inc (Dwarf *dbg,
- int sec_index, unsigned char **addrp,
+ int sec_index, const unsigned char **addrp,
int width, Dwarf_Off *ret, int sec_ret,
size_t size)
{
- unsigned char *addr = *addrp;
+ const unsigned char *addr = *addrp;
READ_AND_RELOCATE (__libdw_relocate_offset, (*ret));
*addrp = addr;
return __libdw_offset_in_section (dbg, sec_ret, *ret, size);