From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19912 invoked by alias); 15 Mar 2005 13:07:34 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17523 invoked from network); 15 Mar 2005 13:06:20 -0000 Received: from unknown (HELO svr68.ehostpros.com) (67.15.48.48) by sourceware.org with SMTP; 15 Mar 2005 13:06:20 -0000 Received: from [61.11.18.135] (helo=pythagoras.linsyssoft.com) by svr68.ehostpros.com with esmtpsa (TLSv1:RC4-MD5:128) (Exim 4.44) id 1DBBkX-0005Ap-0C; Tue, 15 Mar 2005 05:06:17 -0800 From: "Amit S. Kale" Organization: LinSysSoft Technologies Pvt Ltd To: Daniel Jacobowitz Subject: Re: [patch] gdbserver fails on 32-bit ppc rfs running in a-64 bit 2.6 linux kernel Date: Tue, 15 Mar 2005 13:07:00 -0000 User-Agent: KMail/1.7 Cc: GDB patches References: <200503142137.35799.amitkale@linsyssoft.com> <20050314162252.GA23939@nevyn.them.org> In-Reply-To: <20050314162252.GA23939@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503151836.22542.amitkale@linsyssoft.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - svr68.ehostpros.com X-AntiAbuse: Original Domain - sources.redhat.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - linsyssoft.com X-Source: X-Source-Args: X-Source-Dir: X-SW-Source: 2005-03/txt/msg00206.txt.bz2 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? 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. -Amit On Monday 14 Mar 2005 9:52 pm, Daniel Jacobowitz wrote: > On Mon, Mar 14, 2005 at 09:37:35PM +0530, Amit S. Kale wrote: > > Hi, > > > > I found that gdbserver fails on a 32-bit ppc rfs running in a 64-bit 2.6 > > linux > > "rfs"? It'd be nice to explain one's acronyms... > > > kernel. The thread id's fetched from thread-db library are above > > 0x7fffffff. gdbserver has implicit assumptions that thread id's are > > "signed integers". This is true when running under a 32-bit kernel, but > > not true here. Attached patch fixes this problem by changing the "strtol" > > that scans the thread-id to "strtoul" and by changing the "cont_thread > > > 0" comparison to "cont_thread != -1". > > > > Is there any likelyhood of this assumption being made in some other > > places in gdbserver or gdb? > > Please see: > > 2005-03-03 Daniel Jacobowitz > > * inferiors.c (change_inferior_id, add_thread, find_inferior_id): > Take unsigned long arguments for PIDs. > * linux-low.c (add_process, linux_attach_lwp, linux_attach) > (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop) > (wait_for_sigstop, linux_resume_one_process) > (regsets_fetch_inferior_registers, linux_send_signal) > (linux_read_auxv): Likewise. Update the types of variables holding > PIDs. Update format string specifiers. > * linux-low.h (struct process_info, linux_attach_lwp): Likewise. > * remote-utils.c (prepare_resume_reply): Likewise. > * server.c (cont_thread, general_thread, step_thread) > (thread_from_wait, old_thread_from_wait, signal_pid): Change type > to unsigned long. > (handle_query): Update format specifiers. > (handle_v_cont, main): Use strtoul for thread IDs. > * server.h (struct inferior_list_entry): Use unsigned long for ID. > (add_thread, find_inferior_id, change_inferior_id, cont_thread) > (general_thread, step_thread, thread_from_wait) > (old_thread_from_wait): Update. > * target.h (struct thread_resume): Use unsigned long for THREAD. > (struct target_ops): Use unsigned long for arguments to attach and > thread_alive. > > Your sources are dated after this but don't seem to include this fix.