public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/5] Introduce new overload of read_text_file_to_string
Date: Mon, 19 Feb 2024 16:36:34 +0100	[thread overview]
Message-ID: <01e650fd-3a6c-4e2b-bf17-d0e89f19070b@suse.de> (raw)
In-Reply-To: <20240216-py-simple-exc-v1-1-c275bcfb5e4a@adacore.com>

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 */
> 
It occurred to me that if this reads the entire content of FILE, 
shouldn't it start with an "fseek (file, 0, SEEK_SET)"?

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

Thanks,
- Tom

  reply	other threads:[~2024-02-19 15:36 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 [this message]
2024-02-20 14:08     ` Tom Tromey
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=01e650fd-3a6c-4e2b-bf17-d0e89f19070b@suse.de \
    --to=tdevries@suse.de \
    --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).