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 v4 2/2] gdb: CTF support
Date: Tue, 15 Oct 2019 20:19:00 -0000	[thread overview]
Message-ID: <87v9spoj7w.fsf@tromey.com> (raw)
In-Reply-To: <c2945300-1556-d273-eeb5-bec7ca9dc0e4@oracle.com> (Wei-min Pan's	message of "Thu, 10 Oct 2019 12:05:44 -0700")

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

>> I didn't look, did the top-level changes go in to gcc?
>> The top-level configury code is canonically maintained there.

> Given the following rules in Makefile.def:

> dependencies = { module=configure-gcc; on=all-binutils; };
> dependencies = { module=all-binutils; on=all-libctf; };
> dependencies = { module=all-gdb; on=all-libctf; };

> binutils gets built before gcc does. It's not clear why making changes
> into gcc is needed?

Sorry, I was not clear enough.

Most top-level files, like Makefile.def, are shared between gcc and
gdb+binutils.  However, gcc and gdb have different source repositories.
In order to reduce the possibility of long-term divergence, the gcc
repository was declared the canonical repository -- in general (there
are exceptions) -- changes are checked in first there, then brought over
to the gdb repository.

My question was whether you did this.

>> It's preferable to use the type-safe registry approach in new code.

> This register key was not intended to manage the object with new/delete
> but to be used to close file descriptors that are associated with the
> ctf file/archive.

It's still preferable to use the type-safe approach.  You can easily
introduce a new deleter object that works just as you like.  In fact the
code will nearly be identical -- just type-safe.

>> gdb doesn't generally use typedefs like this, especially now that it's
>> in C++.

> It seems there are several places, e.g. aarch64-tdep.c, event-loop.c,
> linespec.c, procfs.c, that do. We can drop "typedef" if you prefer.

Yes, I'm afraid you can't always judge the current standard in gdb by
the existing code, because the transition from C to C++ did not also
involve updating every single thing -- just the important things.

>> Instead of this function, it's more usual in gdb to use:
>> 
>>        CORE_ADDR baseaddr
>>        = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
>> 
>> Maybe this function is even wrong in some situation, I'm not sure.

> You suspect that bfd_get_section_by_name might return a wrong *asection?
> Yes, we can use ANOFFSET, as you suggested, for the text base but still
> need to get the size of the text section.

I'm not sure if it can or not.  Anyway it seems you can use
SECT_OFF_TEXT to also get the size... ?

thanks,
Tom


  reply	other threads:[~2019-10-15 20:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 20:25 [PATCH v4 1/2] Renaming of ctf (the trace format) files Weimin Pan
2019-10-04 20:24 ` [PATCH v4 2/2] gdb: CTF support Weimin Pan
2019-10-07 14:40   ` Simon Marchi
2019-10-07 16:00     ` Wei-min Pan
     [not found]   ` <87ftk1erzn.fsf@tromey.com>
2019-10-10 19:05     ` Wei-min Pan
2019-10-15 20:19       ` Tom Tromey [this message]
2019-10-17 21:18         ` Wei-min Pan
2019-10-18 20:36           ` 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=87v9spoj7w.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