From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15350 invoked by alias); 17 Jan 2014 02:58:47 -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 15341 invoked by uid 89); 17 Jan 2014 02:58:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f173.google.com Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com) (209.85.223.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 17 Jan 2014 02:58:45 +0000 Received: by mail-ie0-f173.google.com with SMTP id e14so4737880iej.18 for ; Thu, 16 Jan 2014 18:58:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=R1LdaF4yNo8Yw57unxnzxsZ+/b6Ak0EhLERso2GqlcA=; b=AX4DOgt2vvtzUA811yZIhSEFIXGx2QaIRw9VjPmW3tqyvf1dDYilEOSs+FdbULkEqI hLQbgKRrzSJYyfJBXq3YXIf1qeWJ56n5qPVXRtDPGuT/3EcimmSdQO1W9nsbVMuI9GVb QkDSO4UUmvlLxZ99HIZuSefamwd8zDQuwgTl/Jgzj8/vctUw6uP2XAWYe6Ljb87sRfUX C149Yh3Q0bf1fgMTZ6l5iH7sPeZLM+6+5AvqOluCMWjOWGV99HEzgPw5b6PQVHZWqmUn WBqGqgv2BYt7B04I+n6kBj/tI4lnrq0+tFg5PqoU5jqPfBhcQV2048K+CN3e1HRFJuA7 ia9Q== X-Gm-Message-State: ALoCoQkwvp/2i+sYmO+1cO9cG9522lIiVUHA2e5jGZQqzlf9aVnytRsVjdok8hT1EsE2GBNdfphaC9gv+cTqFQzxYbAC4TgY052F9IYAqdGtYmK55/sXR6HckxBnRuK/0PgEeAzjkOkSI8Gw1uO+5EPqxezoB30ZhW3N9AzrRoda3WvogK40K1vaxEcDeLR7xda7qNaoYHKT2oPC1MDiWWKOzm41Eg/EYw== MIME-Version: 1.0 X-Received: by 10.50.67.180 with SMTP id o20mr333860igt.43.1389927523948; Thu, 16 Jan 2014 18:58:43 -0800 (PST) Received: by 10.64.58.77 with HTTP; Thu, 16 Jan 2014 18:58:43 -0800 (PST) In-Reply-To: <21208.27945.781450.905336@ruffy.mtv.corp.google.com> 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> Date: Fri, 17 Jan 2014 02:58:00 -0000 Message-ID: Subject: Re: [PATCH 3/3, doc RFA] gdbserver debug_printf+timestamps: main patch From: Doug Evans To: Pedro Alves , Yao Qi , Eli Zaretskii Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00667.txt.bz2 On Thu, Jan 16, 2014 at 3:37 PM, Doug Evans wrote: > [...] > @@ -2710,6 +2713,43 @@ handle_status (char *own_buf) > } > } > > +/* Parse options to --debug. > + ARG is either "--debug" or "--debug=foo". > + The result is zero if all options were parsed ok, otherwise > + (e.g., an option is misspelled) an error message is printed and > + non-zero is returned . */ > + > +static int > +parse_debug_options (const char *arg) > +{ > + VEC (char_ptr) *options; > + int ix; > + char *option; > + > + /* This is always implicit. */ > + debug_threads = 1; > + > + if (strcmp (arg, "--debug") == 0) > + return 0; > + gdb_assert (strncmp (arg, "--debug=", sizeof ("--debug=") - 1) == 0); > + > + options = delim_string_to_char_ptr_vec (arg + sizeof ("--debug=") - 1, ','); > + > + for (ix = 0; VEC_iterate (char_ptr, options, ix, option); ++ix) > + { > + if (strcmp (option, "timestamp") == 0) > + debug_timestamp = 1; > + else > + { > + fprintf (stderr, "Unknown --debug argument: \"%s\"\n", option); > + return 1; > + } > + } > + > + free_char_ptr_vec (options); > + return 0; > +} Blech, something's been nagging at me and sure enough ... Silly memory leak (harmless, but still ...). Will be fixed for checkin.