public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Kévin Le Gouguec" <legouguec@adacore.com>
To: gdb-patches@sourceware.org
Cc: simark@simark.ca, "Kévin Le Gouguec" <legouguec@adacore.com>
Subject: [PATCH v2 0/3] Fix Ada tasking for baremetal targets using Ravenscar threads
Date: Fri, 27 Jan 2023 17:53:34 +0100	[thread overview]
Message-ID: <20230127165337.1832937-1-legouguec@adacore.com> (raw)
In-Reply-To: <87tu0ugxt7.fsf@adacore.com>

Changes since v1:

* New patch to add a header for functions defined in ada-tasks.c.
* New patch to expose a getter for ada_tasks_pspace_data.
* Tweak original patch to use that getter from ravenscar-thread.c.

This ensures we do not introduce a function that refers to global
state; instead, we let ada_get_runtime_cpu_index's caller get its
hands "dirty".


I considered exposing ada_tasks_pspace_data entirely and making
ada_get_runtime_cpu_index a method as discussed, but AFAIU this would
have required either

  (a) keeping all members of that struct public so that existing
  functions can keep accessing them,

  (b) ponder which members ought to remain public, which should not,
  and which portions of ada-tasks.c should be turned into methods for
  ada_tasks_pspace_data.

(a) does not sound like progress in terms of encapsulation; I am not
confident I can get (b) done soon.  Hence the opaque pointer as a
first step toward (b).

Will stay on the lookout for opportunities to refactor uses of that
struct into "method-like" functions, make members private when it
makes sense, and finally, expose the struct definition, turning the
"method-like" functions into methods.


Tried to follow the coding conventions re. #include strategies;
apologies if I've missed something there, or anywhere else.


Kévin Le Gouguec (3):
  gdb: Introduce ada-tasks.h for functions defined in ada-tasks.c
  gdb/ada-tasks: Make the ada_tasks_pspace_data getter public
  gdb: Fix Ada tasking for baremetal targets using Ravenscar threads

 gdb/ada-lang.h             | 25 +++--------
 gdb/ada-tasks.c            | 44 +++++++++---------
 gdb/ada-tasks.h            | 91 ++++++++++++++++++++++++++++++++++++++
 gdb/breakpoint.c           |  1 +
 gdb/guile/scm-breakpoint.c |  2 +-
 gdb/mi/mi-main.c           |  2 +-
 gdb/python/py-breakpoint.c |  2 +-
 gdb/ravenscar-thread.c     | 17 +++++--
 8 files changed, 134 insertions(+), 50 deletions(-)
 create mode 100644 gdb/ada-tasks.h

-- 
2.25.1


  reply	other threads:[~2023-01-27 16:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 17:10 [PATCH] " Kévin Le Gouguec
2023-01-12 18:19 ` Simon Marchi
2023-01-13 12:32   ` Kévin Le Gouguec
2023-01-13 16:29     ` Simon Marchi
2023-01-13 17:16       ` Kévin Le Gouguec
2023-01-27 16:53         ` Kévin Le Gouguec [this message]
2023-01-27 16:53           ` [PATCH v2 1/3] gdb: Introduce ada-tasks.h for functions defined in ada-tasks.c Kévin Le Gouguec
2023-01-27 16:53           ` [PATCH v2 2/3] gdb/ada-tasks: Make the ada_tasks_pspace_data getter public Kévin Le Gouguec
2023-01-27 16:53           ` [PATCH v2 3/3] gdb: Fix Ada tasking for baremetal targets using Ravenscar threads Kévin Le Gouguec

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=20230127165337.1832937-1-legouguec@adacore.com \
    --to=legouguec@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).