mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 18:08:24 +08:00
binutils/Dwarf: avoid "shadowing" of glibc function name
As before: Old enough glibc has an (unguarded) declaration of index() in string.h, which triggers a "shadows a global declaration" warning.
This commit is contained in:
@ -2773,7 +2773,7 @@ read_and_display_attr_value (unsigned long attribute,
|
|||||||
case DW_FORM_rnglistx:
|
case DW_FORM_rnglistx:
|
||||||
if (!do_loc)
|
if (!do_loc)
|
||||||
{
|
{
|
||||||
dwarf_vma base, index;
|
dwarf_vma base, idx;
|
||||||
const char *suffix = strrchr (section->name, '.');
|
const char *suffix = strrchr (section->name, '.');
|
||||||
bool dwo = suffix && strcmp (suffix, ".dwo") == 0;
|
bool dwo = suffix && strcmp (suffix, ".dwo") == 0;
|
||||||
|
|
||||||
@ -2781,29 +2781,29 @@ read_and_display_attr_value (unsigned long attribute,
|
|||||||
{
|
{
|
||||||
if (dwo)
|
if (dwo)
|
||||||
{
|
{
|
||||||
index = fetch_indexed_value (uvalue, loclists_dwo, 0);
|
idx = fetch_indexed_value (uvalue, loclists_dwo, 0);
|
||||||
index += (offset_size == 8) ? 20 : 12;
|
idx += (offset_size == 8) ? 20 : 12;
|
||||||
}
|
}
|
||||||
else if (debug_info_p == NULL)
|
else if (debug_info_p == NULL)
|
||||||
{
|
{
|
||||||
index = fetch_indexed_value (uvalue, loclists, 0);
|
idx = fetch_indexed_value (uvalue, loclists, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* We want to compute:
|
/* We want to compute:
|
||||||
index = fetch_indexed_value (uvalue, loclists, debug_info_p->loclists_base);
|
idx = fetch_indexed_value (uvalue, loclists, debug_info_p->loclists_base);
|
||||||
index += debug_info_p->loclists_base;
|
idx += debug_info_p->loclists_base;
|
||||||
Fortunately we already have that sum cached in the
|
Fortunately we already have that sum cached in the
|
||||||
loc_offsets array. */
|
loc_offsets array. */
|
||||||
index = debug_info_p->loc_offsets [uvalue];
|
idx = debug_info_p->loc_offsets [uvalue];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (form == DW_FORM_rnglistx)
|
else if (form == DW_FORM_rnglistx)
|
||||||
{
|
{
|
||||||
if (dwo)
|
if (dwo)
|
||||||
{
|
{
|
||||||
index = fetch_indexed_value (uvalue, rnglists_dwo, 0);
|
idx = fetch_indexed_value (uvalue, rnglists_dwo, 0);
|
||||||
index += (offset_size == 8) ? 20 : 12;
|
idx += (offset_size == 8) ? 20 : 12;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2813,8 +2813,8 @@ read_and_display_attr_value (unsigned long attribute,
|
|||||||
base = debug_info_p->rnglists_base;
|
base = debug_info_p->rnglists_base;
|
||||||
/* We do not have a cached value this time, so we perform the
|
/* We do not have a cached value this time, so we perform the
|
||||||
computation manually. */
|
computation manually. */
|
||||||
index = fetch_indexed_value (uvalue, rnglists, base);
|
idx = fetch_indexed_value (uvalue, rnglists, base);
|
||||||
index += base;
|
idx += base;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2827,13 +2827,13 @@ read_and_display_attr_value (unsigned long attribute,
|
|||||||
base = debug_info_p->addr_base;
|
base = debug_info_p->addr_base;
|
||||||
|
|
||||||
base += uvalue * pointer_size;
|
base += uvalue * pointer_size;
|
||||||
index = fetch_indexed_addr (base, pointer_size);
|
idx = fetch_indexed_addr (base, pointer_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We have already displayed the form name. */
|
/* We have already displayed the form name. */
|
||||||
printf (_("%c(index: 0x%s): %s"), delimiter,
|
printf (_("%c(index: 0x%s): %s"), delimiter,
|
||||||
dwarf_vmatoa ("x", uvalue),
|
dwarf_vmatoa ("x", uvalue),
|
||||||
dwarf_vmatoa ("x", index));
|
dwarf_vmatoa ("x", idx));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user