From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21520 invoked by alias); 8 Jun 2014 21:13:34 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32752 Received: (qmail 22632 invoked from network); 8 Jun 2014 21:13:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140608141318.ZM20482@torch.brasslantern.com> Date: Sun, 08 Jun 2014 14:13:18 -0700 In-reply-to: <24D729FF-77D8-4F38-848B-86920FE1FD11@laposte.net> Comments: In reply to "nicolas.canceill" "Logging/debugging from within Src/Zle/compmatch.c" (Jun 8, 12:25pm) References: <33086926-C7D7-4D33-AF86-4B0D48977555@laposte.net> <140607105445.ZM24783@torch.brasslantern.com> <140607123006.ZM25086@torch.brasslantern.com> <35EC1DF1-5D60-42CA-93FB-A6400E4308CF@laposte.net> <140607140205.ZM26027@torch.brasslantern.com> <24D729FF-77D8-4F38-848B-86920FE1FD11@laposte.net> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "nicolas.canceill" , zsh-workers@zsh.org Subject: Re: Logging/debugging from within Src/Zle/compmatch.c MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jun 8, 12:25pm, nicolas.canceill wrote: } } Following up on a discussion on zsh-users [1], I wish to try and debug } the internals of Src/Zle/compmatch.c, but I am not a gdb guru so I } prefer to log a bunch of stuff from within the C functions. Can anyone } advise on the best way to do so? Do you think a simple syslog(3) will } do? Syslog would certainly do the job, but seems a bit of overkill unless you're trying to collect logs from several zsh at once to see how they interact. I probably didn't understand your question properly before. I think what you want is to sprinkle some calls to dputs(ERRMSG(...)) around the functions you're interested in. If you do use syslog, using ERRMSG(...) will add helpful stuff like the file name and line number. For both dputs and ERRMSG you need to compile with DEBUG defined to the preprocessor.