Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Wei-min Pan <weimin.pan@oracle.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v4 2/2] gdb: CTF support
Date: Thu, 17 Oct 2019 21:18:00 -0000	[thread overview]
Message-ID: <feaa5785-6d73-9c74-0fa2-e905ddc7bad5@oracle.com> (raw)
In-Reply-To: <87v9spoj7w.fsf@tromey.com>

On 10/15/2019 1:18 PM, Tom Tromey wrote:
 >>>>>> 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.

Thanks for the explanation. It looks like that I will need to add
gcc/Makefile.def (dependencies): all-gdb depends on all-libctf.

 >
 >>> 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.

OK, will make the change.

 >
 >>> 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.

OK.

 >
 >>> 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... ?

You mean using SECT_OFF_TEXT to get the address?

Will send out the diffs as soon as I'm done with these changes.

Thanks again.


  reply	other threads:[~2019-10-17 21:18 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
2019-10-17 21:18         ` Wei-min Pan [this message]
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=feaa5785-6d73-9c74-0fa2-e905ddc7bad5@oracle.com \
    --to=weimin.pan@oracle.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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