From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2615 invoked by alias); 16 May 2012 20:17:22 -0000 Received: (qmail 2606 invoked by uid 22791); 16 May 2012 20:17:21 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 May 2012 20:17:08 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4GKH3tB011799 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 May 2012 16:17:03 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q4GKH1WA014026 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 16 May 2012 16:17:02 -0400 From: Tom Tromey To: Stan Shebs Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH v2] dynamic printf References: <4FA8BC97.2000801@earthlink.net> <4FA8D049.109@codesourcery.com> <4FB12A8E.7040905@earthlink.net> Date: Wed, 16 May 2012 20:17:00 -0000 In-Reply-To: <4FB12A8E.7040905@earthlink.net> (Stan Shebs's message of "Mon, 14 May 2012 08:53:50 -0700") Message-ID: <87ipfvop8i.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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-05/txt/msg00623.txt.bz2 >>>>> "Stan" == Stan Shebs writes: Sorry about the delay on this. Stan> + /* Manufacture a printf/continue sequence. */ Stan> + if (printf_line) Stan> + { Stan> + struct command_line *printf_cmd_line, *cont_cmd_line = NULL; Stan> + Stan> + cont_cmd_line = xmalloc (sizeof (struct command_line)); Stan> + cont_cmd_line->control_type = simple_control; Stan> + cont_cmd_line->body_count = 0; Stan> + cont_cmd_line->body_list = NULL; Stan> + cont_cmd_line->next = NULL; Stan> + cont_cmd_line->line = xstrdup ("continue"); Stan> + Stan> + printf_cmd_line = xmalloc (sizeof (struct command_line)); Stan> + printf_cmd_line->control_type = simple_control; Stan> + printf_cmd_line->body_count = 0; Stan> + printf_cmd_line->body_list = NULL; Stan> + printf_cmd_line->next = cont_cmd_line; Stan> + printf_cmd_line->line = printf_line; Stan> + Stan> + breakpoint_set_commands (b, printf_cmd_line); I thought this approach would break "next"ing over a dprintf location. Stan> +void dprintf_command (char *arg, int from_tty); Stan> + Stan> +/* The dynamic printf command is mostly like a regular breakpoint, but Stan> + with a prewired command list consisting of a single output command, Stan> + built from extra arguments supplied on the dprintf command Stan> + line. */ Stan> + Stan> +void Stan> +dprintf_command (char *arg, int from_tty) I think this could be static. Tom