]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/python: add Corefile.mapped_files method
authorAndrew Burgess <aburgess@redhat.com>
Mon, 25 Aug 2025 15:48:22 +0000 (16:48 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 6 Oct 2025 15:56:56 +0000 (16:56 +0100)
commitf69c1d03c4d6c68ae3f90facd63245426c028047
tree5a694587bed63fb239c618a283b8c64247e7fff8
parentfc8e5a565b3ae1b304dfb2de664b23722d97b794
gdb/python: add Corefile.mapped_files method

Add a new Corefile.mapped_files method which returns a list of
gdb.CorefileMappedFile objects.

Each gdb.CorefileMappedFile object represents a file that was mapped
into the process when the core file was created.

A gdb.CorefileMappedFile has attributes:

  + filename  -- A string, the name of the mapped file.
  + build_id -- A string or None, the build-id of the mapped file if
                GDB could find it (None if not).
  + is_main_executable -- A boolean, True if this mapping is the main
                          executable.
  + regions -- A list containing the regions of this file that were
               mapped into the process.

The 'regions' list is a list of gdb.CorefileMappedFileRegion objects,
each of these objects has the following attributes:

  + start -- the start address within the inferior.
  + end -- the end address within the inferior.
  + file_offset -- the offset within the mapped file for this mapping.

There are docs and tests.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32844

Approved-By: Tom Tromey <tom@tromey.com>
gdb/NEWS
gdb/doc/python.texi
gdb/python/py-corefile.c
gdb/testsuite/gdb.python/py-corefile.exp
gdb/testsuite/gdb.python/py-corefile.py [new file with mode: 0644]