#include <sys/procfs.h>
#include <setjmp.h> /* For JB_XXX. */
-static void
-fetch_core_registers PARAMS ((char *, unsigned int, int, CORE_ADDR));
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+
+static void fetch_core_registers (char *, unsigned int, int, CORE_ADDR);
/* Size of elements in jmpbuf */
#include "objfiles.h"
#include "command.h"
#include "frame.h"
-#include "gnu-regex.h"
+#include "gdb_regex.h"
#include "inferior.h"
#include "language.h"
#include "gdbcmd.h"
/* Local function prototypes */
-static void
-sharedlibrary_command PARAMS ((char *, int));
+static void sharedlibrary_command (char *, int);
-static int
-enable_break PARAMS ((void));
+static int enable_break (void);
-static int
-disable_break PARAMS ((void));
+static int disable_break (void);
-static void
-info_sharedlibrary_command PARAMS ((char *, int));
+static void info_sharedlibrary_command (char *, int);
-static int
-symbol_add_stub PARAMS ((char *));
+static int symbol_add_stub (void *);
-static struct so_list *
- find_solib PARAMS ((struct so_list *));
+static struct so_list *find_solib (struct so_list *);
-static struct link_map *
- first_link_map_member PARAMS ((void));
+static struct link_map *first_link_map_member (void);
-static struct link_map *
- next_link_map_member PARAMS ((struct so_list *));
+static struct link_map *next_link_map_member (struct so_list *);
-static void
-xfer_link_map_member PARAMS ((struct so_list *, struct link_map *));
+static void xfer_link_map_member (struct so_list *, struct link_map *);
-static CORE_ADDR
- locate_base PARAMS ((void));
+static CORE_ADDR locate_base (void);
-static int
-solib_map_sections PARAMS ((char *));
+static int solib_map_sections (void *);
/*
*/
static int
-solib_map_sections (arg)
- char *arg;
+solib_map_sections (void *arg)
{
struct so_list *so = (struct so_list *) arg; /* catch_errors bogon */
char *filename;
/* Free the file names, close the file now. */
do_cleanups (old_chain);
+ /* must be non-zero */
return (1);
}
return NULL;
/* Get first list entry. */
- lladdr = (CORE_ADDR) listp;
+ /* The MIPS Sign extends addresses. */
+ lladdr = host_pointer_to_address (listp);
read_memory (lladdr, (char *) &list_old, sizeof (struct obj_list));
/* The first entry in the list is the object file we are debugging,
so skip it. */
- next_lladdr = (CORE_ADDR) list_old.next;
+ next_lladdr = host_pointer_to_address (list_old.next);
#ifdef HANDLE_NEW_OBJ_LIST
if (list_old.data == NEW_OBJ_INFO_MAGIC)
status = target_read_memory (lm->l_lladdr,
(char *) &list_old,
sizeof (struct obj_list));
- next_lladdr = (CORE_ADDR) list_old.next;
+ next_lladdr = host_pointer_to_address (list_old.next);
}
#ifdef HANDLE_NEW_OBJ_LIST
else if (lm->l_variant == OBJ_LIST_32)
new_lm->l_variant = OBJ_LIST_OLD;
new_lm->l_lladdr = lladdr;
- new_lm->l_next = (CORE_ADDR) list_old.next;
+ new_lm->l_next = host_pointer_to_address (list_old.next);
#ifdef HANDLE_NEW_OBJ_LIST
if (list_old.data == NEW_OBJ_INFO_MAGIC)
/* A small stub to get us past the arg-passing pinhole of catch_errors. */
static int
-symbol_add_stub (arg)
- char *arg;
+symbol_add_stub (void *arg)
{
register struct so_list *so = (struct so_list *) arg; /* catch_errs bogon */
CORE_ADDR text_addr = 0;
+ struct section_addr_info section_addrs;
+ memset (§ion_addrs, 0, sizeof (section_addrs));
if (so->textsection)
text_addr = so->textsection->addr;
else if (so->abfd != NULL)
lowest_sect = bfd_get_section_by_name (so->abfd, ".text");
if (lowest_sect == NULL)
bfd_map_over_sections (so->abfd, find_lowest_section,
- (PTR) & lowest_sect);
+ (PTR) &lowest_sect);
if (lowest_sect)
text_addr = bfd_section_vma (so->abfd, lowest_sect) + LM_OFFSET (so);
}
+
+ section_addrs.other[0].name = ".text";
+ section_addrs.other[0].addr = text_addr;
so->objfile = symbol_file_add (so->so_name, so->from_tty,
- text_addr,
- 0, 0, 0, 0, 0);
+ §ion_addrs, 0, 0);
+ /* must be non-zero */
return (1);
}
if (count)
{
- int update_coreops;
-
- /* We must update the to_sections field in the core_ops structure
- here, otherwise we dereference a potential dangling pointer
- for each call to target_read/write_memory within this routine. */
- update_coreops = core_ops.to_sections == target->to_sections;
-
- /* Reallocate the target's section table including the new size. */
- if (target->to_sections)
- {
- old = target->to_sections_end - target->to_sections;
- target->to_sections = (struct section_table *)
- xrealloc ((char *) target->to_sections,
- (sizeof (struct section_table)) * (count + old));
- }
- else
- {
- old = 0;
- target->to_sections = (struct section_table *)
- xmalloc ((sizeof (struct section_table)) * count);
- }
- target->to_sections_end = target->to_sections + (count + old);
-
- /* Update the to_sections field in the core_ops structure
- if needed. */
- if (update_coreops)
- {
- core_ops.to_sections = target->to_sections;
- core_ops.to_sections_end = target->to_sections_end;
- }
-
+ old = target_resize_to_sections (target, count);
+
/* Add these section table entries to the target's table. */
while ((so = find_solib (so)) != NULL)
{
if (exec_bfd == NULL)
{
- printf_unfiltered ("No exec file.\n");
+ printf_unfiltered ("No executable file.\n");
return;
}
while ((so = find_solib (so)) != NULL)
static struct core_fns irix5_core_fns =
{
- bfd_target_unknown_flavour,
- fetch_core_registers,
- NULL
+ bfd_target_unknown_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
};
void