public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch] target_signal obvious fixups
@ 2010-09-06  7:35 Jan Kratochvil
  2010-09-06 13:35 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2010-09-06  7:35 UTC (permalink / raw)
  To: gdb-patches

Hi,

as the siginfo series got complicated here is at least the obvious fixup part
to be useful independently on the other patches.

It is a part of:
	[patch 3/9]#2 Change target_signal_t to a struct
	http://sourceware.org/ml/gdb-patches/2010-08/msg00483.html

No regressions on {x86_64,x86_64-m32,i686}-fedora14snapshot-linux-gnu.

Not checked in but it seems mostly obvious.


Thanks,
Jan


gdb/
2010-09-04  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* corelow.c (core_open): Do not print signal name without
	CORE_GDBARCH.
	* fork-child.c (startup_inferior) <resume_signal>: Use enum
	target_signal type.
	* linux-nat.c (linux_nat_resume): Replace strsignal by
	target_signal_to_name.  Use enum target_signal type for saved_signo.
	(linux_handle_extended_wait) <signo>: Use enum target_signal type.
	(linux_nat_wait_1): Use enum target_signal type for signo.  Replace
	strsignal by target_signal_to_name.
	* remote-m32r-sdi.c (m32r_wait, m32r_detach): Replace 0 by
	TARGET_SIGNAL_0.

gdb/gdbserver/
2010-09-04  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* server.c (handle_v_cont) <sig>: Use enum target_signal type.
	* target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.

