Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: PATCH: MIPS/Linux build fixes
Date: Mon, 19 Aug 2002 07:26:00 -0000	[thread overview]
Message-ID: <20020819142654.GA2984@nevyn.them.org> (raw)

Some warning fixes (JB_PC, and REALTIME_LO), and a build fix from the
multi-arching of MAX_REGISTER_RAW_SIZE last week.  Committed.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2002-08-19  Daniel Jacobowitz  <drow@mvista.com>

	* config/mips/tm-linux.h (REALTIME_LO, REALTIME_HI): Define
	conditionally.
	(JB_PC, JB_ELEMENT_SIZE): Rename to MIPS_LINUX_JB_PC and
	MIPS_LINUX_JB_ELEMENT_SIZE.
	* mips-linux-tdep.c (supply_gregset, fill_gregset): Use alloca
	for MAX_REGISTER_RAW_SIZE arrays.
	(mips_linux_get_longjmp_target): Use MIPS_LINUX_JB_PC and
	MIPS_LINUX_JB_ELEMENT_SIZE.

Index: config/mips/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-linux.h,v
retrieving revision 1.4
diff -u -p -r1.4 tm-linux.h
--- config/mips/tm-linux.h	5 Jun 2002 19:18:25 -0000	1.4
+++ config/mips/tm-linux.h	19 Aug 2002 14:23:35 -0000
@@ -33,8 +33,10 @@
 
 /* GNU/Linux MIPS has __SIGRTMAX == 127.  */
 
+#ifndef REALTIME_LO
 #define REALTIME_LO 32
 #define REALTIME_HI 128
+#endif
 
 #include "config/tm-linux.h"
 
@@ -51,8 +53,8 @@ extern struct link_map_offsets *mips_lin
 
 /* Details about jmp_buf.  */
 
-#define JB_ELEMENT_SIZE 4
-#define JB_PC 0
+#define MIPS_LINUX_JB_ELEMENT_SIZE 4
+#define MIPS_LINUX_JB_PC 0
 
 /* Figure out where the longjmp will land.  Slurp the arguments out of the
    stack.  We expect the first arg to be a pointer to the jmp_buf structure
Index: mips-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-linux-tdep.c,v
retrieving revision 1.3
diff -u -p -r1.3 mips-linux-tdep.c
--- mips-linux-tdep.c	20 Feb 2002 22:51:41 -0000	1.3
+++ mips-linux-tdep.c	19 Aug 2002 14:23:35 -0000
@@ -56,8 +56,8 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
 
 /* 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
 
   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,


             reply	other threads:[~2002-08-19 14:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-19  7:26 Daniel Jacobowitz [this message]
2002-08-19 14:45 ` Andrew Cagney
2002-08-19 18:57   ` Daniel Jacobowitz
2002-08-20 19:12     ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020819142654.GA2984@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox