Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Vrany <jan.vrany@labware.com>
To: gdb-patches@sourceware.org
Cc: Jan Vrany <jan.vrany@labware.com>
Subject: [RFC v5 00/19] Add Python "JIT" API
Date: Mon, 23 Jun 2025 17:09:55 +0100	[thread overview]
Message-ID: <20250623161013.650814-1-jan.vrany@labware.com> (raw)

Hello,

I'm very sorry for the delay, I've been swamped with other work for last
couple months.

This is a v5 of RFC series that extends GDB's Python API to allow
interfacing with JIT compilers in Python.

The v1 submission is here:

   https://inbox.sourceware.org/gdb-patches/20241111145522.560028-1-jan.vrany@labware.com/

The v2 submission is here:

   https://inbox.sourceware.org/gdb-patches/20241121124714.419946-1-jan.vrany@labware.com/

The v3 submission is here:

   https://inbox.sourceware.org/gdb-patches/20250129124347.1391900-1-jan.vrany@labware.com/

The v4 submission is here:

   https://inbox.sourceware.org/gdb-patches/20250205161018.2028175-1-jan.vrany@labware.com/

Changes in v5:

  * Move ranges_overlap utility to its own file (gdbsupport/range.h)

  * Delegate compunit_symtab::maybe_contains to blockvector::maybe_contains.

  * Reworked commit

      gdb/python: add function () method to gdb.Type object

    so that non-arch owned types are first copied to arch and then used.
    This way, we do not need to expose internal implementation detail to the
    user as Tom pointed out. This also means that commit

      gdb/python: add owner property to gdb.Type

    is no longer needed and has been dropped from this version.

    See https://inbox.sourceware.org/gdb-patches/20250227222931.1404787-1-jan.vrany@labware.com/

  * Dropped commits

      gdb/python: add template function to implement equality comparison
      gdb/python: make gdb.Symbol comparable for equality
      gdb/python: make gdb.Symtab comparable for equality

    They are no longer needed because recent change that made these objects
    memoized.

    See https://inbox.sourceware.org/gdb-patches/20250319212212.490510-7-jan.vrany@labware.com/
        https://inbox.sourceware.org/gdb-patches/20250319212212.490510-9-jan.vrany@labware.com/


Thanks,

Jan

---
Jan Vrany (18):
  gdb: introduce expand_symtabs_maybe_overlapping
  gdb: introduce compunit_symtab::maybe_contains
  gdb: update is_addr_in_objfile to support "dynamic" objfiles
  gdb: introduce new function create_function_type
  gdb/python: add function () method to gdb.Type object
  gdb: use std::vector<> to hold on blocks in struct blockvector
  gdb/python: add gdb.Compunit
  gdb/python: allow instantiation of gdb.Objfile from Python
  gdb/python: add unlink () method to gdb.Objfile object
  gdb/python: allow instantiation of gdb.Compunit from Python
  gdb/python: allow instantiation of gdb.Symtab from Python
  gdb/python: allow instantiation of gdb.Block from Python
  gdb/python: allow instantiation of gdb.Symbol from Python
  gdb/python: add add_symbol () method to gdb.Block
  gdb/python: add more attributes to gdb.LinetableEntry objects
  gdb/python: allow instantiation of gdb.LineTableEntry objects
  gdb/python: allow instantiation of gdb.LineTable objects
  gdb/python: add section in documentation on implementing JIT interface

 gdb/Makefile.in                           |   1 +
 gdb/NEWS                                  |   9 +
 gdb/block.c                               |  82 +++++
 gdb/block.h                               |  69 +++-
 gdb/buildsym.c                            |   6 +-
 gdb/doc/gdb.texinfo                       |   3 +-
 gdb/doc/python.texi                       | 317 +++++++++++++++++
 gdb/dwarf2/cooked-index.h                 |  11 +
 gdb/dwarf2/read.c                         |  11 +
 gdb/dwarf2/read.h                         |   3 +
 gdb/gdbtypes.c                            |  67 +++-
 gdb/gdbtypes.h                            |  30 +-
 gdb/jit.c                                 |   8 +-
 gdb/mdebugread.c                          |  32 +-
 gdb/objfiles.c                            |  34 ++
 gdb/objfiles.h                            |  14 +
 gdb/psymtab.c                             |  21 ++
 gdb/psymtab.h                             |   3 +
 gdb/python/py-block.c                     | 165 ++++++++-
 gdb/python/py-compunit.c                  | 411 ++++++++++++++++++++++
 gdb/python/py-inferior.c                  |  10 +
 gdb/python/py-linetable.c                 | 243 ++++++++++++-
 gdb/python/py-objfile.c                   | 172 ++++++++-
 gdb/python/py-symbol.c                    | 139 +++++++-
 gdb/python/py-symtab.c                    |  67 +++-
 gdb/python/py-type.c                      | 132 +++++++
 gdb/python/python-internal.h              |   5 +
 gdb/quick-symbol.h                        |   5 +
 gdb/symfile-debug.c                       |  16 +
 gdb/symtab.c                              |  90 ++++-
 gdb/symtab.h                              |  10 +
 gdb/testsuite/gdb.base/jit-reader.exp     |   9 +
 gdb/testsuite/gdb.python/py-block.exp     |  45 +++
 gdb/testsuite/gdb.python/py-compunit-1.c  |  24 ++
 gdb/testsuite/gdb.python/py-compunit-2.c  |  28 ++
 gdb/testsuite/gdb.python/py-compunit.exp  | 130 +++++++
 gdb/testsuite/gdb.python/py-compunit.link |  10 +
 gdb/testsuite/gdb.python/py-jit.c         |  61 ++++
 gdb/testsuite/gdb.python/py-jit.exp       |  57 +++
 gdb/testsuite/gdb.python/py-jit.py        | 118 +++++++
 gdb/testsuite/gdb.python/py-linetable.exp |  67 +++-
 gdb/testsuite/gdb.python/py-objfile.exp   |  50 ++-
 gdb/testsuite/gdb.python/py-symbol.exp    |  13 +
 gdb/testsuite/gdb.python/py-symtab.exp    |  22 ++
 gdb/testsuite/gdb.python/py-type.exp      |  36 ++
 gdbsupport/gdb_obstack.h                  |  52 +++
 gdbsupport/range.h                        |  35 ++
 47 files changed, 2822 insertions(+), 121 deletions(-)
 create mode 100644 gdb/python/py-compunit.c
 create mode 100644 gdb/testsuite/gdb.python/py-compunit-1.c
 create mode 100644 gdb/testsuite/gdb.python/py-compunit-2.c
 create mode 100644 gdb/testsuite/gdb.python/py-compunit.exp
 create mode 100644 gdb/testsuite/gdb.python/py-compunit.link
 create mode 100644 gdb/testsuite/gdb.python/py-jit.c
 create mode 100644 gdb/testsuite/gdb.python/py-jit.exp
 create mode 100644 gdb/testsuite/gdb.python/py-jit.py
 create mode 100644 gdbsupport/range.h

