struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
CORE_ADDR addr = 0;
- volatile struct gdb_exception ex;
- TRY_CATCH (ex, RETURN_MASK_ERROR)
+ TRY
{
addr = read_memory_typed_address (info->debug_base + lmo->r_map_offset,
ptr_type);
}
- if (ex.reason < 0)
- exception_print (gdb_stderr, ex);
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ exception_print (gdb_stderr, ex);
+ }
+ END_CATCH
+
return addr;
}
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- ULONGEST version;
+ ULONGEST version = 0;
+
+ TRY
+ {
+ /* Check version, and return zero if `struct r_debug' doesn't have
+ the r_ldsomap member. */
+ version
+ = read_memory_unsigned_integer (info->debug_base + lmo->r_version_offset,
+ lmo->r_version_size, byte_order);
+ }
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ exception_print (gdb_stderr, ex);
+ }
+ END_CATCH
- /* Check version, and return zero if `struct r_debug' doesn't have
- the r_ldsomap member. */
- version
- = read_memory_unsigned_integer (info->debug_base + lmo->r_version_offset,
- lmo->r_version_size, byte_order);
if (version < 2 || lmo->r_ldsomap_offset == -1)
return 0;
struct so_list *so;
bfd *tmp_bfd = NULL;
struct target_ops *tmp_bfd_target;
- volatile struct gdb_exception ex;
sym_addr = 0;
be trivial on GNU/Linux). Therefore, we have to try an alternate
mechanism to find the dynamic linker's base address. */
- TRY_CATCH (ex, RETURN_MASK_ALL)
+ TRY
{
tmp_bfd = solib_bfd_open (interp_name);
}
+ CATCH (ex, RETURN_MASK_ALL)
+ {
+ }
+ END_CATCH
+
if (tmp_bfd == NULL)
goto bkpt_at_symbol;
{
/* ENTRY_POINT is a possible function descriptor - before
a call to gdbarch_convert_from_func_ptr_addr. */
- CORE_ADDR entry_point, displacement;
+ CORE_ADDR entry_point, exec_displacement;
if (exec_bfd == NULL)
return 0;
if (target_auxv_search (¤t_target, AT_ENTRY, &entry_point) <= 0)
return 0;
- displacement = entry_point - bfd_get_start_address (exec_bfd);
+ exec_displacement = entry_point - bfd_get_start_address (exec_bfd);
- /* Verify the DISPLACEMENT candidate complies with the required page
+ /* Verify the EXEC_DISPLACEMENT candidate complies with the required page
alignment. It is cheaper than the program headers comparison below. */
if (bfd_get_flavour (exec_bfd) == bfd_target_elf_flavour)
p_offset % p_align == p_vaddr % p_align
Kernel is free to load the executable with lower alignment. */
- if ((displacement & (elf->minpagesize - 1)) != 0)
+ if ((exec_displacement & (elf->minpagesize - 1)) != 0)
return 0;
}
printf_unfiltered (_("Using PIE (Position Independent Executable) "
"displacement %s for \"%s\".\n"),
- paddress (target_gdbarch (), displacement),
+ paddress (target_gdbarch (), exec_displacement),
bfd_get_filename (exec_bfd));
}
- *displacementp = displacement;
+ *displacementp = exec_displacement;
return 1;
}