-/* Copyright (C) 2010, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2015 Free Software Foundation, Inc.
This file is part of GDB.
#include "symfile.h"
#include "objfiles.h"
#include "elf-bfd.h"
-#include "exceptions.h"
/* Need to define the following macro in order to get the complete
load_module_desc struct definition in dlfcn.h Otherwise, it doesn't
{
struct so_list *new_so;
- new_so = (struct so_list *) XZALLOC (struct so_list);
- new_so->lm_info = (struct lm_info *) XZALLOC (struct lm_info);
+ new_so = (struct so_list *) XCNEW (struct so_list);
+ new_so->lm_info = (struct lm_info *) XCNEW (struct lm_info);
new_so->lm_info->module_desc = module_desc;
strncpy (new_so->so_name, so_name, SO_NAME_MAX_PATH_SIZE - 1);
struct regcache *regcache = get_thread_regcache (ptid);
CORE_ADDR pc = regcache_read_pc (regcache);
struct address_space *aspace = get_regcache_aspace (regcache);
- ia64_insn t0, t1, slot[3], template, insn;
+ ia64_insn t0, t1, slot[3], templ, insn;
int slotnum;
bfd_byte bundle[16];
/* bundles are always in little-endian byte order */
t0 = bfd_getl64 (bundle);
t1 = bfd_getl64 (bundle + 8);
- template = (t0 >> 1) & 0xf;
+ templ = (t0 >> 1) & 0xf;
slot[0] = (t0 >> 5) & 0x1ffffffffffLL;
slot[1] = ((t0 >> 46) & 0x3ffff) | ((t1 & 0x7fffff) << 18);
slot[2] = (t1 >> 23) & 0x1ffffffffffLL;
- if (template == 2 && slotnum == 1)
+ if (templ == 2 && slotnum == 1)
{
/* skip L slot in MLI template: */
slotnum = 2;
CORE_ADDR module_desc_addr;
ULONGEST module_desc_size;
CORE_ADDR so_path_addr;
- char so_path[MAXPATHLEN];
+ char so_path[PATH_MAX];
struct load_module_desc module_desc;
struct so_list *new_so;
sizeof (struct load_module_desc),
pulongest (module_desc_size));
- read_memory_string (so_path_addr, so_path, MAXPATHLEN);
+ read_memory_string (so_path_addr, so_path, PATH_MAX);
read_memory (module_desc_addr, (gdb_byte *) &module_desc,
sizeof (module_desc));
bfd, whereas we would have had to open our own if we wanted to do it
while processing the library-load event. */
if (so->lm_info->text_start == 0 && so->lm_info->data_start == 0)
- ia64_hpux_find_start_vma (sec->bfd, &so->lm_info->text_start,
+ ia64_hpux_find_start_vma (sec->the_bfd_section->owner,
+ &so->lm_info->text_start,
&so->lm_info->data_start);
/* Determine the relocation offset based on which segment
static CORE_ADDR
ia64_hpux_get_load_info_addr (void)
{
- struct type *data_ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
+ struct type *data_ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
CORE_ADDR addr;
int status;
{
CORE_ADDR load_map_addr = bfd_h_get_64 (abfd, &dynp->d_un.d_ptr);
- if (target_read_memory (load_map_addr, (char *) &info->load_map,
+ if (target_read_memory (load_map_addr,
+ (gdb_byte *) &info->load_map,
sizeof (info->load_map)) != 0)
error (_("failed to read load map at %s"),
paddress (gdbarch, load_map_addr));
static struct target_so_ops *
ia64_hpux_target_so_ops (void)
{
- struct target_so_ops *ops = XZALLOC (struct target_so_ops);
+ struct target_so_ops *ops = XCNEW (struct target_so_ops);
ops->relocate_section_addresses = ia64_hpux_relocate_section_addresses;
ops->free_so = ia64_hpux_free_so;