public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCH 1/5] gdb: update the comment on string_to_event_location
Date: Tue,  7 Dec 2021 23:13:41 +0000	[thread overview]
Message-ID: <07747ed7e2f24120a321e177fe82df0a28d5a6b0.1638918701.git.aburgess@redhat.com> (raw)
In-Reply-To: <cover.1638918701.git.aburgess@redhat.com>

The comment on string_to_event_location is (I believe) out of date.
This commit fixes the two issues I see:

  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.

  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.

There should be no user visible changes after this commit.
---
 gdb/location.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gdb/location.h b/gdb/location.h
index 0c37784d59e..b999ef2c5f7 100644
--- a/gdb/location.h
+++ b/gdb/location.h
@@ -211,12 +211,11 @@ extern event_location_up
   copy_event_location (const struct event_location *src);
 
 /* 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.
 
-   This function may call error() if *ARGP looks like properly formed,
-   but invalid, input, e.g., if it is called with missing argument parameters
+   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.
 
    This function is intended to be used by CLI commands and will parse
-- 
2.25.4


  reply	other threads:[~2021-12-07 23:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07 23:13 [PATCH 0/5] Fix for 'list task 123' (PR cli/28668) Andrew Burgess
2021-12-07 23:13 ` Andrew Burgess [this message]
2021-12-07 23:13 ` [PATCH 2/5] gdb: add empty string check in parse_linespec Andrew Burgess
2021-12-07 23:13 ` [PATCH 3/5] gdb/testsuite: move linespec test into gdb.linespec/ directory Andrew Burgess
2021-12-07 23:13 ` [PATCH 4/5] gdb: handle calls to list command passing only a linespec condition Andrew Burgess
2021-12-07 23:13 ` [PATCH 5/5] gdb: handle calls to edit " Andrew Burgess
2021-12-07 23:18 ` [PATCH 0/5] Fix for 'list task 123' (PR cli/28668) Andrew Burgess
2022-01-27 17:47 ` [PATCHv2 0/6] Fix for 'list task 123' (PR cli/28665) Andrew Burgess
2022-01-27 17:47   ` [PATCHv2 1/6] gdb: update the comment on string_to_event_location Andrew Burgess
2022-01-27 17:47   ` [PATCHv2 2/6] gdb: add empty string check in parse_linespec Andrew Burgess
2022-01-27 17:47   ` [PATCHv2 3/6] gdb/testsuite: move linespec test into gdb.linespec/ directory Andrew Burgess
2022-01-27 17:47   ` [PATCHv2 4/6] gdb: handle calls to list command passing only a linespec condition Andrew Burgess
2022-01-27 17:47   ` [PATCHv2 5/6] gdb: handle calls to edit " Andrew Burgess
2022-01-27 17:47   ` [PATCHv2 6/6] gdb: test to check one aspect of the linespec parsing code Andrew Burgess
2022-01-27 20:35   ` [PATCHv2 0/6] Fix for 'list task 123' (PR cli/28665) Tom Tromey
2022-02-02 16:32     ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=07747ed7e2f24120a321e177fe82df0a28d5a6b0.1638918701.git.aburgess@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).