Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org, jimb@red-bean.com
Cc: Mahesh Basavaraj Shavari <Mahesh.Shavari@kpitcummins.com>,
	        gdb@sourceware.org
Subject: Re: Mingw GDB build fails for M16C target
Date: Tue, 28 Apr 2009 22:57:00 -0000	[thread overview]
Message-ID: <20090428155724.1797d332@redhat.com> (raw)
In-Reply-To: <82C3BC9106BCE149B63464D79D0A22FD0A68110C@sohm.kpit.com>

[Note: Reply-to has been set to gdb-patches.]

On Sat, 25 Apr 2009 11:05:25 +0530
Mahesh Basavaraj Shavari <Mahesh.Shavari@kpitcummins.com> wrote:

> /home/mahesh/GDB/gdb-6.8/gdb-6.8.50.20080811/sim/m32c/gdb-if.c:541:
> error: `SIGTRAP' undeclared (first use in this function)

Mahesh,

Please try the patch below and let me know if it works for you.

Jim,

It appears to me that comment, "Oddly, the gdb/sim interface uses host
signal numbers...", isn't true.  My patch deletes this comment in
addition to using TARGET_SIGNAL_foo instead of SIGfoo.  If you look at
remote-sim.c, you'll see that `enum target_signal' (which defines the
various TARGET_SIGNAL_foo constants) is used throughout the file.

Okay to apply?

Kevin

	* m32c/gdb-if.c (m32c_signal_to_host): Rename to
	m32c_signal_to_target.  Change signal return values from SIGILL,
	SIGTRAP, SIGSEGV, etc. to TARGET_SIGNAL_ILL, TARGET_SIGNAL_TRAP,
	TARGET_SIGNAL_SEGV, etc.  Fix all callers.

Index: m32c/gdb-if.c
===================================================================
RCS file: /cvs/src/src/sim/m32c/gdb-if.c,v
retrieving revision 1.7
diff -u -p -r1.7 gdb-if.c
--- m32c/gdb-if.c	14 Jan 2009 10:53:07 -0000	1.7
+++ m32c/gdb-if.c	28 Apr 2009 22:38:44 -0000
@@ -523,52 +523,35 @@ int siggnal;
 
 
 /* Given a signal number used by the M32C bsp (that is, newlib),
-   return a host signal number.  (Oddly, the gdb/sim interface uses
-   host signal numbers...)  */
+   return a target signal number used by GDB.  */
 int
-m32c_signal_to_host (int m32c)
+m32c_signal_to_target (int m32c)
 {
   switch (m32c)
     {
     case 4:
-#ifdef SIGILL
-      return SIGILL;
-#else
-      return SIGSEGV;
-#endif
+      return TARGET_SIGNAL_ILL;
 
     case 5:
-      return SIGTRAP;
+      return TARGET_SIGNAL_TRAP;
 
     case 10:
-#ifdef SIGBUS
-      return SIGBUS;
-#else
-      return SIGSEGV;
-#endif
+      return TARGET_SIGNAL_BUS;
 
     case 11:
-      return SIGSEGV;
+      return TARGET_SIGNAL_SEGV;
 
     case 24:
-#ifdef SIGXCPU
-      return SIGXCPU;
-#else
-      break;
-#endif
+      return TARGET_SIGNAL_XCPU;
 
     case 2:
-      return SIGINT;
+      return TARGET_SIGNAL_INT;
 
     case 8:
-#ifdef SIGFPE
-      return SIGFPE;
-#else
-      break;
-#endif
+      return TARGET_SIGNAL_FPE;
 
     case 6:
-      return SIGABRT;
+      return TARGET_SIGNAL_ABRT;
     }
 
   return 0;
@@ -588,7 +571,7 @@ handle_step (int rc)
   else if (M32C_STOPPED (rc))
     {
       reason = sim_stopped;
-      siggnal = m32c_signal_to_host (M32C_STOP_SIG (rc));
+      siggnal = m32c_signal_to_target (M32C_STOP_SIG (rc));
     }
   else
     {


       reply	other threads:[~2009-04-28 22:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <82C3BC9106BCE149B63464D79D0A22FD0A68110C@sohm.kpit.com>
2009-04-28 22:57 ` Kevin Buettner [this message]
2009-04-29  2:35   ` Daniel Jacobowitz
2009-04-29 19:51     ` Kevin Buettner
2009-04-29 20:01       ` Daniel Jacobowitz
2009-04-29 20:27         ` Kevin Buettner
2009-04-29 20:33           ` Daniel Jacobowitz
2009-05-08 22:57   ` Kevin Buettner

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=20090428155724.1797d332@redhat.com \
    --to=kevinb@redhat.com \
    --cc=Mahesh.Shavari@kpitcummins.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gdb@sourceware.org \
    --cc=jimb@red-bean.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