gdb/ia64-vms-tdep.c - gdb
Global variables defined
Functions defined
Source code
- #include "defs.h"
- #include "frame-unwind.h"
- #include "ia64-tdep.h"
- #include "osabi.h"
- #include "gdbtypes.h"
- #include "gdbcore.h"
- #ifdef HAVE_LIBUNWIND_IA64_H
- static int
- ia64_vms_find_proc_info_x (unw_addr_space_t as, unw_word_t ip,
- unw_proc_info_t *pi,
- int need_unwind_info, void *arg)
- {
- enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- unw_dyn_info_t di;
- int ret;
- gdb_byte buf[32];
- const char *annex = core_addr_to_string (ip);
- LONGEST res;
- CORE_ADDR table_addr;
- unsigned int info_len;
- res = target_read (¤t_target, TARGET_OBJECT_OPENVMS_UIB,
- annex + 2, buf, 0, sizeof (buf));
- if (res != sizeof (buf))
- return -UNW_ENOINFO;
- pi->format = UNW_INFO_FORMAT_REMOTE_TABLE;
- pi->start_ip = extract_unsigned_integer (buf + 0, 8, byte_order);
- pi->end_ip = extract_unsigned_integer (buf + 8, 8, byte_order);
- pi->gp = extract_unsigned_integer (buf + 24, 8, byte_order);
- table_addr = extract_unsigned_integer (buf + 16, 8, byte_order);
- if (table_addr == 0)
- {
-
- pi->unwind_info = NULL;
- pi->unwind_info_size = 0;
- return 0;
- }
- res = target_read_memory (table_addr, buf, 8);
- if (res != 0)
- return -UNW_ENOINFO;
-
- if (extract_unsigned_integer (buf + 6, 2, byte_order) != 1)
- return -UNW_EBADVERSION;
- info_len = extract_unsigned_integer (buf + 0, 4, byte_order);
- pi->unwind_info_size = 8 * info_len;
-
- pi->unwind_info = xmalloc (pi->unwind_info_size);
- res = target_read_memory (table_addr + 8,
- pi->unwind_info, pi->unwind_info_size);
- if (res != 0)
- {
- xfree (pi->unwind_info);
- pi->unwind_info = NULL;
- return -UNW_ENOINFO;
- }
- FIXME
- pi->lsda = table_addr + 8 + pi->unwind_info_size;
- if (extract_unsigned_integer (buf + 4, 2, byte_order) & 3)
- {
- pi->lsda += 8;
-
- pi->handler = 0;
- }
- return 0;
- }
- static void
- ia64_vms_put_unwind_info (unw_addr_space_t as,
- unw_proc_info_t *pip, void *arg)
- {
-
- }
- static int
- ia64_vms_get_dyn_info_list (unw_addr_space_t as,
- unw_word_t *dilap, void *arg)
- {
- return -UNW_ENOINFO;
- }
- static unw_accessors_t ia64_vms_unw_accessors;
- static unw_accessors_t ia64_vms_unw_rse_accessors;
- static struct libunwind_descr ia64_vms_libunwind_descr;
- #endif
- static void
- ia64_openvms_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
- {
- set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad);
- #ifdef HAVE_LIBUNWIND_IA64_H
-
- ia64_vms_unw_accessors = ia64_unw_accessors;
- ia64_vms_unw_accessors.find_proc_info = ia64_vms_find_proc_info_x;
- ia64_vms_unw_accessors.put_unwind_info = ia64_vms_put_unwind_info;
- ia64_vms_unw_accessors.get_dyn_info_list_addr = ia64_vms_get_dyn_info_list;
- ia64_vms_unw_rse_accessors = ia64_unw_rse_accessors;
- ia64_vms_unw_rse_accessors.find_proc_info = ia64_vms_find_proc_info_x;
- ia64_vms_unw_rse_accessors.put_unwind_info = ia64_vms_put_unwind_info;
- ia64_vms_unw_rse_accessors.get_dyn_info_list_addr = ia64_vms_get_dyn_info_list;
- ia64_vms_libunwind_descr = ia64_libunwind_descr;
- ia64_vms_libunwind_descr.accessors = &ia64_vms_unw_accessors;
- ia64_vms_libunwind_descr.special_accessors = &ia64_vms_unw_rse_accessors;
- libunwind_frame_set_descr (gdbarch, &ia64_vms_libunwind_descr);
- #endif
- }
- extern initialize_file_ftype _initialize_ia64_vms_tdep;
- void
- _initialize_ia64_vms_tdep (void)
- {
- gdbarch_register_osabi (bfd_arch_ia64, 0, GDB_OSABI_OPENVMS,
- ia64_openvms_init_abi);
- }