From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 4F7B33858C2C; Wed, 2 Feb 2022 16:27:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F7B33858C2C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: update the comment on string_to_event_location X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: a698397481825193bee128d13f0b232bf66980ce X-Git-Newrev: b6e05abee333e1cf322efac82bd7032c9d6b0add Message-Id: <20220202162750.4F7B33858C2C@sourceware.org> Date: Wed, 2 Feb 2022 16:27:50 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Feb 2022 16:27:50 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Db6e05abee333= e1cf322efac82bd7032c9d6b0add commit b6e05abee333e1cf322efac82bd7032c9d6b0add Author: Andrew Burgess Date: Tue Dec 7 13:22:33 2021 +0000 gdb: update the comment on string_to_event_location =20 The comment on string_to_event_location is (I believe) out of date. This commit fixes the two issues I see: =20 1. This function can't return NULL any more. The implementation calls string_to_explicit_location which can return NULL, but if this is the case we then call string_to_event_location_basic, which I don't believe can ever return NULL. =20 2. I've removed the mention that the returned string is malloc'd, though this is true, now that we return a managed pointer, I believe the source of the memory allocation is irrelevant, and so, shouldn't be discussed in the header comment. =20 There should be no user visible changes after this commit. Diff: --- gdb/location.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gdb/location.h b/gdb/location.h index 848f6458e5e..ff21c1c21cc 100644 --- a/gdb/location.h +++ b/gdb/location.h @@ -205,12 +205,11 @@ extern event_location_up copy_event_location (const struct event_location *src); =20 /* Attempt to convert the input string in *ARGP into an event_location. - ARGP is advanced past any processed input. Returns an event_location - (malloc'd) if an event location was successfully found in *ARGP, - NULL otherwise. + ARGP is advanced past any processed input. Always returns a non-nullptr + event_location unique pointer object. =20 - This function may call error() if *ARGP looks like properly formed, - but invalid, input, e.g., if it is called with missing argument paramet= ers + This function may call error() if *ARGP looks like properly formed, but + invalid, input, e.g., if it is called with missing argument parameters or invalid options. =20 This function is intended to be used by CLI commands and will parse