static CORE_ADDR
lm_addr (const so_list &so)
{
- const lm_info_svr4 *li = (const lm_info_svr4 *) so.lm_info;
+ auto *li = gdb::checked_static_cast<const lm_info_svr4 *> (so.lm_info);
return li->l_addr;
}
struct bfd_section *bfd_sect = sec->the_bfd_section;
bfd *abfd = bfd_sect->owner;
const char *section_name = bfd_section_name (bfd_sect);
- lm_info_aix *info = (lm_info_aix *) so.lm_info;
+ auto *info = gdb::checked_static_cast<lm_info_aix *> (so.lm_info);
if (strcmp (section_name, ".text") == 0)
{
static void
darwin_relocate_section_addresses (so_list &so, target_section *sec)
{
- lm_info_darwin *li = (lm_info_darwin *) so.lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_darwin *> (so.lm_info);
sec->addr += li->lm_addr;
sec->endaddr += li->lm_addr;
dsbt_relocate_section_addresses (so_list &so, target_section *sec)
{
int seg;
- lm_info_dsbt *li = (lm_info_dsbt *) so.lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_dsbt *> (so.lm_info);
int_elf32_dsbt_loadmap *map = li->map;
for (seg = 0; seg < map->nsegs; seg++)
frv_relocate_section_addresses (so_list &so, target_section *sec)
{
int seg;
- lm_info_frv *li = (lm_info_frv *) so.lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_frv *> (so.lm_info);
int_elf32_fdpic_loadmap *map = li->map;
for (seg = 0; seg < map->nsegs; seg++)
for (struct so_list *so : current_program_space->solibs ())
{
int seg;
- lm_info_frv *li = (lm_info_frv *) so->lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_frv *> (so->lm_info);
int_elf32_fdpic_loadmap *map = li->map;
for (seg = 0; seg < map->nsegs; seg++)
{
for (struct so_list *so : current_program_space->solibs ())
{
- lm_info_frv *li = (lm_info_frv *) so->lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_frv *> (so->lm_info);
addr = find_canonical_descriptor_in_load_object
(entry_point, got_value, name, so->abfd, li);
of shared libraries. */
for (struct so_list *so : current_program_space->solibs ())
{
- lm_info_frv *li = (lm_info_frv *) so->lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_frv *> (so->lm_info);
if (so->objfile == objfile)
return li->lm_addr;
return;
}
- lm_info_svr4 *li = (lm_info_svr4 *) so.lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_svr4 *> (so.lm_info);
sec->addr = sec->addr + li->l_addr;
sec->endaddr = sec->endaddr + li->l_addr;
}
so_list *newobj = new so_list;
memcpy (newobj, src, sizeof (struct so_list));
- lm_info_svr4 *src_li = (lm_info_svr4 *) src->lm_info;
+ auto *src_li = gdb::checked_static_cast<lm_info_svr4 *> (src->lm_info);
newobj->lm_info = new lm_info_svr4 (*src_li);
newobj->next = nullptr;
/* There may be different instances of the same library, in different
namespaces. Each instance, however, must have been loaded at a
different address so its relocation offset would be different. */
- const lm_info_svr4 *lmg = (const lm_info_svr4 *) gdb.lm_info;
- const lm_info_svr4 *lmi = (const lm_info_svr4 *) inferior.lm_info;
+ auto *lmg = gdb::checked_static_cast<const lm_info_svr4 *> (gdb.lm_info);
+ auto *lmi = gdb::checked_static_cast<const lm_info_svr4 *> (inferior.lm_info);
return (lmg->l_addr_inferior == lmi->l_addr_inferior);
}
static CORE_ADDR
lm_addr_check (const so_list &so, bfd *abfd)
{
- lm_info_svr4 *li = (lm_info_svr4 *) so.lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_svr4 *> (so.lm_info);
if (!li->l_addr_p)
{
static void
svr4_clear_so (const so_list &so)
{
- lm_info_svr4 *li = (lm_info_svr4 *) so.lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_svr4 *> (so.lm_info);
if (li != NULL)
li->l_addr_p = 0;
so_list *newobj = new so_list;
memcpy (newobj, src, sizeof (struct so_list));
- lm_info_svr4 *src_li = (lm_info_svr4 *) src->lm_info;
+ auto *src_li = gdb::checked_static_cast<lm_info_svr4 *> (src->lm_info);
newobj->lm_info = new lm_info_svr4 (*src_li);
newobj->next = NULL;
[ 9] .dynamic DYNAMIC ffffffffff700580 000580 0000f0
*/
- lm_info_svr4 *li = (lm_info_svr4 *) so->lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_svr4 *> (so->lm_info);
if (address_in_mem_range (li->l_ld, &vsyscall_range))
{
for (struct so_list *so : current_program_space->solibs ())
if (so->objfile == objfile)
{
- lm_info_svr4 *li = (lm_info_svr4 *) so->lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_svr4 *> (so->lm_info);
return li->lm_addr;
}
for (; solist->next != nullptr; solist = solist->next)
/* Nothing. */;
- lm_info_svr4 *li = (lm_info_svr4 *) solist->lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_svr4 *> (solist->lm_info);
prev_lm = li->lm_addr;
pnext = &solist->next;
}
solib_target_relocate_section_addresses (so_list &so, target_section *sec)
{
CORE_ADDR offset;
- lm_info_target *li = (lm_info_target *) so.lm_info;
+ auto *li = gdb::checked_static_cast<lm_info_target *> (so.lm_info);
/* Build the offset table only once per object file. We can not do
it any earlier, since we need to open the file first. */