From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5591 invoked by alias); 6 Jan 2012 19:59:27 -0000 Received: (qmail 5582 invoked by uid 22791); 6 Jan 2012 19:59:26 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ee0-f41.google.com (HELO mail-ee0-f41.google.com) (74.125.83.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Jan 2012 19:59:13 +0000 Received: by eekc41 with SMTP id c41so1408812eek.0 for ; Fri, 06 Jan 2012 11:59:12 -0800 (PST) Received: by 10.213.105.144 with SMTP id t16mr1449579ebo.95.1325879952380; Fri, 06 Jan 2012 11:59:12 -0800 (PST) Received: from [192.168.0.103] (bl21-184-26.dsl.telepac.pt. [2.82.184.26]) by mx.google.com with ESMTPS id s16sm251926037eef.2.2012.01.06.11.59.10 (version=SSLv3 cipher=OTHER); Fri, 06 Jan 2012 11:59:11 -0800 (PST) Message-ID: <4F07528D.9000606@gmail.com> Date: Fri, 06 Jan 2012 19:59:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: luis_gustavo@mentor.com CC: gdb-patches@sourceware.org Subject: Re: [RFC stub-side break conditions 4/5] Group agent expression-specific code in its own file References: <4F05BA15.9030206@mentor.com> In-Reply-To: <4F05BA15.9030206@mentor.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: 2012-01/txt/msg00246.txt.bz2 On 01/05/2012 02:56 PM, Luis Machado wrote: > 2012-01-05 Luis Machado > > gdbserver/ > * server.h: Include tracepoint.h. Doesn't look that this is true. But indeed the monolithic server.h will probably be broken up at some point. Not having automatic dependency tracking is IMO what tends to produce central headers (because we're lazy). > (agent_mem_read, agent_get_trace_state_variable_value, > agent_set_trace_state_variable_value, > agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr, > get_set_tsv_func_addr): New prototypes. > > -mem-break.o: mem-break.c $(server_h) > +mem-break.o: mem-break.c $(server_h) $(ax_h) This change doesn't belong in this patch. > + > +static void > +ax_vdebug (const char *fmt, ...) > +{ > + char buf[1024]; > + va_list ap; > + > + va_start (ap, fmt); > + vsprintf (buf, fmt, ap); > + fprintf (stderr, "gdbserver/ax: %s\n", buf); Is this called from the IPA? Is so, you'll want a change similar to what Yao did recently to tracepoint.c. We should promote something like util.c's PREFIX macro, and use it everywhere to fix this once and for all: somewhere global: #ifdef IN_PROCESS_AGENT # define PROG "ipa" #else # define PROG "gdbserver" #endif and then: fprintf (stderr, PROG "/ax: %s\n", buf); > + va_end (ap); > +} > + > +#define ax_debug_1(level, fmt, args...) \ > + do { \ > + if (level <= debug_threads) \ > + ax_vdebug ((fmt), ##args); \ > + } while (0) > + > +#define ax_debug(FMT, args...) \ > + ax_debug_1 (1, FMT, ##args) > + > +/* Prefix exported symbols, for good citizenship. All the symbols > + that need exporting are defined in this module. */ The latter sentence was true where the code was copied from, but it is not true here. > +#ifdef IN_PROCESS_AGENT > +# define get_trace_state_variable_value \ > + gdb_agent_get_trace_state_variable_value > +# define set_trace_state_variable_value \ > + gdb_agent_set_trace_state_variable_value > +#endif > + > +/* This enum must exactly match what is documented in > + gdb/doc/agentexpr.texi, including all the numerical values. */ > + Otherwise looks good. Feel free to put it in without waiting for the other patches to be ok. -- Pedro Alves