From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21311 invoked by alias); 7 Jan 2011 17:17:50 -0000 Received: (qmail 21300 invoked by uid 22791); 7 Jan 2011 17:17:49 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Jan 2011 17:17:45 +0000 Received: (qmail 24630 invoked from network); 7 Jan 2011 17:17:44 -0000 Received: from unknown (HELO macbook-2.local) (stan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 Jan 2011 17:17:44 -0000 Message-ID: <4D274AB7.3080304@codesourcery.com> Date: Fri, 07 Jan 2011 17:17:00 -0000 From: Stan Shebs User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: duplicated code in gdb and gdbserver References: <4D272FF6.3070402@codesourcery.com> In-Reply-To: <4D272FF6.3070402@codesourcery.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: 2011-01/txt/msg00157.txt.bz2 On 1/7/11 7:23 AM, Yao Qi wrote: > I noticed that sharing code of GDB and GDBServer is discussed in 2010 > GCC Summit. > http://sourceware.org/gdb/wiki/2010_GCC_Summit_BoF I think everybody generally agrees that sharing code is good, and we should take opportunities to do so. Where it's likely to get complicated is in areas like stop handling. GDB's native code can make casual references into breakpoint definitions, set/show variables, which is no big deal when you're in the same address space, but GDBserver needs to be either be preloaded with that information or pass the buck to GDB. One thing that we could be doing in addition to moving code is to scrutinize gdb/*-nat.c and friends, and abstract out some API for any in-GDB-itself assumptions. Hopefully that will help to minimize the need for #ifdef GDBSERVER hacks as we refactor the code. Stan