From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26048 invoked by alias); 27 Apr 2007 10:37:41 -0000 Received: (qmail 26039 invoked by uid 22791); 27 Apr 2007 10:37:40 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate8.de.ibm.com (HELO mtagate8.de.ibm.com) (195.212.29.157) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 27 Apr 2007 11:37:38 +0100 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.8/8.13.8) with ESMTP id l3RAbYCe175308 for ; Fri, 27 Apr 2007 10:37:34 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l3RAbYwP3354714 for ; Fri, 27 Apr 2007 12:37:34 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l3RAbYJ3028014 for ; Fri, 27 Apr 2007 12:37:34 +0200 Received: from [9.152.248.44] (dyn-9-152-248-44.boeblingen.de.ibm.com [9.152.248.44]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l3RAbX2s027990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Apr 2007 12:37:34 +0200 Message-ID: <4631D21A.2070305@de.ibm.com> Date: Fri, 27 Apr 2007 11:05:00 -0000 From: Markus Deuling User-Agent: Thunderbird 1.5.0.10 (X11/20070301) MIME-Version: 1.0 To: Pedro Alves CC: GDB Patches Subject: Re: [rfc] Fix qC handling in gdbserver References: <4631ADC8.6000603@de.ibm.com> <4053daab0704270327y37ad430el9b352c455f02e90b@mail.gmail.com> In-Reply-To: <4053daab0704270327y37ad430el9b352c455f02e90b@mail.gmail.com> Content-Type: multipart/mixed; boundary="------------030209020509030602050409" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00354.txt.bz2 This is a multi-part message in MIME format. --------------030209020509030602050409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 624 Hi Pedro, Pedro Alves wrote: > All the other tests in the function seem to check for an > extra '\0', ',' or ':' after the query name. Shouldn't you do the > same here? Otherwise you are answering > to all future queries starting with qC (Think or a gdbserver > installed in rom in a board in the field, and connecting > to it with gdb-cvs2020 :) ) yes, your're right. I changed the patch to use strcmp now. I just wanted to save the overhead of a function call for two characters. But I would have missed qC :-) Thanks for review! -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------030209020509030602050409 Content-Type: text/plain; name="diff_gdbserver_fix" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff_gdbserver_fix" Content-length: 1116 diff -urN src/gdb/gdbserver/server.c dev/gdb/gdbserver/server.c --- src/gdb/gdbserver/server.c 2007-03-29 05:37:17.000000000 +0200 +++ dev/gdb/gdbserver/server.c 2007-04-27 12:31:45.000000000 +0200 @@ -259,6 +259,14 @@ { static struct inferior_list_entry *thread_ptr; + /* Reply the current thread id. */ + if (strcmp ("qC", own_buf) == 0) + { + sprintf (own_buf, "QC %lx", + ((struct inferior_list_entry *) current_inferior)->id); + return; + } + if (strcmp ("qSymbol::", own_buf) == 0) { if (the_target->look_up_symbols != NULL) diff -urN src/gdb/remote.c dev/gdb/remote.c --- src/gdb/remote.c 2007-03-28 05:42:54.000000000 +0200 +++ dev/gdb/remote.c 2007-04-27 12:29:21.000000000 +0200 @@ -2096,9 +2096,7 @@ /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); - /* Let the stub know that we want it to return the thread. */ - set_thread (-1, 0); - + /* Get the pid of the first thread. */ inferior_ptid = remote_current_thread (inferior_ptid); get_offsets (); /* Get text, data & bss offsets. */ --------------030209020509030602050409--