From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1669 invoked by alias); 20 Jan 2014 16:14:16 -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 1639 invoked by uid 89); 20 Jan 2014 16:14:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 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; Mon, 20 Jan 2014 16:14:15 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0KGEAe1019140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 20 Jan 2014 11:14:10 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0KGE8QZ016945; Mon, 20 Jan 2014 11:14:09 -0500 Message-ID: <52DD4B50.8060002@redhat.com> Date: Mon, 20 Jan 2014 16:14: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> <52D92610.4010202@redhat.com> <21209.45676.594470.76921@ruffy.mtv.corp.google.com> In-Reply-To: <21209.45676.594470.76921@ruffy.mtv.corp.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-01/txt/msg00742.txt.bz2 On 01/17/2014 10:45 PM, Doug Evans wrote: > Pedro Alves writes: > > 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. > > I changed --debug= to --debug-format=, and added monitor commands. Thanks. I have no further comments. -- Pedro Alves