Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: "Amit S. Kale" <amitkale@linsyssoft.com>,
	GDB patches <gdb-patches@sources.redhat.com>
Subject: Re: [patch] gdbserver fails on 32-bit ppc rfs running in a-64 bit 2.6 linux kernel
Date: Fri, 17 Jun 2005 04:00:00 -0000	[thread overview]
Message-ID: <20050617035955.GI17013@nevyn.them.org> (raw)
In-Reply-To: <20050316031609.GA29869@nevyn.them.org>

On Tue, Mar 15, 2005 at 10:16:09PM -0500, Daniel Jacobowitz wrote:
> On Tue, Mar 15, 2005 at 06:36:22PM +0530, Amit S. Kale wrote:
> > The strtoul change in my patch was already present. Sorry about that.
> > 
> > You have changed the data type of thread_resume::thread as well as cont_thread 
> > to unsigned long. "cont_thread = -1" and "(cont_thread > 0)" are still in 
> > place. How does this work?
> 
> Hmm, looks like you found a real problem here; would you like to fix
> it?  Modern GDBs don't heavily use this code, because of the vCont
> packet.  Otherwise I'll fix it, but I may not find time for a bit.
> 
> > Can we use a thread value of "0" to indicate all threads or no-thread instead 
> > of "-1"? The condition "cont_thread > 0" becomes valid if we do that.
> 
> This value can be set from the remote protocol, so we would have to
> transform it in Hc/Hg support also.

Better late than never: this patch eliminates the bogus -1 checks. 
Tested i686-linux, committed.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

2005-06-16  Daniel Jacobowitz  <dan@codesourcery.com>

	* linux-low.c (linux_wait, linux_send_signal): Don't test
	an unsigned long variable for > 0 if it could be MAX_ULONG.
	* server.c (myresume): Likewise.
	* target.c (set_desired_inferior): Likewise.

Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.37
diff -u -p -r1.37 linux-low.c
--- linux-low.c	13 Jun 2005 01:59:22 -0000	1.37
+++ linux-low.c	17 Jun 2005 03:51:05 -0000
@@ -667,7 +667,7 @@ retry:
      then we need to make sure we restart the other threads.  We could
      pick a thread at random or restart all; restarting all is less
      arbitrary.  */
-  if (cont_thread > 0)
+  if (cont_thread != 0 && cont_thread != -1)
     {
       child = (struct thread_info *) find_inferior_id (&all_threads,
 						       cont_thread);
@@ -1435,7 +1435,7 @@ linux_send_signal (int signum)
 {
   extern unsigned long signal_pid;
 
-  if (cont_thread > 0)
+  if (cont_thread != 0 && cont_thread != -1)
     {
       struct process_info *process;
 
Index: server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.26
diff -u -p -r1.26 server.c
--- server.c	13 Jun 2005 01:59:22 -0000	1.26
+++ server.c	17 Jun 2005 03:51:05 -0000
@@ -281,7 +281,7 @@ myresume (int step, int sig)
   struct thread_resume resume_info[2];
   int n = 0;
 
-  if (step || sig || cont_thread > 0)
+  if (step || sig || (cont_thread != 0 && cont_thread != -1))
     {
       resume_info[0].thread
 	= ((struct inferior_list_entry *) current_inferior)->id;
@@ -293,7 +293,7 @@ myresume (int step, int sig)
   resume_info[n].thread = -1;
   resume_info[n].step = 0;
   resume_info[n].sig = 0;
-  resume_info[n].leave_stopped = (cont_thread > 0);
+  resume_info[n].leave_stopped = (cont_thread != 0 && cont_thread != -1);
 
   (*the_target->resume) (resume_info);
 }
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/target.c,v
retrieving revision 1.5
diff -u -p -r1.5 target.c
--- target.c	13 Jun 2005 01:59:22 -0000	1.5
+++ target.c	17 Jun 2005 03:51:05 -0000
@@ -42,7 +42,8 @@ set_desired_inferior (int use_general)
       /* If we are continuing any (all) thread(s), use step_thread
 	 to decide which thread to step and/or send the specified
 	 signal to.  */
-      if (step_thread > 0 && (cont_thread == 0 || cont_thread == -1))
+      if ((step_thread != 0 && step_thread != -1)
+	  && (cont_thread == 0 || cont_thread == -1))
 	found = (struct thread_info *) find_inferior_id (&all_threads,
 							 step_thread);
 


  reply	other threads:[~2005-06-17  4:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-14 16:07 Amit S. Kale
2005-03-14 16:23 ` Daniel Jacobowitz
2005-03-14 16:57   ` Christopher Faylor
2005-03-14 17:02     ` Daniel Jacobowitz
2005-03-15 13:07   ` Amit S. Kale
2005-03-16  3:16     ` Daniel Jacobowitz
2005-06-17  4:00       ` Daniel Jacobowitz [this message]
2005-03-16 16:54 Jitendra Pawar
2005-03-16 16:57 ` Daniel Jacobowitz
2005-03-22 14:11   ` Jitendra Pawar
2005-03-22 14:23     ` Daniel Jacobowitz
2005-03-22 14:50       ` Jitendra Pawar
2005-03-22 14:54         ` Daniel Jacobowitz
2005-03-23 10:03           ` Jitendra Pawar
2005-03-23 15:43             ` Daniel Jacobowitz
2005-03-24 13:42               ` Jitendra Pawar
2005-03-24 14:02                 ` Daniel Jacobowitz
2005-03-22 18:49     ` Mark Kettenis

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=20050617035955.GI17013@nevyn.them.org \
    --to=drow@false.org \
    --cc=amitkale@linsyssoft.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