@@ -136,7 +136,7 @@ enum attr_val_encoding
136
136
/* An address. */
137
137
ATTR_VAL_ADDRESS ,
138
138
/* An index into the .debug_addr section, whose value is relative to
139
- * the DW_AT_addr_base attribute of the compilation unit. */
139
+ the DW_AT_addr_base attribute of the compilation unit. */
140
140
ATTR_VAL_ADDRESS_INDEX ,
141
141
/* A unsigned integer. */
142
142
ATTR_VAL_UINT ,
@@ -274,8 +274,8 @@ struct function
274
274
struct function_addrs
275
275
{
276
276
/* Range is LOW <= PC < HIGH. */
277
- uint64_t low ;
278
- uint64_t high ;
277
+ uintptr_t low ;
278
+ uintptr_t high ;
279
279
/* Function for this address range. */
280
280
struct function * function ;
281
281
};
@@ -356,8 +356,8 @@ struct unit
356
356
struct unit_addrs
357
357
{
358
358
/* Range is LOW <= PC < HIGH. */
359
- uint64_t low ;
360
- uint64_t high ;
359
+ uintptr_t low ;
360
+ uintptr_t high ;
361
361
/* Compilation unit for this address range. */
362
362
struct unit * u ;
363
363
};
@@ -1094,7 +1094,7 @@ resolve_addr_index (const struct dwarf_sections *dwarf_sections,
1094
1094
uint64_t addr_base , int addrsize , int is_bigendian ,
1095
1095
uint64_t addr_index ,
1096
1096
backtrace_error_callback error_callback , void * data ,
1097
- uint64_t * address )
1097
+ uintptr_t * address )
1098
1098
{
1099
1099
uint64_t offset ;
1100
1100
struct dwarf_buf addr_buf ;
@@ -1115,7 +1115,7 @@ resolve_addr_index (const struct dwarf_sections *dwarf_sections,
1115
1115
addr_buf .data = data ;
1116
1116
addr_buf .reported_underflow = 0 ;
1117
1117
1118
- * address = read_address (& addr_buf , addrsize );
1118
+ * address = ( uintptr_t ) read_address (& addr_buf , addrsize );
1119
1119
return 1 ;
1120
1120
}
1121
1121
@@ -1194,7 +1194,7 @@ function_addrs_search (const void *vkey, const void *ventry)
1194
1194
1195
1195
static int
1196
1196
add_unit_addr (struct backtrace_state * state , void * rdata ,
1197
- uint64_t lowpc , uint64_t highpc ,
1197
+ uintptr_t lowpc , uintptr_t highpc ,
1198
1198
backtrace_error_callback error_callback , void * data ,
1199
1199
void * pvec )
1200
1200
{
@@ -1530,10 +1530,10 @@ lookup_abbrev (struct abbrevs *abbrevs, uint64_t code,
1530
1530
lowpc/highpc is set or ranges is set. */
1531
1531
1532
1532
struct pcrange {
1533
- uint64_t lowpc ; /* The low PC value. */
1533
+ uintptr_t lowpc ; /* The low PC value. */
1534
1534
int have_lowpc ; /* Whether a low PC value was found. */
1535
1535
int lowpc_is_addr_index ; /* Whether lowpc is in .debug_addr. */
1536
- uint64_t highpc ; /* The high PC value. */
1536
+ uintptr_t highpc ; /* The high PC value. */
1537
1537
int have_highpc ; /* Whether a high PC value was found. */
1538
1538
int highpc_is_relative ; /* Whether highpc is relative to lowpc. */
1539
1539
int highpc_is_addr_index ; /* Whether highpc is in .debug_addr. */
@@ -1553,12 +1553,12 @@ update_pcrange (const struct attr* attr, const struct attr_val* val,
1553
1553
case DW_AT_low_pc :
1554
1554
if (val -> encoding == ATTR_VAL_ADDRESS )
1555
1555
{
1556
- pcrange -> lowpc = val -> u .uint ;
1556
+ pcrange -> lowpc = ( uintptr_t ) val -> u .uint ;
1557
1557
pcrange -> have_lowpc = 1 ;
1558
1558
}
1559
1559
else if (val -> encoding == ATTR_VAL_ADDRESS_INDEX )
1560
1560
{
1561
- pcrange -> lowpc = val -> u .uint ;
1561
+ pcrange -> lowpc = ( uintptr_t ) val -> u .uint ;
1562
1562
pcrange -> have_lowpc = 1 ;
1563
1563
pcrange -> lowpc_is_addr_index = 1 ;
1564
1564
}
@@ -1567,18 +1567,18 @@ update_pcrange (const struct attr* attr, const struct attr_val* val,
1567
1567
case DW_AT_high_pc :
1568
1568
if (val -> encoding == ATTR_VAL_ADDRESS )
1569
1569
{
1570
- pcrange -> highpc = val -> u .uint ;
1570
+ pcrange -> highpc = ( uintptr_t ) val -> u .uint ;
1571
1571
pcrange -> have_highpc = 1 ;
1572
1572
}
1573
1573
else if (val -> encoding == ATTR_VAL_UINT )
1574
1574
{
1575
- pcrange -> highpc = val -> u .uint ;
1575
+ pcrange -> highpc = ( uintptr_t ) val -> u .uint ;
1576
1576
pcrange -> have_highpc = 1 ;
1577
1577
pcrange -> highpc_is_relative = 1 ;
1578
1578
}
1579
1579
else if (val -> encoding == ATTR_VAL_ADDRESS_INDEX )
1580
1580
{
1581
- pcrange -> highpc = val -> u .uint ;
1581
+ pcrange -> highpc = ( uintptr_t ) val -> u .uint ;
1582
1582
pcrange -> have_highpc = 1 ;
1583
1583
pcrange -> highpc_is_addr_index = 1 ;
1584
1584
}
@@ -1613,16 +1613,16 @@ add_low_high_range (struct backtrace_state *state,
1613
1613
uintptr_t base_address , int is_bigendian ,
1614
1614
struct unit * u , const struct pcrange * pcrange ,
1615
1615
int (* add_range ) (struct backtrace_state * state ,
1616
- void * rdata , uint64_t lowpc ,
1617
- uint64_t highpc ,
1616
+ void * rdata , uintptr_t lowpc ,
1617
+ uintptr_t highpc ,
1618
1618
backtrace_error_callback error_callback ,
1619
1619
void * data , void * vec ),
1620
1620
void * rdata ,
1621
1621
backtrace_error_callback error_callback , void * data ,
1622
1622
void * vec )
1623
1623
{
1624
- uint64_t lowpc ;
1625
- uint64_t highpc ;
1624
+ uintptr_t lowpc ;
1625
+ uintptr_t highpc ;
1626
1626
1627
1627
lowpc = pcrange -> lowpc ;
1628
1628
if (pcrange -> lowpc_is_addr_index )
@@ -1660,10 +1660,10 @@ add_ranges_from_ranges (
1660
1660
struct backtrace_state * state ,
1661
1661
const struct dwarf_sections * dwarf_sections ,
1662
1662
uintptr_t base_address , int is_bigendian ,
1663
- struct unit * u , uint64_t base ,
1663
+ struct unit * u , uintptr_t base ,
1664
1664
const struct pcrange * pcrange ,
1665
1665
int (* add_range ) (struct backtrace_state * state , void * rdata ,
1666
- uint64_t lowpc , uint64_t highpc ,
1666
+ uintptr_t lowpc , uintptr_t highpc ,
1667
1667
backtrace_error_callback error_callback , void * data ,
1668
1668
void * vec ),
1669
1669
void * rdata ,
@@ -1702,12 +1702,12 @@ add_ranges_from_ranges (
1702
1702
break ;
1703
1703
1704
1704
if (is_highest_address (low , u -> addrsize ))
1705
- base = high ;
1705
+ base = ( uintptr_t ) high ;
1706
1706
else
1707
1707
{
1708
1708
if (!add_range (state , rdata ,
1709
- low + base + base_address ,
1710
- high + base + base_address ,
1709
+ ( uintptr_t ) low + base + base_address ,
1710
+ ( uintptr_t ) high + base + base_address ,
1711
1711
error_callback , data , vec ))
1712
1712
return 0 ;
1713
1713
}
@@ -1727,10 +1727,10 @@ add_ranges_from_rnglists (
1727
1727
struct backtrace_state * state ,
1728
1728
const struct dwarf_sections * dwarf_sections ,
1729
1729
uintptr_t base_address , int is_bigendian ,
1730
- struct unit * u , uint64_t base ,
1730
+ struct unit * u , uintptr_t base ,
1731
1731
const struct pcrange * pcrange ,
1732
1732
int (* add_range ) (struct backtrace_state * state , void * rdata ,
1733
- uint64_t lowpc , uint64_t highpc ,
1733
+ uintptr_t lowpc , uintptr_t highpc ,
1734
1734
backtrace_error_callback error_callback , void * data ,
1735
1735
void * vec ),
1736
1736
void * rdata ,
@@ -1796,8 +1796,8 @@ add_ranges_from_rnglists (
1796
1796
case DW_RLE_startx_endx :
1797
1797
{
1798
1798
uint64_t index ;
1799
- uint64_t low ;
1800
- uint64_t high ;
1799
+ uintptr_t low ;
1800
+ uintptr_t high ;
1801
1801
1802
1802
index = read_uleb128 (& rnglists_buf );
1803
1803
if (!resolve_addr_index (dwarf_sections , u -> addr_base ,
@@ -1819,8 +1819,8 @@ add_ranges_from_rnglists (
1819
1819
case DW_RLE_startx_length :
1820
1820
{
1821
1821
uint64_t index ;
1822
- uint64_t low ;
1823
- uint64_t length ;
1822
+ uintptr_t low ;
1823
+ uintptr_t length ;
1824
1824
1825
1825
index = read_uleb128 (& rnglists_buf );
1826
1826
if (!resolve_addr_index (dwarf_sections , u -> addr_base ,
@@ -1850,16 +1850,16 @@ add_ranges_from_rnglists (
1850
1850
break ;
1851
1851
1852
1852
case DW_RLE_base_address :
1853
- base = read_address (& rnglists_buf , u -> addrsize );
1853
+ base = ( uintptr_t ) read_address (& rnglists_buf , u -> addrsize );
1854
1854
break ;
1855
1855
1856
1856
case DW_RLE_start_end :
1857
1857
{
1858
- uint64_t low ;
1859
- uint64_t high ;
1858
+ uintptr_t low ;
1859
+ uintptr_t high ;
1860
1860
1861
- low = read_address (& rnglists_buf , u -> addrsize );
1862
- high = read_address (& rnglists_buf , u -> addrsize );
1861
+ low = ( uintptr_t ) read_address (& rnglists_buf , u -> addrsize );
1862
+ high = ( uintptr_t ) read_address (& rnglists_buf , u -> addrsize );
1863
1863
if (!add_range (state , rdata , low + base_address ,
1864
1864
high + base_address , error_callback , data ,
1865
1865
vec ))
@@ -1869,11 +1869,11 @@ add_ranges_from_rnglists (
1869
1869
1870
1870
case DW_RLE_start_length :
1871
1871
{
1872
- uint64_t low ;
1873
- uint64_t length ;
1872
+ uintptr_t low ;
1873
+ uintptr_t length ;
1874
1874
1875
- low = read_address (& rnglists_buf , u -> addrsize );
1876
- length = read_uleb128 (& rnglists_buf );
1875
+ low = ( uintptr_t ) read_address (& rnglists_buf , u -> addrsize );
1876
+ length = ( uintptr_t ) read_uleb128 (& rnglists_buf );
1877
1877
low += base_address ;
1878
1878
if (!add_range (state , rdata , low , low + length ,
1879
1879
error_callback , data , vec ))
@@ -1903,9 +1903,9 @@ static int
1903
1903
add_ranges (struct backtrace_state * state ,
1904
1904
const struct dwarf_sections * dwarf_sections ,
1905
1905
uintptr_t base_address , int is_bigendian ,
1906
- struct unit * u , uint64_t base , const struct pcrange * pcrange ,
1906
+ struct unit * u , uintptr_t base , const struct pcrange * pcrange ,
1907
1907
int (* add_range ) (struct backtrace_state * state , void * rdata ,
1908
- uint64_t lowpc , uint64_t highpc ,
1908
+ uintptr_t lowpc , uintptr_t highpc ,
1909
1909
backtrace_error_callback error_callback ,
1910
1910
void * data , void * vec ),
1911
1911
void * rdata ,
@@ -3183,7 +3183,7 @@ read_referenced_name (struct dwarf_data *ddata, struct unit *u,
3183
3183
3184
3184
static int
3185
3185
add_function_range (struct backtrace_state * state , void * rdata ,
3186
- uint64_t lowpc , uint64_t highpc ,
3186
+ uintptr_t lowpc , uintptr_t highpc ,
3187
3187
backtrace_error_callback error_callback , void * data ,
3188
3188
void * pvec )
3189
3189
{
@@ -3223,7 +3223,7 @@ add_function_range (struct backtrace_state *state, void *rdata,
3223
3223
3224
3224
static int
3225
3225
read_function_entry (struct backtrace_state * state , struct dwarf_data * ddata ,
3226
- struct unit * u , uint64_t base , struct dwarf_buf * unit_buf ,
3226
+ struct unit * u , uintptr_t base , struct dwarf_buf * unit_buf ,
3227
3227
const struct line_header * lhdr ,
3228
3228
backtrace_error_callback error_callback , void * data ,
3229
3229
struct function_vector * vec_function ,
@@ -3287,7 +3287,7 @@ read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata,
3287
3287
&& abbrev -> attrs [i ].name == DW_AT_low_pc )
3288
3288
{
3289
3289
if (val .encoding == ATTR_VAL_ADDRESS )
3290
- base = val .u .uint ;
3290
+ base = ( uintptr_t ) val .u .uint ;
3291
3291
else if (val .encoding == ATTR_VAL_ADDRESS_INDEX )
3292
3292
{
3293
3293
if (!resolve_addr_index (& ddata -> dwarf_sections ,
0 commit comments