From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2913 invoked by alias); 11 Jul 2014 19:44:48 -0000 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 Received: (qmail 2875 invoked by uid 89); 11 Jul 2014 19:44:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f202.google.com Received: from mail-vc0-f202.google.com (HELO mail-vc0-f202.google.com) (209.85.220.202) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 11 Jul 2014 19:44:41 +0000 Received: by mail-vc0-f202.google.com with SMTP id id10so261112vcb.5 for ; Fri, 11 Jul 2014 12:44:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:cc:subject:in-reply-to :references; bh=qOmBGW0AX+Ne58ncA0wKIR2ok3mT36rspMFCeNpD0wk=; b=QAMCTBK6oPMWNScruGCyDYipnBhj7aICv6atkCqVmOBXZMfyxMFlMqQ6+s377S5EhZ VJpL0QLKwP9ckIuKs4anJpjra07hXpUJsd6c66JuU+TUnRj/+A2QGKGRsxA6wBebJKGF 2qJi5FKqiskPRrm/YMQ+Krd/949o9K7y+8dnxkbRpo5gZ25e8kFq+5QN4yg9RtKVWSJ6 Ppa+o3IIwR1pJwoqDCZDOeuFRA6GN/N2VPjTQk+06B6zS/3c5yCxaIlN3J5vH/rALaYF YiXcSFbF/VIij6UOTm3MlE3y0pRsCjMmbM8QG2ynH2gx7kL9UnTRoRSJHkYovYKKE1gd AkTA== X-Gm-Message-State: ALoCoQle26nKwq7DrmmsuxQog/q9czX6NUUloGs3IkgBNaiHa4Rm5x7Qz6F5tCVzwhVW/Z7vW5wb X-Received: by 10.236.197.226 with SMTP id t62mr387030yhn.50.1405107879492; Fri, 11 Jul 2014 12:44:39 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id c50si239715yhl.7.2014.07.11.12.44.39 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Jul 2014 12:44:39 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id F0E4731C321; Fri, 11 Jul 2014 12:44:38 -0700 (PDT) From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21440.16038.443276.765473@ruffy.mtv.corp.google.com> Date: Fri, 11 Jul 2014 19:57:00 -0000 To: Gary Benson Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 05/15] Introduce and use debug_printf and debug_vprintf In-Reply-To: <1404902255-11101-6-git-send-email-gbenson@redhat.com> References: <1404902255-11101-1-git-send-email-gbenson@redhat.com> <1404902255-11101-6-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00293.txt.bz2 Gary Benson writes: > This introduces debug_printf and debug_vprintf, a function that > clients of "common" are expected to implement. gdbserver's > existing debug_printf is repurposed as debug_vprintf, and a new > wrapper is written. > > common/agent.c is changed to use debug_vprintf rather than > defining the macro DEBUG_AGENT depending on GDBSERVER. > > nat/i386-dregs.c is changed to use the externally-implemented > debug_printf, rather than defining it itself. > > gdb/ > 2014-07-09 Tom Tromey > Gary Benson > > * common/common-debug.h: New file. > * utils.h: Include common-debug.h. > * utils.c (debug_vprintf): New function. > (debug_printf): Likewise. > * common/agent.c (debug_agent_print): New function. > (DEBUG_AGENT): Redefine. > * nat/i386-dregs.c (debug_printf): Undefine. > > gdb/gdbserver/ > 2014-07-09 Tom Tromey > Gary Benson > > * utils.h: Include common-debug.h. > * debug.h (debug_printf): Don't declare. > * debug.c (debug_vprintf): New function. > (debug_printf): Use the above. IWBN if there was more file naming consistency. As a general rule, how objectionable is it to have gdb/foo.c and gdbserver/foo.c for every shared foo.h header? [Or common-foo.h header in the case of, e.g., common/common-debug.h.] An alternative would be to move common-debug.h to a new directory, e.g., shared, and call it shared/debug.h. I'm only mentioning this for discussion sake, it's not a requisite for this patch. In this case, any objection to putting the gdb implementation in gdb/debug.c instead of utils.c?