* Makefile.in (i386nbsd-tdep.o): Add $(arch_utils_h),
[deliverable/binutils-gdb.git] / gdb / mips-linux-tdep.c
index 5b583483be6522c23b2e11784d9475e33526b750..b8d41db2e3be79dabe855cecc394a9315e18f860 100644 (file)
@@ -1,4 +1,4 @@
-/* Target-dependent code for Linux/MIPS.
+/* Target-dependent code for GNU/Linux on MIPS processors.
    Copyright 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -56,8 +56,8 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
 
 /* Figure out where the longjmp will land.
    We expect the first arg to be a pointer to the jmp_buf structure from
-   which we extract the pc (JB_PC) that we will land at.  The pc is copied
-   into PC.  This routine returns 1 on success.  */
+   which we extract the pc (MIPS_LINUX_JB_PC) that we will land at.  The pc
+   is copied into PC.  This routine returns 1 on success.  */
 
 int
 mips_linux_get_longjmp_target (CORE_ADDR *pc)
@@ -67,8 +67,9 @@ mips_linux_get_longjmp_target (CORE_ADDR *pc)
 
   jb_addr = read_register (A0_REGNUM);
 
-  if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
-                         TARGET_PTR_BIT / TARGET_CHAR_BIT))
+  if (target_read_memory (jb_addr
+                         + MIPS_LINUX_JB_PC * MIPS_LINUX_JB_ELEMENT_SIZE,
+                         buf, TARGET_PTR_BIT / TARGET_CHAR_BIT))
     return 0;
 
   *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
@@ -83,7 +84,9 @@ supply_gregset (elf_gregset_t *gregsetp)
 {
   int regi;
   elf_greg_t *regp = *gregsetp;
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+  char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+
+  memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
 
   for (regi = EF_REG0; regi <= EF_REG31; regi++)
     supply_register ((regi - EF_REG0), (char *)(regp + regi));
@@ -172,7 +175,9 @@ void
 supply_fpregset (elf_fpregset_t *fpregsetp)
 {
   register int regi;
-  static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+  char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+
+  memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
 
   for (regi = 0; regi < 32; regi++)
     supply_register (FP0_REGNUM + regi,
@@ -298,11 +303,11 @@ static struct core_fns regset_core_fns =
 };
 
 /* Fetch (and possibly build) an appropriate link_map_offsets
-   structure for native Linux/MIPS targets using the struct offsets
+   structure for native GNU/Linux MIPS targets using the struct offsets
    defined in link.h (but without actual reference to that file).
 
-   This makes it possible to access Linux/MIPS shared libraries from a
-   GDB that was not built on an Linux/MIPS host (for cross debugging).  */
+   This makes it possible to access GNU/Linux MIPS shared libraries from a
+   GDB that was built on a different host platform (for cross debugging).  */
 
 struct link_map_offsets *
 mips_linux_svr4_fetch_link_map_offsets (void)
@@ -338,7 +343,7 @@ mips_linux_svr4_fetch_link_map_offsets (void)
 }
 
 void
-_initialize_mips_linux_tdep ()
+_initialize_mips_linux_tdep (void)
 {
   add_core_fns (&regset_core_fns);
 }
This page took 0.024802 seconds and 4 git commands to generate.