07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe Copyright (C) 2008-2010 David Anderson. All Rights Reserved.
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe This program is free software; you can redistribute it and/or modify it
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe under the terms of version 2.1 of the GNU Lesser General Public License
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe as published by the Free Software Foundation.
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe This program is distributed in the hope that it would be useful, but
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe WITHOUT ANY WARRANTY; without even the implied warranty of
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe Further, this software is distributed without any warranty that it is
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe free of the rightful claim of any third person regarding infringement
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe or the like. Any license provided herein, whether implied or
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe otherwise, applies only to this software file. Patent licenses, if
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe any, provided herein do not apply to combinations of this program with
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe other software, or any other product whatsoever.
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe You should have received a copy of the GNU Lesser General Public
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe License along with this program; if not, write the Free Software
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe Mountain View, CA 94043, or:
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe For further information regarding this notice, see:
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe http://oss.sgi.com/projects/GenInfo/NoticeExplan
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe/* The address of the Free Software Foundation is
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe Boston, MA 02110-1301, USA.
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe SGI has moved from the Crittenden Lane address.
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe#define MAX_ADDR ((address_size == 8)?0xffffffffffffffffULL:0xffffffff)
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe res = _dwarf_load_section(dbg, &dbg->de_debug_ranges,error);
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe if(rangesoffset >= dbg->de_debug_ranges.dss_size) {
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe _dwarf_error(dbg, error, DW_DLE_DEBUG_RANGES_OFFSET_BAD);
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe address_size = _dwarf_get_address_size(dbg, die);
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe rangeptr = dbg->de_debug_ranges.dss_data + rangesoffset;
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe struct ranges_entry * re = calloc(sizeof(struct ranges_entry),1);
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe _dwarf_error(dbg, error, DW_DLE_DEBUG_RANGES_OUT_OF_MEM);
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe if((rangeptr + (2*address_size)) > section_end) {
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe _dwarf_error(dbg, error, DW_DLE_DEBUG_RANGES_OFFSET_BAD);
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe if(re->cur.dwr_addr1 == 0 && re->cur.dwr_addr2 == 0) {
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe re->cur.dwr_type = DW_RANGES_ADDRESS_SELECTION;
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe _dwarf_get_alloc(dbg,DW_DLA_RANGES,entry_count);
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe _dwarf_error(dbg, error, DW_DLE_DEBUG_RANGES_OUT_OF_MEM);
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe for( copyindex = 0; curre && (copyindex < entry_count);
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe /* Callers will often not care about the bytes used. */
07dc1947c362e187fb955d283b692f8769dd5defRichard Lowe int res = dwarf_get_ranges_a(dbg,rangesoffset,die,