From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 4/4] Change target_read_string API
Date: Sat, 13 Jun 2020 10:40:04 -0400 [thread overview]
Message-ID: <fb9417c3-13fd-e56a-52dd-0efca02204b5@simark.ca> (raw)
In-Reply-To: <20200612215356.22145-5-tromey@adacore.com>
On 2020-06-12 5:53 p.m., Tom Tromey wrote:
> diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
> index 19d1105ae95..6c0cffe4a42 100644
> --- a/gdb/solib-svr4.c
> +++ b/gdb/solib-svr4.c
> @@ -958,7 +958,6 @@ open_symbol_file_object (int from_tty)
> {
> CORE_ADDR lm, l_name;
> gdb::unique_xmalloc_ptr<char> filename;
> - int errcode;
> struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
> struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
> int l_name_size = TYPE_LENGTH (ptr_type);
> @@ -993,12 +992,11 @@ open_symbol_file_object (int from_tty)
> return 0; /* No filename. */
>
> /* Now fetch the filename from target memory. */
> - target_read_string (l_name, &filename, SO_NAME_MAX_PATH_SIZE - 1, &errcode);
> + filename = target_read_string (l_name, SO_NAME_MAX_PATH_SIZE - 1);
Declare `filename` here? There are a few more occurences of this in the patch that I
would fix, since that actually results in less generated code.
Simon
next prev parent reply other threads:[~2020-06-13 14:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-12 21:53 [PATCH 0/4] Unify string-reading APIs Tom Tromey
2020-06-12 21:53 ` [PATCH 1/4] Remove read_memory_string Tom Tromey
2020-06-13 14:19 ` Simon Marchi
2020-06-15 12:37 ` Pedro Alves
2020-06-12 21:53 ` [PATCH 2/4] Rewrite target_read_string Tom Tromey
2020-06-12 21:53 ` [PATCH 3/4] Remove a use of target_read_string Tom Tromey
2020-06-13 3:04 ` Sergio Durigan Junior
2020-06-15 12:13 ` Tom Tromey
2020-06-12 21:53 ` [PATCH 4/4] Change target_read_string API Tom Tromey
2020-06-13 14:40 ` Simon Marchi [this message]
2020-06-13 14:40 ` [PATCH 0/4] Unify string-reading APIs Simon Marchi
2020-06-15 12:27 ` Tom Tromey
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=fb9417c3-13fd-e56a-52dd-0efca02204b5@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.com \
/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).