Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: Matthieu Longo <matthieu.longo@arm.com>
Cc: <gdb-patches@sourceware.org>,
	 Luis Machado <luis.machado@amd.com>,
	Luis Machado <luis.machado.foss@gmail.com>,
	 Simon Marchi <simark@simark.ca>,
	 "Kevin Buettner" <kevinb@redhat.com>,
	 Christina Schimpe <christina.schimpe@intel.com>,
	 Christina Joos <christina.joos@intel.com>
Subject: Re: [PATCH v1 3/6] gdb: introduce helper class file_reader_t
Date: Mon, 03 Aug 2026 05:00:25 +0000	[thread overview]
Message-ID: <87ldan3ija.fsf@linaro.org> (raw)
In-Reply-To: <20260728151700.253720-4-matthieu.longo@arm.com> (Matthieu Longo's message of "Tue, 28 Jul 2026 16:16:57 +0100")

Matthieu Longo <matthieu.longo@arm.com> writes:

> Wrap all the boilerplate code required to read a file in a new helper
> class: file_reader_t. The class owns the file contents together with
> the file path, and provides convenient accessors for the data, size and
> typed views. It supports both null-terminated text files and binary files.
>
> This helper eliminates repeated calls to target_fileio_read_stralloc
> and target_fileio_read_alloc, remove explicit memory management with
> gdb::unique_xmalloc_ptr, and simplifies the casting logic when working
> with binary data.
>
> The patch converts some of the existing Linux, AMD64, and SPARC code that
> reads files from /proc to use file_reader_t.
> ---
>  gdb/amd64-linux-tdep.c |  12 ++---
>  gdb/linux-tdep.c       | 109 ++++++++++++++++++-----------------------
>  gdb/sparc64-tdep.c     |  13 +++--
>  gdb/target.h           |  79 +++++++++++++++++++++++++++++
>  4 files changed, 137 insertions(+), 76 deletions(-)

Thank you for adding the comments I requested.

You addressed Christina's remarks about keeping the current behaviour
when reading empty files in the case of the task maps file and also in
the case of the SPARC-specific adi/maps file. I don't know whether this
is enough to resolve her concerns. Assuming it is:

Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>

-- 
Thiago
(he/him)

  reply	other threads:[~2026-08-03  5:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 15:16 [PATCH v1 0/6] gdb: introduce file_reader_t to read procfs files Matthieu Longo
2026-07-28 15:16 ` [PATCH v1 1/6] target_fileio_read_stralloc: add an optional length parameter Matthieu Longo
2026-08-03  4:49   ` Thiago Jung Bauermann
2026-07-28 15:16 ` [PATCH v1 2/6] gdb support: add gdb::ranges::replace algorithm Matthieu Longo
2026-07-28 15:16 ` [PATCH v1 3/6] gdb: introduce helper class file_reader_t Matthieu Longo
2026-08-03  5:00   ` Thiago Jung Bauermann [this message]
2026-08-10 13:07   ` Joos, Christina
2026-08-14 15:25     ` Matthieu Longo
2026-08-24 16:30       ` Matthieu Longo
2026-08-25  8:55       ` Joos, Christina
2026-07-28 15:16 ` [PATCH v1 4/6] gdb/linux-tdep: migrate linux_info_proc to file_reader_t Matthieu Longo
2026-08-03  5:00   ` Thiago Jung Bauermann
2026-07-28 15:16 ` [PATCH v1 5/6] gdb/linux-tdep: migrate linux_find_memory_regions_full " Matthieu Longo
2026-08-03  5:01   ` Thiago Jung Bauermann
2026-07-28 15:17 ` [PATCH v1 6/6] gdb/linux-tdep: remove legacy parse_smaps_data overload Matthieu Longo
2026-07-28 15:43 ` [PATCH v1 0/6] gdb: introduce file_reader_t to read procfs files Joos, Christina

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=87ldan3ija.fsf@linaro.org \
    --to=thiago.bauermann@linaro.org \
    --cc=christina.joos@intel.com \
    --cc=christina.schimpe@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=luis.machado.foss@gmail.com \
    --cc=luis.machado@amd.com \
    --cc=matthieu.longo@arm.com \
    --cc=simark@simark.ca \
    /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