From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18618 invoked by alias); 27 Jul 2009 17:39:08 -0000 Received: (qmail 18610 invoked by uid 22791); 27 Jul 2009 17:39:07 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Jul 2009 17:39:01 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n6RHcxti009257 for ; Mon, 27 Jul 2009 13:38:59 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6RHcwPF006591 for ; Mon, 27 Jul 2009 13:38:59 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6RGeh7G012150; Mon, 27 Jul 2009 12:40:44 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 753743782CF; Mon, 27 Jul 2009 10:40:43 -0600 (MDT) To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Implement -break-commands References: <200907271303.13335.vladimir@codesourcery.com> From: Tom Tromey Reply-To: tromey@redhat.com Date: Mon, 27 Jul 2009 18:49:00 -0000 In-Reply-To: <200907271303.13335.vladimir@codesourcery.com> (Vladimir Prus's message of "Mon\, 27 Jul 2009 13\:03\:12 +0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-07/txt/msg00656.txt.bz2 >>>>> "Volodya" == Vladimir Prus writes: This all looks reasonable to me. I have a few style nits. Volodya> -/* Read one line from the input stream. If the command is an "end", Volodya> - return such an indication to the caller. If PARSE_COMMANDS is true, Volodya> - strip leading whitespace (trailing whitespace is always stripped) Volodya> - in the line, attempt to recognize GDB control commands, and also Volodya> - return an indication if the command is an "else" or a nop. Volodya> - Otherwise, only "end" is recognized. */ Volodya> -static enum misc_command_type Volodya> -read_next_line (struct command_line **command, int parse_commands) Volodya> +char * Volodya> +read_next_line () This should be marked `static' (it is declared that way but it is clearer to mark the definition as well). I think it needs a header comment. Volodya> static enum command_control_type Volodya> -recurse_read_control_structure (struct command_line *current_cmd) Volodya> +recurse_read_control_structure (char * (*read_next_line_func) (), Volodya> + struct command_line *current_cmd) The header comment should be updated to mention the new argument. And if you don't mind, please fix the reference to the non-existing "parent_control" parameter. Volodya> +extern struct command_line *read_command_lines_1 Volodya> +(char * (*read_next_line_func) (), int parse_commands); Indentation on the 2nd line. There's some other little style nits in the patch -- over-bracing in the second patch, mostly. Volodya> +void Volodya> +breakpoint_set_commands (struct breakpoint *b, struct command_line *commands) Needs a header comment. Volodya> +static char **mi_command_line_array; Volodya> +static int mi_command_line_array_cnt; Volodya> +static int mi_command_line_array_ptr; [...] Volodya> + break_command = read_command_lines_1 (mi_read_next_line, 0); I think this would be cleaner if read_command_lines_1 took a "user_data" argument and then there were no new globals. Tom