-- 
2.47.2


             reply	other threads:[~2025-06-23 16:11 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23 16:09 Jan Vrany [this message]
2025-06-23 16:09 ` [RFC v5 01/18] gdb: introduce expand_symtabs_maybe_overlapping Jan Vrany
2025-06-24 15:22   ` Tom Tromey
2025-06-26 15:05     ` Jan Vraný
2025-06-23 16:09 ` [RFC v5 02/18] gdb: introduce compunit_symtab::maybe_contains Jan Vrany
2025-06-23 16:09 ` [RFC v5 03/18] gdb: update is_addr_in_objfile to support "dynamic" objfiles Jan Vrany
2025-06-23 16:09 ` [RFC v5 04/18] gdb: introduce new function create_function_type Jan Vrany
2025-06-24 15:29   ` Tom Tromey
2025-06-26 11:12     ` Jan Vraný
2025-06-27 14:21       ` Tom Tromey
2025-06-27 14:30         ` Jan Vraný
2025-06-23 16:10 ` [RFC v5 05/18] gdb/python: add function () method to gdb.Type object Jan Vrany
2025-06-24 16:11   ` Tom Tromey
2025-06-26 11:13     ` Jan Vraný
2025-06-23 16:10 ` [RFC v5 06/18] gdb: use std::vector<> to hold on blocks in struct blockvector Jan Vrany
2025-06-23 16:10 ` [RFC v5 07/18] gdb/python: add gdb.Compunit Jan Vrany
2025-06-23 16:10 ` [RFC v5 08/18] gdb/python: allow instantiation of gdb.Objfile from Python Jan Vrany
2025-06-23 16:10 ` [RFC v5 09/18] gdb/python: add unlink () method to gdb.Objfile object Jan Vrany
2025-06-23 16:10 ` [RFC v5 10/18] gdb/python: allow instantiation of gdb.Compunit from Python Jan Vrany
2025-06-23 16:10 ` [RFC v5 11/18] gdb/python: allow instantiation of gdb.Symtab " Jan Vrany
2025-06-23 16:10 ` [RFC v5 12/18] gdb/python: allow instantiation of gdb.Block " Jan Vrany
2025-06-23 16:10 ` [RFC v5 13/18] gdb/python: allow instantiation of gdb.Symbol " Jan Vrany
2025-06-23 16:10 ` [RFC v5 14/18] gdb/python: add add_symbol () method to gdb.Block Jan Vrany
2025-08-29 14:10   ` Andrew Burgess
2025-08-29 14:14     ` Andrew Burgess
2025-06-23 16:10 ` [RFC v5 15/18] gdb/python: add more attributes to gdb.LinetableEntry objects Jan Vrany
2025-08-29 14:00   ` Andrew Burgess
2025-09-02 11:03     ` Jan Vraný
2025-06-23 16:10 ` [RFC v5 16/18] gdb/python: allow instantiation of gdb.LineTableEntry objects Jan Vrany
2025-06-23 16:10 ` [RFC v5 17/18] gdb/python: allow instantiation of gdb.LineTable objects Jan Vrany
2025-06-23 16:10 ` [RFC v5 18/18] gdb/python: add section in documentation on implementing JIT interface Jan Vrany

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=20250623161013.650814-1-jan.vrany@labware.com \
    --to=jan.vrany@labware.com \
    --cc=gdb-patches@sourceware.org \
    /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