--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -437,7 +437,7 @@ core_open (char *filename, int from_tty)
 		     target_signal_to_string (
 		       (core_gdbarch != NULL) ?
 			gdbarch_target_signal_from_host (core_gdbarch, siggy)
-			: siggy));
+			: TARGET_SIGNAL_0));
 
   /* Fetch all registers from core file.  */
   target_fetch_registers (get_current_regcache (), -1);
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -448,7 +448,7 @@ startup_inferior (int ntraps)
 
   while (1)
     {
-      int resume_signal = TARGET_SIGNAL_0;
+      enum target_signal resume_signal = TARGET_SIGNAL_0;
       ptid_t event_ptid;
 
       struct target_waitstatus ws;
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1874,7 +1874,7 @@ linux_nat_resume (struct target_ops *ops,
 			"LLR: Preparing to %s %s, %s, inferior_ptid %s\n",
 			step ? "step" : "resume",
 			target_pid_to_str (ptid),
-			signo ? strsignal (signo) : "0",
+			target_signal_to_name (signo),
 			target_pid_to_str (inferior_ptid));
 
   block_child_signals (&prev_mask);
@@ -1907,7 +1907,7 @@ linux_nat_resume (struct target_ops *ops,
 
   if (lp->status && WIFSTOPPED (lp->status))
     {
-      int saved_signo;
+      enum target_signal saved_signo;
       struct inferior *inf;
 
       inf = find_inferior_pid (ptid_get_pid (lp->ptid));
@@ -1974,7 +1974,7 @@ linux_nat_resume (struct target_ops *ops,
 			"LLR: %s %s, %s (resume event thread)\n",
 			step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
 			target_pid_to_str (ptid),
-			signo ? strsignal (signo) : "0");
+			target_signal_to_name (signo));
 
   restore_child_signals_mask (&prev_mask);
   if (target_can_async_p ())
@@ -2266,7 +2266,7 @@ linux_handle_extended_wait (struct lwp_info *lp, int status,
 	     catchpoints.  */
 	  if (!stopping)
 	    {
-	      int signo;
+	      enum target_signal signo;
 
 	      new_lp->stopped = 0;
 	      new_lp->resumed = 1;
@@ -3567,7 +3567,7 @@ retry:
 
   if (WIFSTOPPED (status))
     {
-      int signo = target_signal_from_host (WSTOPSIG (status));
+      enum target_signal signo = target_signal_from_host (WSTOPSIG (status));
       struct inferior *inf;
 
       inf = find_inferior_pid (ptid_get_pid (lp->ptid));
@@ -3597,7 +3597,7 @@ retry:
 				lp->step ?
 				"PTRACE_SINGLESTEP" : "PTRACE_CONT",
 				target_pid_to_str (lp->ptid),
-				signo ? strsignal (signo) : "0");
+				target_signal_to_name (signo));
 	  lp->stopped = 0;
 	  goto retry;
 	}
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -715,7 +715,7 @@ m32r_wait (struct target_ops *ops,
     fprintf_unfiltered (gdb_stdlog, "m32r_wait()\n");
 
   status->kind = TARGET_WAITKIND_EXITED;
-  status->value.sig = 0;
+  status->value.sig = TARGET_SIGNAL_0;
 
   interrupted = 0;
   prev_sigint = signal (SIGINT, gdb_cntrl_c);
@@ -886,7 +886,7 @@ m32r_detach (struct target_ops *ops, char *args, int from_tty)
   if (remote_debug)
     fprintf_unfiltered (gdb_stdlog, "m32r_detach(%d)\n", from_tty);
 
-  m32r_resume (ops, inferior_ptid, 0, 0);
+  m32r_resume (ops, inferior_ptid, 0, TARGET_SIGNAL_0);
 
   /* calls m32r_close to do the real work */
   pop_target ();
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1748,7 +1748,8 @@ handle_v_cont (char *own_buf)
 
       if (p[0] == 'S' || p[0] == 'C')
 	{
-	  int sig;
+	  enum target_signal sig;
+
 	  sig = strtol (p + 1, &q, 16);
 	  if (p == q)
 	    goto err;
--- a/gdb/gdbserver/target.c
+++ b/gdb/gdbserver/target.c
@@ -98,7 +98,7 @@ mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options,
 
   if (ourstatus->kind == TARGET_WAITKIND_EXITED)
     fprintf (stderr,
-	     "\nChild exited with status %d\n", ourstatus->value.sig);
+	     "\nChild exited with status %d\n", ourstatus->value.integer);
   else if (ourstatus->kind == TARGET_WAITKIND_SIGNALLED)
     fprintf (stderr, "\nChild terminated with signal = 0x%x (%s)\n",
 	     target_signal_to_host (ourstatus->value.sig),

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] target_signal obvious fixups
  2010-09-06  7:35 [patch] target_signal obvious fixups Jan Kratochvil
@ 2010-09-06 13:35 ` Pedro Alves
  2010-09-06 14:54   ` Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2010-09-06 13:35 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jan Kratochvil

On Saturday 04 September 2010 22:58:12, Jan Kratochvil wrote:
> Hi,
> 
> as the siginfo series got complicated here is at least the obvious fixup part
> to be useful independently on the other patches.
> 
> It is a part of:
> 	[patch 3/9]#2 Change target_signal_t to a struct
> 	http://sourceware.org/ml/gdb-patches/2010-08/msg00483.html
> 
> No regressions on {x86_64,x86_64-m32,i686}-fedora14snapshot-linux-gnu.
> 
> Not checked in but it seems mostly obvious.

Comments inline below.

> gdb/
> 2010-09-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* corelow.c (core_open): Do not print signal name without
> 	CORE_GDBARCH.
> 	* fork-child.c (startup_inferior) <resume_signal>: Use enum
> 	target_signal type.
> 	* linux-nat.c (linux_nat_resume): Replace strsignal by
> 	target_signal_to_name.  Use enum target_signal type for saved_signo.
> 	(linux_handle_extended_wait) <signo>: Use enum target_signal type.
> 	(linux_nat_wait_1): Use enum target_signal type for signo.  Replace
> 	strsignal by target_signal_to_name.
> 	* remote-m32r-sdi.c (m32r_wait, m32r_detach): Replace 0 by
> 	TARGET_SIGNAL_0.
> 
> gdb/gdbserver/
> 2010-09-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* server.c (handle_v_cont) <sig>: Use enum target_signal type.
> 	* target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
> 
> --- a/gdb/corelow.c
> +++ b/gdb/corelow.c
> @@ -437,7 +437,7 @@ core_open (char *filename, int from_tty)
>  		     target_signal_to_string (
>  		       (core_gdbarch != NULL) ?
>  			gdbarch_target_signal_from_host (core_gdbarch, siggy)
> -			: siggy));
> +			: TARGET_SIGNAL_0));

Something like this would be better:

    enum target_signal sig = ((core_gdbarch != NULL)
                               ? gdbarch_target_signal_from_host (core_gdbarch, siggy)
                               : target_signal_from_host (siggy));

    printf_filtered (_("Program terminated with signal %d, %s.\n"), siggy,
                     target_signal_to_string (sig));

I had something similar in my patch, but I see I typod there and
wrote target_signal_from_number instead of target_signal_from_host.

>    /* Fetch all registers from core file.  */
>    target_fetch_registers (get_current_regcache (), -1);
> --- a/gdb/fork-child.c
> +++ b/gdb/fork-child.c
> @@ -448,7 +448,7 @@ startup_inferior (int ntraps)
>  
>    while (1)
>      {
> -      int resume_signal = TARGET_SIGNAL_0;
> +      enum target_signal resume_signal = TARGET_SIGNAL_0;
>        ptid_t event_ptid;
>  

Okay.

>        struct target_waitstatus ws;
> --- a/gdb/linux-nat.c
> +++ b/gdb/linux-nat.c
> @@ -1874,7 +1874,7 @@ linux_nat_resume (struct target_ops *ops,
>  			"LLR: Preparing to %s %s, %s, inferior_ptid %s\n",
>  			step ? "step" : "resume",
>  			target_pid_to_str (ptid),
> -			signo ? strsignal (signo) : "0",
> +			target_signal_to_name (signo),
>  			target_pid_to_str (inferior_ptid));

(...)

>    block_child_signals (&prev_mask);
> @@ -1907,7 +1907,7 @@ linux_nat_resume (struct target_ops *ops,
>  
>    if (lp->status && WIFSTOPPED (lp->status))
>      {
> -      int saved_signo;
> +      enum target_signal saved_signo;
>        struct inferior *inf;
>  
>        inf = find_inferior_pid (ptid_get_pid (lp->ptid));
> @@ -1974,7 +1974,7 @@ linux_nat_resume (struct target_ops *ops,
>  			"LLR: %s %s, %s (resume event thread)\n",
>  			step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
>  			target_pid_to_str (ptid),
> -			signo ? strsignal (signo) : "0");
> +			target_signal_to_name (signo));
>  

I think it'd be better to keep using strsignal, so we may easily see
when the target_signal translates to something bizarre that we're about
to send to ptrace/tkill/kill.  (This is at the native level, so it goes
along with the PTRACE_SINGLESTEP|CONT.)  Agree?  See my patch.

>    restore_child_signals_mask (&prev_mask);
>    if (target_can_async_p ())
> @@ -2266,7 +2266,7 @@ linux_handle_extended_wait (struct lwp_info *lp, int status,
>  	     catchpoints.  */
>  	  if (!stopping)
>  	    {
> -	      int signo;
> +	      enum target_signal signo;
>  

Okay.

>  	      new_lp->stopped = 0;
>  	      new_lp->resumed = 1;
> @@ -3567,7 +3567,7 @@ retry:
>  
>    if (WIFSTOPPED (status))
>      {
> -      int signo = target_signal_from_host (WSTOPSIG (status));
> +      enum target_signal signo = target_signal_from_host (WSTOPSIG (status));
>        struct inferior *inf;
>  

Okay.

>        inf = find_inferior_pid (ptid_get_pid (lp->ptid));
> @@ -3597,7 +3597,7 @@ retry:
>  				lp->step ?
>  				"PTRACE_SINGLESTEP" : "PTRACE_CONT",
>  				target_pid_to_str (lp->ptid),
> -				signo ? strsignal (signo) : "0");
> +				target_signal_to_name (signo));

Same as above.


>  	  lp->stopped = 0;
>  	  goto retry;
>  	}
> --- a/gdb/remote-m32r-sdi.c
> +++ b/gdb/remote-m32r-sdi.c
> @@ -715,7 +715,7 @@ m32r_wait (struct target_ops *ops,
>      fprintf_unfiltered (gdb_stdlog, "m32r_wait()\n");
>  
>    status->kind = TARGET_WAITKIND_EXITED;
> -  status->value.sig = 0;
> +  status->value.sig = TARGET_SIGNAL_0;

Okay.

>  
>    interrupted = 0;
>    prev_sigint = signal (SIGINT, gdb_cntrl_c);
> @@ -886,7 +886,7 @@ m32r_detach (struct target_ops *ops, char *args, int from_tty)
>    if (remote_debug)
>      fprintf_unfiltered (gdb_stdlog, "m32r_detach(%d)\n", from_tty);
>  
> -  m32r_resume (ops, inferior_ptid, 0, 0);
> +  m32r_resume (ops, inferior_ptid, 0, TARGET_SIGNAL_0);

Okay.

>  
>    /* calls m32r_close to do the real work */
>    pop_target ();
> --- a/gdb/gdbserver/server.c
> +++ b/gdb/gdbserver/server.c
> @@ -1748,7 +1748,8 @@ handle_v_cont (char *own_buf)
>  
>        if (p[0] == 'S' || p[0] == 'C')
>  	{
> -	  int sig;
> +	  enum target_signal sig;
> +
>  	  sig = strtol (p + 1, &q, 16);

This is okay with me, but I'd like to point out that
this makes one use of sig correct (a bit below this code,
not quoted), while making the "sig = strtol" assignment
assume you can convert a long to an enum / target_signal.
IMO, this is a case where target_signal_from_number would
make sense (I had one in my patch, not sure you had one
in yours).  Let me repeat this is okay with me as is...

>  	  if (p == q)
>  	    goto err;
> --- a/gdb/gdbserver/target.c
> +++ b/gdb/gdbserver/target.c
> @@ -98,7 +98,7 @@ mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options,
>  
>    if (ourstatus->kind == TARGET_WAITKIND_EXITED)
>      fprintf (stderr,
> -	     "\nChild exited with status %d\n", ourstatus->value.sig);
> +	     "\nChild exited with status %d\n", ourstatus->value.integer);

Okay.

>    else if (ourstatus->kind == TARGET_WAITKIND_SIGNALLED)
>      fprintf (stderr, "\nChild terminated with signal = 0x%x (%s)\n",
>  	     target_signal_to_host (ourstatus->value.sig),
> 


-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] target_signal obvious fixups
  2010-09-06 13:35 ` Pedro Alves
@ 2010-09-06 14:54   ` Jan Kratochvil
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2010-09-06 14:54 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Mon, 06 Sep 2010 13:29:08 +0200, Pedro Alves wrote:
> On Saturday 04 September 2010 22:58:12, Jan Kratochvil wrote:
> Something like this would be better:
> 
>     enum target_signal sig = ((core_gdbarch != NULL)
>                                ? gdbarch_target_signal_from_host (core_gdbarch, siggy)
>                                : target_signal_from_host (siggy));
> 
>     printf_filtered (_("Program terminated with signal %d, %s.\n"), siggy,
>                      target_signal_to_string (sig));

OK, used it.


> > --- a/gdb/linux-nat.c
> > +++ b/gdb/linux-nat.c
> > -			signo ? strsignal (signo) : "0");
> > +			target_signal_to_name (signo));
> 
> I think it'd be better to keep using strsignal, so we may easily see
> when the target_signal translates to something bizarre that we're about
> to send to ptrace/tkill/kill.  (This is at the native level, so it goes
> along with the PTRACE_SINGLESTEP|CONT.)  Agree?  See my patch.

I would like to make a note target_signal_to_host used for native target would
do anyway
      warning ("Signal %s does not exist on this system.\n",
               target_signal_to_name (oursig));

But I understand even for a supported signal target_signal_to_name and
strsignal can have different output.

Therefore used your variant (from the other patch).


> > --- a/gdb/gdbserver/server.c
> > +++ b/gdb/gdbserver/server.c
> > @@ -1748,7 +1748,8 @@ handle_v_cont (char *own_buf)
> >  	{
> > -	  int sig;
> > +	  enum target_signal sig;
> > +
> >  	  sig = strtol (p + 1, &q, 16);
> 
> This is okay with me, but I'd like to point out that
> this makes one use of sig correct (a bit below this code,
> not quoted), while making the "sig = strtol" assignment
> assume you can convert a long to an enum / target_signal.
> IMO, this is a case where target_signal_from_number would
> make sense (I had one in my patch, not sure you had one
> in yours).  Let me repeat this is okay with me as is...

I am sorry but this part wasn't appropriate for this kind of patch.  SIG needs
to be both `int' and `enum target_signal' so it is a subject for the "real
patch" dependent variants of conversions.

Dropped this patch chunk.


Checked-in.


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2010-09/msg00044.html

--- src/gdb/ChangeLog	2010/09/06 13:34:01	1.12154
+++ src/gdb/ChangeLog	2010/09/06 13:59:00	1.12155
@@ -1,3 +1,18 @@
+2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
+	    Pedro Alves  <pedro@codesourcery.com>
+
+	* corelow.c (core_open): Use target_signal_from_host if CORE_GDBARCH
+	is NULL.
+	* fork-child.c (startup_inferior) <resume_signal>: Use enum
+	target_signal type.
+	* linux-nat.c (linux_nat_resume): Use target_signal_to_host before
+	calling strsignal.  Use enum target_signal type for saved_signo.
+	(linux_handle_extended_wait) <signo>: Use enum target_signal type.
+	(linux_nat_wait_1): Use enum target_signal type for signo.  Use
+	target_signal_to_host before calling strsignal.
+	* remote-m32r-sdi.c (m32r_wait, m32r_detach): Replace 0 by
+	TARGET_SIGNAL_0.
+
 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
 	    Jan Kratochvil  <jan.kratochvil@redhat.com>
 
--- src/gdb/gdbserver/ChangeLog	2010/09/06 10:43:58	1.424
+++ src/gdb/gdbserver/ChangeLog	2010/09/06 13:59:02	1.425
@@ -1,3 +1,7 @@
+2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
+
 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
 
 	* Makefile.in (install-only): Replace $IPA_DEPFILES with
--- src/gdb/corelow.c	2010/08/18 12:24:12	1.103
+++ src/gdb/corelow.c	2010/09/06 13:59:02	1.104
@@ -429,15 +429,18 @@
 
   siggy = bfd_core_file_failing_signal (core_bfd);
   if (siggy > 0)
-    /* NOTE: target_signal_from_host() converts a target signal value
-       into gdb's internal signal value.  Unfortunately gdb's internal
-       value is called ``target_signal'' and this function got the
-       name ..._from_host(). */
-    printf_filtered (_("Program terminated with signal %d, %s.\n"), siggy,
-		     target_signal_to_string (
-		       (core_gdbarch != NULL) ?
-			gdbarch_target_signal_from_host (core_gdbarch, siggy)
-			: siggy));
+    {
+      /* NOTE: target_signal_from_host() converts a target signal value
+	 into gdb's internal signal value.  Unfortunately gdb's internal
+	 value is called ``target_signal'' and this function got the
+	 name ..._from_host(). */
+      enum target_signal sig = (core_gdbarch != NULL
+		       ? gdbarch_target_signal_from_host (core_gdbarch, siggy)
+		       : target_signal_from_host (siggy));
+
+      printf_filtered (_("Program terminated with signal %d, %s.\n"), siggy,
+		       target_signal_to_string (sig));
+    }
 
   /* Fetch all registers from core file.  */
   target_fetch_registers (get_current_regcache (), -1);
--- src/gdb/fork-child.c	2010/05/14 19:27:05	1.56
+++ src/gdb/fork-child.c	2010/09/06 13:59:02	1.57
@@ -448,7 +448,7 @@
 
   while (1)
     {
-      int resume_signal = TARGET_SIGNAL_0;
+      enum target_signal resume_signal = TARGET_SIGNAL_0;
       ptid_t event_ptid;
 
       struct target_waitstatus ws;
--- src/gdb/linux-nat.c	2010/09/02 01:19:32	1.183
+++ src/gdb/linux-nat.c	2010/09/06 13:59:02	1.184
@@ -1874,7 +1874,8 @@
 			"LLR: Preparing to %s %s, %s, inferior_ptid %s\n",
 			step ? "step" : "resume",
 			target_pid_to_str (ptid),
-			signo ? strsignal (signo) : "0",
+			(signo != TARGET_SIGNAL_0
+			 ? strsignal (target_signal_to_host (signo)) : "0"),
 			target_pid_to_str (inferior_ptid));
 
   block_child_signals (&prev_mask);
@@ -1907,7 +1908,7 @@
 
   if (lp->status && WIFSTOPPED (lp->status))
     {
-      int saved_signo;
+      enum target_signal saved_signo;
       struct inferior *inf;
 
       inf = find_inferior_pid (ptid_get_pid (lp->ptid));
@@ -1974,7 +1975,8 @@
 			"LLR: %s %s, %s (resume event thread)\n",
 			step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
 			target_pid_to_str (ptid),
-			signo ? strsignal (signo) : "0");
+			(signo != TARGET_SIGNAL_0
+			 ? strsignal (target_signal_to_host (signo)) : "0"));
 
   restore_child_signals_mask (&prev_mask);
   if (target_can_async_p ())
@@ -2266,7 +2268,7 @@
 	     catchpoints.  */
 	  if (!stopping)
 	    {
-	      int signo;
+	      enum target_signal signo;
 
 	      new_lp->stopped = 0;
 	      new_lp->resumed = 1;
@@ -3567,7 +3569,7 @@
 
   if (WIFSTOPPED (status))
     {
-      int signo = target_signal_from_host (WSTOPSIG (status));
+      enum target_signal signo = target_signal_from_host (WSTOPSIG (status));
       struct inferior *inf;
 
       inf = find_inferior_pid (ptid_get_pid (lp->ptid));
@@ -3597,7 +3599,9 @@
 				lp->step ?
 				"PTRACE_SINGLESTEP" : "PTRACE_CONT",
 				target_pid_to_str (lp->ptid),
-				signo ? strsignal (signo) : "0");
+				(signo != TARGET_SIGNAL_0
+				 ? strsignal (target_signal_to_host (signo))
+				 : "0"));
 	  lp->stopped = 0;
 	  goto retry;
 	}
