gdb/
Make addrs->SECTINDEX always defined. * symfile.c (relative_addr_info_to_section_offsets): Check for SECTINDEX -1, not for zero ADDR. (addrs_section_compar): Remove checking for invalid SECTINDEX. (addr_info_make_relative): Set SECTINDEX to -1 for unmatched entries. * symfile.h (struct section_addr_info) <sectindex>: Update the comment on its validity.
This commit is contained in:
parent
403676b570
commit
5488dafb5a
3 changed files with 14 additions and 8 deletions
|
@ -1,3 +1,13 @@
|
||||||
|
2011-05-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
Make addrs->SECTINDEX always defined.
|
||||||
|
* symfile.c (relative_addr_info_to_section_offsets): Check for
|
||||||
|
SECTINDEX -1, not for zero ADDR.
|
||||||
|
(addrs_section_compar): Remove checking for invalid SECTINDEX.
|
||||||
|
(addr_info_make_relative): Set SECTINDEX to -1 for unmatched entries.
|
||||||
|
* symfile.h (struct section_addr_info) <sectindex>: Update the comment
|
||||||
|
on its validity.
|
||||||
|
|
||||||
2011-05-10 Doug Evans <dje@google.com>
|
2011-05-10 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
* linux-thread-db.c: Whitespace cleanup.
|
* linux-thread-db.c: Whitespace cleanup.
|
||||||
|
|
|
@ -527,7 +527,7 @@ relative_addr_info_to_section_offsets (struct section_offsets *section_offsets,
|
||||||
struct other_sections *osp;
|
struct other_sections *osp;
|
||||||
|
|
||||||
osp = &addrs->other[i];
|
osp = &addrs->other[i];
|
||||||
if (osp->addr == 0)
|
if (osp->sectindex == -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Record all sections in offsets. */
|
/* Record all sections in offsets. */
|
||||||
|
@ -568,10 +568,7 @@ addrs_section_compar (const void *ap, const void *bp)
|
||||||
if (retval)
|
if (retval)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
/* SECTINDEX is undefined iff ADDR is zero. */
|
return a->sectindex - b->sectindex;
|
||||||
a_idx = a->addr == 0 ? 0 : a->sectindex;
|
|
||||||
b_idx = b->addr == 0 ? 0 : b->sectindex;
|
|
||||||
return a_idx - b_idx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Provide sorted array of pointers to sections of ADDRS. The array is
|
/* Provide sorted array of pointers to sections of ADDRS. The array is
|
||||||
|
@ -734,8 +731,7 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
|
||||||
bfd_get_filename (abfd));
|
bfd_get_filename (abfd));
|
||||||
|
|
||||||
addrs->other[i].addr = 0;
|
addrs->other[i].addr = 0;
|
||||||
|
addrs->other[i].sectindex = -1;
|
||||||
/* SECTINDEX is invalid if ADDR is zero. */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ struct section_addr_info
|
||||||
CORE_ADDR addr;
|
CORE_ADDR addr;
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
/* SECTINDEX must be valid for associated BFD if ADDR is not zero. */
|
/* SECTINDEX must be valid for associated BFD or set to -1. */
|
||||||
int sectindex;
|
int sectindex;
|
||||||
} other[1];
|
} other[1];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue