From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86876 invoked by alias); 3 Dec 2019 21:07:55 -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 86864 invoked by uid 89); 3 Dec 2019 21:07:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=something!, *c X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Dec 2019 21:07:52 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 03BB32053D; Tue, 3 Dec 2019 16:07:50 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id E24AD2032B; Tue, 3 Dec 2019 16:07:48 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id B8DB32816F; Tue, 3 Dec 2019 16:07:48 -0500 (EST) X-Gerrit-PatchSet: 14 Date: Tue, 03 Dec 2019 21:07:00 -0000 From: "Andrew Burgess (Code Review)" To: gdb-patches@sourceware.org Cc: Simon Marchi , Joel Brobecker Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v14] gdb/mi: Add -max-results parameter to some -symbol-info-* commands X-Gerrit-Change-Id: I90a28feb55b388fb46461a096c5db08b6b0bd427 X-Gerrit-Change-Number: 269 X-Gerrit-ChangeURL: X-Gerrit-Commit: e225ce9974a1603805cde132c839f183efe40d17 In-Reply-To: References: X-Gerrit-Comment-Date: Tue, 3 Dec 2019 16:07:48 -0500 Reply-To: gnutoolchain-gerrit@osci.io MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191203210748.B8DB32816F@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-12/txt/msg00103.txt.bz2 Andrew Burgess has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/269 ...................................................................... Patch Set 14: (1 comment) | --- gdb/mi/mi-symbol-cmds.c | +++ gdb/mi/mi-symbol-cmds.c | @@ -168,4 +170,19 @@ mi_symbol_info (enum search_domain kind, const char *name_regexp, | | +/* Helper to parse the option text from an -max-results argument and return | + the parsed value. If the text can't be parsed then an error is thrown. */ | + | +static size_t | +parse_max_results_option (char *arg) | +{ | + char *ptr = arg; | + long long val = strtoll (arg, &ptr, 10); | + if (arg == ptr || val > SIZE_MAX || val < 0) PS13, Line 179: I couldn't find anything. I checked the manual looking for MI commands that might take a number or count type argument, the only examples I could find already either used ato* or strto* functions. I couldn't see anything obvious in utils.c or gdbsupport/*.c either - though I'd be happy to be told I'm missed something! Anyway, I fixed this issue you pointed out and updated the patch for now. | + error (_("invalid value for --max-results argument")); | + size_t max_results = (size_t) val; | + | + return max_results; | +} | + | /* Helper for mi_cmd_symbol_info_{functions,variables} - depending on KIND. | Processes command line options from ARGV and ARGC. */ | -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: I90a28feb55b388fb46461a096c5db08b6b0bd427 Gerrit-Change-Number: 269 Gerrit-PatchSet: 14 Gerrit-Owner: Andrew Burgess Gerrit-Reviewer: Andrew Burgess Gerrit-CC: Joel Brobecker Gerrit-CC: Simon Marchi Gerrit-Comment-Date: Tue, 03 Dec 2019 21:07:48 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: Simon Marchi Gerrit-MessageType: comment