--- src/gdb/remote-m32r-sdi.c	2010/07/07 16:15:16	1.51
+++ src/gdb/remote-m32r-sdi.c	2010/09/06 13:59:02	1.52
@@ -715,7 +715,7 @@
     fprintf_unfiltered (gdb_stdlog, "m32r_wait()\n");
 
   status->kind = TARGET_WAITKIND_EXITED;
-  status->value.sig = 0;
+  status->value.sig = TARGET_SIGNAL_0;
 
   interrupted = 0;
   prev_sigint = signal (SIGINT, gdb_cntrl_c);
@@ -886,7 +886,7 @@
   if (remote_debug)
     fprintf_unfiltered (gdb_stdlog, "m32r_detach(%d)\n", from_tty);
 
-  m32r_resume (ops, inferior_ptid, 0, 0);
+  m32r_resume (ops, inferior_ptid, 0, TARGET_SIGNAL_0);
 
   /* calls m32r_close to do the real work */
   pop_target ();
--- src/gdb/gdbserver/target.c	2010/09/01 01:53:43	1.19
+++ src/gdb/gdbserver/target.c	2010/09/06 13:59:03	1.20
@@ -98,7 +98,7 @@
 
   if (ourstatus->kind == TARGET_WAITKIND_EXITED)
     fprintf (stderr,
-	     "\nChild exited with status %d\n", ourstatus->value.sig);
+	     "\nChild exited with status %d\n", ourstatus->value.integer);
   else if (ourstatus->kind == TARGET_WAITKIND_SIGNALLED)
     fprintf (stderr, "\nChild terminated with signal = 0x%x (%s)\n",
 	     target_signal_to_host (ourstatus->value.sig),

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-06 14:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-06  7:35 [patch] target_signal obvious fixups Jan Kratochvil
2010-09-06 13:35 ` Pedro Alves
2010-09-06 14:54   ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).