Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Wei-min Pan <weimin.pan@oracle.com>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: CTF support
Date: Thu, 25 Jul 2019 12:43:00 -0000	[thread overview]
Message-ID: <87o91ithd9.fsf@tromey.com> (raw)
In-Reply-To: <e864e22a-06e8-ea08-f8e3-4568a63a450f@oracle.com> (Wei-min Pan's	message of "Wed, 24 Jul 2019 16:50:47 -0700")

>>>>> ">" == Wei-min Pan <weimin.pan@oracle.com> writes:

Tom> dependencies = { module=all-binutils; on=all-libctf; };

>> There are more libctf changes in both Makefile.def and Makefile.in.
>> Please see commit 0e65dfbaf3a0299e4837216a103c28625d4b4f1d which
>> should address your concern?

That commit adds the dependency of binutils on libctf.  But, if gdb is
going to use libctf, then another one is needed for gdb.  Otherwise, I
think nothing ensures that libctf will be built before gdb.

>> >> +#include <include/ctf.h>

Tom> Probably just "ctf.h" here?  The top-level include directory is already
Tom> on the include path.

>> There is already a gdb/ctf.h for tracing?

Aha, thanks for pointing that out.  In this case I think it would be
better to rename gdb/ctf.h to something else.

Tom> There's a type-safe registry API now.  I would prefer that for new
Tom> code.

>> Where can I get more info on this API?

I thought I'd written a comment in registry.h, but I see I did not.

The registry generates a template class named "TAG_key"; e.g. for the
objfile registry it is called objfile_key.  You create your registry key
using they type you plan to store.  So, from arm-tdep.c:

    static objfile_key<arm_per_objfile> arm_objfile_data_key;

If you use new/delete to manage the object that you store, then the
above is enough.  For the htab case, see elfread.c:

    static const struct objfile_key<htab, htab_deleter>
      elf_objfile_gnu_ifunc_cache_data;

The key has several methods, like "get" (to get the object), and "set"
(to set the object).  If you're using plain new/delete, it will have an
"emplace" method that you can use to create a new object.

>> It's needed only when creating psymtabs and expanding symbols. BTW I
>> borrowed this idea from dwarf2read.c. So you recommend that I use
>> xcalloc/xfree instead?

Yes.

Tom


  reply	other threads:[~2019-07-25 12:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 23:57 Weimin Pan
2019-07-24 19:56 ` Tom Tromey
2019-07-24 23:50   ` Wei-min Pan
2019-07-25 12:43     ` Tom Tromey [this message]
2019-07-26  0:13       ` Wei-min Pan
2019-07-26  2:09         ` Tom Tromey

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=87o91ithd9.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=weimin.pan@oracle.com \
    /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