From owner-freebsd-questions@FreeBSD.ORG Mon Jun 1 01:47:07 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC3F7106566B for ; Mon, 1 Jun 2009 01:47:07 +0000 (UTC) (envelope-from kline@thought.org) Received: from aristotle.thought.org (aristotle.thought.org [209.180.213.210]) by mx1.freebsd.org (Postfix) with ESMTP id 8B9A18FC17 for ; Mon, 1 Jun 2009 01:47:07 +0000 (UTC) (envelope-from kline@thought.org) Received: from thought.org (tao.thought.org [10.47.0.250]) (authenticated bits=0) by aristotle.thought.org (8.14.2/8.14.2) with ESMTP id n511mBPW002467; Sun, 31 May 2009 18:48:11 -0700 (PDT) (envelope-from kline@thought.org) Received: by thought.org (nbSMTP-1.00) for uid 1002 kline@thought.org; Sun, 31 May 2009 18:47:02 -0700 (PDT) Date: Sun, 31 May 2009 18:47:02 -0700 From: Gary Kline To: till plewe Message-ID: <20090601014702.GB9839@thought.org> References: <20090601010602.GA9692@thought.org> <8be8566f0905311823y7871c5a3q1b8d57a4d9f520c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8be8566f0905311823y7871c5a3q1b8d57a4d9f520c@mail.gmail.com> User-Agent: Mutt/1.4.2.3i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 22++ years of service to the Unix community. X-Spam-Status: No, score=-4.4 required=3.6 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on aristotle.thought.org Cc: FreeBSD Mailing List Subject: Re: is there a macro that prints the incoming param list? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 01:47:08 -0000 On Mon, Jun 01, 2009 at 10:23:01AM +0900, till plewe wrote: > On Mon, Jun 1, 2009 at 10:06 AM, Gary Kline wrote: > > > > is there any marco that printfs the incoming list, or am i asking too much of the > > compiler at runtime? > > > > example: > > > > main (int argc, char *argv) > > > > with this macro might print: > > > > "2", "testinput" > > > > and baz(char *file, int count) > > > > similarly might print, > > > > "testinput", "47" > > > > i'm probably asking the impossible, but this is certainly the place to > > ask. > > > > thanks, > > > > gary > > > > > > ps: i'm looking to create a DEBUG header. > > > > > > > > -- > > Gary Kline kline@thought.org http://www.thought.org Public Service Unix > > http://jottings.thought.org http://transfinite.thought.org > > The 4.91a release of Jottings: http://jottings.thought.org/index.php > > > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > > > > How is the macro supposed to know how to print the arguments? > There may be user defined types. > > The simplest way would be to add a printf statement after each > function definition. yeah, this is what i've done by hand. printfs at first, then gdb last. > > You could write scripts which generate the format strings for you from > your header files and then use a (variadic) macro which expects that you have > generated a table which contains for each function name the corresponding > format string and argument list. a script might work, thanks for the idea. but it's enought to have been reminded of the gcc macros . -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org The 4.91a release of Jottings: http://jottings.thought.org/index.php