public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Aktemur, Tankut Baris" <tankut.baris.aktemur@intel.com>
To: Simon Marchi <simark@simark.ca>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v2 3/3] gdb/jit: enable tracking multiple jitter objfiles
Date: Mon, 22 Jun 2020 16:52:13 +0000	[thread overview]
Message-ID: <SN6PR11MB2893DD89A3288001C3733225C4970@SN6PR11MB2893.namprd11.prod.outlook.com> (raw)
In-Reply-To: <40e500a7-81ab-280a-1e40-d737d9aeb93f@simark.ca>

Hi Simon,

On Sunday, June 21, 2020 5:33 AM, Simon Marchi wrote:
> On 2020-06-16 5:49 a.m., Tankut Baris Aktemur wrote:
> >        objf_data = get_jit_objfile_data (reg_symbol.objfile);
> >        objf_data->register_code = reg_symbol.minsym;
> >        objf_data->descriptor = desc_symbol.minsym;
> 
> This made me realize that we now have per-JITer-objfile information in both
> jit_objfile_data and the new jiter_and_bp structure.  I think it would be more
> consistent to bring it all in one of them.
> 
> I see two way forward:
> 
> 1. Move register_code and descriptor from jit_objfile_data to jiter_and_bp.
>    jiter_and_bp becomes the source of truth for information about JITer
>    objfiles.  jit_objfile_data would only be used to decribe JITed objfiles.
> 2. Move the content of jiter_and_bp to jit_objfile_data.
>    If we still think it's useful to have a list of JITer objfiles,
>    jit_program_space_data::jiter_and_bps would become a list of objfiles
>    known to be JITers:
> 
>      /* Objfiles in this program space that define the JIT interface symbols.  */
>      std::forward_list<objfile *> jiters;
> 
> I would prefer #2, because using registries is kind of our standard way to keep
> per-stuff data (where stuff is objfile, program_space, inferior, etc).
> 
> And instead of having the "jiters" list, when we want to iterate on jiters, maybe
> we can just iterate on progspace->objfiles () and check those objfiles whose
> jit_objfile_data indicate they are JITers.  The tradeoff is: it's a bit less
> efficient, but the code is simpler (one less list to maintain, that is possibly
> out of sync).  If the operations that require iterating on the existing JITers are
> not on some hot path, it should be fine.
> 
> While digging into this, there are two improvements I'd make (orthogonal to this
> patch):
> 
> - Make jit.c use the newer / type-safe / c++-friendly objfile_key instead of objfile_data.
> - Split jit_objfile_data in two: one type for the JITers and one type for the JITed.  Even
>   today, it is used for both, and that's kind of confusing.
> 
> I ended up trying all of this to make sure it made sense, instead of just throwing ideas
> out there, so I took the time to make a "clean" branch.  See here:
> 
>   https://github.com/simark/binutils-gdb/tree/multiple-jiters
> 
> Please tell me what you think about this.  If you agree with the direction, I could
> officially post it to the list.

I looked at the patches.  It leads to a much wider cleanup.  Thank you.
This direction makes sense to me.

-Baris


Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

  parent reply	other threads:[~2020-06-22 16:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16  9:49 [PATCH v2 0/3] Handling multiple JITers Tankut Baris Aktemur
2020-06-16  9:49 ` [PATCH v2 1/3] gdb/jit: pass the jiter objfile as an argument to jit_event_handler Tankut Baris Aktemur
2020-06-16  9:49 ` [PATCH v2 2/3] gdb/jit: return bool in jit_breakpoint_re_set_internal and jit_read_descriptor Tankut Baris Aktemur
2020-06-21  3:43   ` Simon Marchi
2020-06-22 12:05     ` Aktemur, Tankut Baris
2020-06-16  9:49 ` [PATCH v2 3/3] gdb/jit: enable tracking multiple jitter objfiles Tankut Baris Aktemur
2020-06-21  3:32   ` Simon Marchi
2020-06-22 16:28     ` Pedro Alves
2020-06-22 16:39       ` Simon Marchi
2020-06-22 16:53         ` Aktemur, Tankut Baris
2020-06-22 17:00           ` Simon Marchi
2020-06-23  8:16             ` Aktemur, Tankut Baris
2020-06-22 16:53         ` Pedro Alves
2020-06-22 16:52     ` Aktemur, Tankut Baris [this message]
2020-06-30  8:17     ` Aktemur, Tankut Baris
2020-07-03  2:19       ` Simon Marchi
2020-07-03  7:29         ` Aktemur, Tankut Baris

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=SN6PR11MB2893DD89A3288001C3733225C4970@SN6PR11MB2893.namprd11.prod.outlook.com \
    --to=tankut.baris.aktemur@intel.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).