[v2,0/6] gdb: introduce file_reader_t to read procfs files

Message ID 20260825100912.514232-1-matthieu.longo@arm.com
Headers
Series gdb: introduce file_reader_t to read procfs files |

Message

Matthieu Longo Aug. 25, 2026, 10:09 a.m. UTC
  Those patches were extracted from a previous patch series [1].
Patches 1 and 2 are prerequisites to the next patches.
Patch 3 introduces class file_reader_t, and patches 4, 5, and 5 migrates existing code to use this new class.

Already reviewed but pending on a maintainer's approval: 1, 3, 4, 5
Pending on review and approval: 2
Already reviewed and approved: 6

v1: https://inbox.sourceware.org/gdb-patches/20260728151700.253720-1-matthieu.longo@arm.com/
Changes v1 -> v2:
- in patch 3/6,
  - amended the commit message as requested by Christina to mention the behavioral change.
  - fix mistake in condition of adi_is_addr_mapped ()
  - made move constructor, and move assignment operator of file_reader_t use =default.
  - disabled copy constructor and copy assignment operator of file_reader_t.

Changes diff against [1]:
- remove reimplementation of std::replace, and use std::replace for gdb::ranges::replace.
- addressed comments from Christina Schimpe and Chirstina Joos regarding the interface of class file_reader_t.
- fix the implementation of extract_string_view_from_buffer after Luis found bugs in the previous implementation.

This patch series depends on [2].

[1]: https://inbox.sourceware.org/gdb-patches/20260707154900.94542-1-matthieu.longo@arm.com/
[2]: https://inbox.sourceware.org/gdb-patches/20260728143317.245389-1-matthieu.longo@arm.com/

Regards,
Matthieu


Matthieu Longo (6):
  target_fileio_read_stralloc: add an optional length parameter
  gdb support: add gdb::ranges::replace algorithm
  gdb: introduce helper class file_reader_t
  gdb/linux-tdep: migrate linux_info_proc to file_reader_t
  gdb/linux-tdep: migrate linux_find_memory_regions_full to file_reader_t
  gdb/linux-tdep: remove legacy parse_smaps_data overload

 gdb/amd64-linux-tdep.c  |  12 +-
 gdb/linux-tdep.c        | 295 +++++++++++++++++++++-------------------
 gdb/sparc64-tdep.c      |  15 +-
 gdb/target.c            |  11 +-
 gdb/target.h            |  98 +++++++++++--
 gdbsupport/array-view.h |  16 +++
 6 files changed, 278 insertions(+), 169 deletions(-)
  

Comments

Matthieu Longo Sept. 3, 2026, 10:58 p.m. UTC | #1
On 25/08/2026 11:09, Matthieu Longo wrote:
> Those patches were extracted from a previous patch series [1].
> Patches 1 and 2 are prerequisites to the next patches.
> Patch 3 introduces class file_reader_t, and patches 4, 5, and 5 migrates existing code to use this new class.
> 
> Already reviewed but pending on a maintainer's approval: 1, 3, 4, 5
> Pending on review and approval: 2
> Already reviewed and approved: 6
> 
> v1: https://inbox.sourceware.org/gdb-patches/20260728151700.253720-1-matthieu.longo@arm.com/
> Changes v1 -> v2:
> - in patch 3/6,
>   - amended the commit message as requested by Christina to mention the behavioral change.
>   - fix mistake in condition of adi_is_addr_mapped ()
>   - made move constructor, and move assignment operator of file_reader_t use =default.
>   - disabled copy constructor and copy assignment operator of file_reader_t.
> 
> Changes diff against [1]:
> - remove reimplementation of std::replace, and use std::replace for gdb::ranges::replace.
> - addressed comments from Christina Schimpe and Chirstina Joos regarding the interface of class file_reader_t.
> - fix the implementation of extract_string_view_from_buffer after Luis found bugs in the previous implementation.
> 
> This patch series depends on [2].
> 
> [1]: https://inbox.sourceware.org/gdb-patches/20260707154900.94542-1-matthieu.longo@arm.com/
> [2]: https://inbox.sourceware.org/gdb-patches/20260728143317.245389-1-matthieu.longo@arm.com/
> 
> Regards,
> Matthieu
> 
> 
> Matthieu Longo (6):
>   target_fileio_read_stralloc: add an optional length parameter
>   gdb support: add gdb::ranges::replace algorithm
>   gdb: introduce helper class file_reader_t
>   gdb/linux-tdep: migrate linux_info_proc to file_reader_t
>   gdb/linux-tdep: migrate linux_find_memory_regions_full to file_reader_t
>   gdb/linux-tdep: remove legacy parse_smaps_data overload
> 
>  gdb/amd64-linux-tdep.c  |  12 +-
>  gdb/linux-tdep.c        | 295 +++++++++++++++++++++-------------------
>  gdb/sparc64-tdep.c      |  15 +-
>  gdb/target.c            |  11 +-
>  gdb/target.h            |  98 +++++++++++--
>  gdbsupport/array-view.h |  16 +++
>  6 files changed, 278 insertions(+), 169 deletions(-)
> 

