Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v4 0/5] gdb: introduce file_reader_t to read procfs files
@ 2026-11-16 12:09 Matthieu Longo
  2026-11-16 12:09 ` [PATCH v4 1/5] gdbsupport: add extract_next_field helper Matthieu Longo
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Matthieu Longo @ 2026-11-16 12:09 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey, Matthieu Longo

This series introduces target_file_reader, a helper class for reading target files, and migrates existing /proc file handling to use it. It also refactors the /proc mapping parser to operate on bounded views rather than NUL-terminated strings.

The series is organized as follows:
- Patch 1 adds extract_next_field, a helper for extracting separator-delimited views from a buffer.
- Patch 2 refactors /proc mapping parsing to use gdb::array_view<char> and extract_view_from_buffer, removing the dependency on NUL-terminated strings and strtok_r.
- Patch 3 introduces target_file_reader, which encapsulates the contents and path of a target file and provides convenient accessors and typed views.
- Patches 4 and 5 migrate existing procfs parsing to target_file_reader and remove the now-obsolete parse_smaps_data interface.

== Note ==
Patch 5 is already approved.

== Changes since v3 ==

v3: https://inbox.sourceware.org/gdb-patches/20260922135050.236941-1-matthieu.longo@arm.com/
- Moved extract_next_field to a new header gdbsupport/extract-field.h
- Addressed minor issues pointed by Tom.

Regards,
Matthieu

Matthieu Longo (5):
  gdbsupport: add extract_next_field helper
  gdb/linux: refactor /proc mapping parsing to use array_view
  gdb: introduce helper class target_file_reader
  gdb/linux-tdep: use target_file_reader for procfs parsing
  gdb/linux-tdep: remove legacy parse_smaps_data overload

 gdb/Makefile.in                         |   1 +
 gdb/amd64-linux-tdep.c                  |  12 +-
 gdb/linux-tdep.c                        | 395 ++++++++++++------------
 gdb/sparc64-tdep.c                      |  17 +-
 gdb/target.h                            | 115 +++++++
 gdb/unittests/extract-field-selftests.c |  74 +++++
 gdbsupport/extract-field.h              |  77 +++++
 7 files changed, 487 insertions(+), 204 deletions(-)
 create mode 100644 gdb/unittests/extract-field-selftests.c
 create mode 100644 gdbsupport/extract-field.h

-- 
2.56.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-16 12:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 12:09 [PATCH v4 0/5] gdb: introduce file_reader_t to read procfs files Matthieu Longo
2026-11-16 12:09 ` [PATCH v4 1/5] gdbsupport: add extract_next_field helper Matthieu Longo
2026-11-16 12:09 ` [PATCH v4 2/5] gdb/linux: refactor /proc mapping parsing to use array_view Matthieu Longo
2026-11-16 12:09 ` [PATCH v4 3/5] gdb: introduce helper class target_file_reader Matthieu Longo
2026-11-16 12:09 ` [PATCH v4 4/5] gdb/linux-tdep: use target_file_reader for procfs parsing Matthieu Longo
2026-11-16 12:09 ` [PATCH v4 5/5] gdb/linux-tdep: remove legacy parse_smaps_data overload Matthieu Longo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox