public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Tom de Vries <tdevries@suse.de>
Cc: Tom Tromey <tromey@adacore.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH 1/5] Introduce new overload of read_text_file_to_string
Date: Tue, 20 Feb 2024 07:08:40 -0700	[thread overview]
Message-ID: <874je3449j.fsf@tromey.com> (raw)
In-Reply-To: <01e650fd-3a6c-4e2b-bf17-d0e89f19070b@suse.de> (Tom de Vries's message of "Mon, 19 Feb 2024 16:36:34 +0100")

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> On 2/16/24 19:37, Tom Tromey wrote:
>> +/* Read the entire content of FILE into an std::string.  */
>> +
>> +extern std::string read_text_file_to_string (FILE *file);
>> +
>> #endif /* COMMON_FILESTUFF_H */
>> 
Tom> It occurred to me that if this reads the entire content of FILE,
Tom> shouldn't it start with an "fseek (file, 0, SEEK_SET)"?

Tom> We could add an argument at_start that lets us skip the fseek, and
Tom> default it to false, and call it with at_start set to true from the
Tom> "const char *path" version of read_text_file_to_string.

I'd rather not add things that we don't need.
How about I rename the function instead?

Tom

  reply	other threads:[~2024-02-20 14:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 18:37 [PATCH 0/5] Fix DAP pause bug Tom Tromey
2024-02-16 18:37 ` [PATCH 1/5] Introduce new overload of read_text_file_to_string Tom Tromey
2024-02-19 15:36   ` Tom de Vries
2024-02-20 14:08     ` Tom Tromey [this message]
2024-02-20 14:48       ` Tom de Vries
2024-02-16 18:37 ` [PATCH 2/5] Fix formatting buglet in python.c Tom Tromey
2024-02-16 18:37 ` [PATCH 3/5] kfail a FinishBreakpoint test Tom Tromey
2024-02-16 18:37 ` [PATCH 4/5] Rewrite "python" command exception handling Tom Tromey
2024-02-16 18:37 ` [PATCH 5/5] Use the .py file in gdb.dap/pause.exp 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=874je3449j.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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).