Ping
  
Matthieu Longo Sept. 8, 2026, 10:27 a.m. UTC | #2
On 25/08/2026 11:09, Matthieu Longo wrote:
> Those patches were extracted from a previous patch series [1].
> Patches 1 and 2 are prerequisites to the next patches.
> Patch 3 introduces class file_reader_t, and patches 4, 5, and 5 migrates existing code to use this new class.
> 
> Already reviewed but pending on a maintainer's approval: 1, 3, 4, 5
> Pending on review and approval: 2
> Already reviewed and approved: 6
> 
> v1: https://inbox.sourceware.org/gdb-patches/20260728151700.253720-1-matthieu.longo@arm.com/
> Changes v1 -> v2:
> - in patch 3/6,
>   - amended the commit message as requested by Christina to mention the behavioral change.
>   - fix mistake in condition of adi_is_addr_mapped ()
>   - made move constructor, and move assignment operator of file_reader_t use =default.
>   - disabled copy constructor and copy assignment operator of file_reader_t.
> 
> Changes diff against [1]:
> - remove reimplementation of std::replace, and use std::replace for gdb::ranges::replace.
> - addressed comments from Christina Schimpe and Chirstina Joos regarding the interface of class file_reader_t.
> - fix the implementation of extract_string_view_from_buffer after Luis found bugs in the previous implementation.
> 
> This patch series depends on [2].
> 
> [1]: https://inbox.sourceware.org/gdb-patches/20260707154900.94542-1-matthieu.longo@arm.com/
> [2]: https://inbox.sourceware.org/gdb-patches/20260728143317.245389-1-matthieu.longo@arm.com/
> 
> Regards,
> Matthieu
> 
> 
> Matthieu Longo (6):
>   target_fileio_read_stralloc: add an optional length parameter
>   gdb support: add gdb::ranges::replace algorithm
>   gdb: introduce helper class file_reader_t
>   gdb/linux-tdep: migrate linux_info_proc to file_reader_t
>   gdb/linux-tdep: migrate linux_find_memory_regions_full to file_reader_t
>   gdb/linux-tdep: remove legacy parse_smaps_data overload
> 
>  gdb/amd64-linux-tdep.c  |  12 +-
>  gdb/linux-tdep.c        | 295 +++++++++++++++++++++-------------------
>  gdb/sparc64-tdep.c      |  15 +-
>  gdb/target.c            |  11 +-
>  gdb/target.h            |  98 +++++++++++--
>  gdbsupport/array-view.h |  16 +++
>  6 files changed, 278 insertions(+), 169 deletions(-)
> 

Correction, this patch series depends on
https://inbox.sourceware.org/gdb-patches/20260824162155.467233-1-matthieu.longo@arm.com/
[2] was the old revision, I forgot to update the link.

Matthieu