From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6005 invoked by alias); 17 Jan 2014 12:46:19 -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 5994 invoked by uid 89); 17 Jan 2014 12:46:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Jan 2014 12:46:15 +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 s0HCkAKL021493 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Jan 2014 07:46:10 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s0HCk81C030041; Fri, 17 Jan 2014 07:46:09 -0500 Message-ID: <52D92610.4010202@redhat.com> Date: Fri, 17 Jan 2014 12:46:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Doug Evans CC: Yao Qi , eliz@gnu.org, gdb-patches Subject: Re: [PATCH 3/3, doc RFA] gdbserver debug_printf+timestamps: main patch References: <52B1842F.5020401@redhat.com> <21205.55987.69477.892571@ruffy.mtv.corp.google.com> <52D81569.3080006@redhat.com> <52D82AD5.7000306@redhat.com> <21208.27400.695984.88504@ruffy.mtv.corp.google.com> <21208.27945.781450.905336@ruffy.mtv.corp.google.com> In-Reply-To: <21208.27945.781450.905336@ruffy.mtv.corp.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-01/txt/msg00671.txt.bz2 On 01/16/2014 11:37 PM, Doug Evans wrote: > +++ b/gdb/gdbserver/debug.c > @@ -0,0 +1,86 @@ > +/* General utility routines for the remote server for GDB. These ... > +++ b/gdb/gdbserver/debug.h > @@ -0,0 +1,48 @@ > +/* General utility routines for the remote server for GDB. ... need updating. > +#endif /* UTILS_H */ This too -- DEBUG_H. > +debug_printf (const char *msg, ...) > +{ > + va_list args; > +#ifdef HAVE_GETTIMEOFDAY > + static int new_line = 1; > + Note this isn't thread safe either. Maybe add a comment in case we ever try to make timespamping work in the IPA? > + options = delim_string_to_char_ptr_vec (arg + sizeof ("--debug=") - 1, ','); > + > + for (ix = 0; VEC_iterate (char_ptr, options, ix, option); ++ix) > + { I don't see much point in this extra copying over plain old strtok (already used in the --disable-packet= code), but OK... > else if (strcmp (*next_arg, "--debug") == 0) > - debug_threads = 1; > + parse_debug_options (*next_arg); > + else if (strncmp (*next_arg, "--debug=", sizeof ("--debug=") - 1) == 0) > + { > + if (parse_debug_options (*next_arg) != 0) > + exit (1); > + } This should be hooked in "monitor set debug ..." as well. Otherwise looks good to me. Thanks, -- Pedro Alves