public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Weimin Pan <weimin.pan@oracle.com>
To: Lancelot SIX <lsix@lancelotsix.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH,V2 5/5] CTF: multi-CU and archive support
Date: Wed, 3 Mar 2021 10:31:06 -0800	[thread overview]
Message-ID: <9c83da80-a3fd-d48e-1f39-9ed4d6fbd2ba@oracle.com> (raw)
In-Reply-To: <YD/JbQz7QEmMYqJB@Plymouth>


On 3/3/2021 9:37 AM, Lancelot SIX wrote:
>>>> +static int
>>>> +build_ctf_archive_member (ctf_dict_t *ctf, const char *name, void *arg)
>>> I do not see the advantage of having arg passed as a void *.  It is
>>> casted unconditionally to a struct ctf_per_tu_data * and dereferenced
>>> just after that.
>>>
>>> Why not just pass the argument as a struct ctf_per_tu_data * directly?
>> build_ctf_archive_member is the callback function of ctf_archive_iter and is
>> of
>> type ctf_member_f which is defined in ctf-api.h:
>>
>> typedef int ctf_member_f (const char *name, ctf_id_t membtype,
>>                            unsigned long offset, void *arg);
>>
>> and the last argument "pcu" of type struct ctf_per_tu_data * is being passed
>> in call:
>>
>>          if (ctf_archive_iter (arc, build_ctf_archive_member, &pcu) < 0)
>>
>> The conversion is necessary.
>>
> Indeed. I went too fast when reading where this function is used. Sorry
> for the noise.

No problem. I really appreciate your comments.

> Thanks,
> Lancelot.

  reply	other threads:[~2021-03-03 18:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02  1:53 [PATCH,V2 0/5] CTF: bug fixes and new features Weimin Pan
2021-03-02  1:53 ` [PATCH,V2 1/5] CTF: fix incorrect function return type Weimin Pan
2021-03-02  1:53   ` [PATCH,V2 2/5] CTF: set up debug info for function arguments Weimin Pan
2021-03-02  1:53     ` [PATCH,V2 3/5] CTF: handle forward reference type Weimin Pan
2021-03-02  1:53       ` [PATCH,V2 4/5] CTF: add all members of an enum type to psymtab Weimin Pan
2021-03-02  1:53         ` [PATCH,V2 5/5] CTF: multi-CU and archive support Weimin Pan
2021-03-02 23:15           ` Lancelot SIX
2021-03-03  1:01             ` Wei-min Pan
2021-03-03 17:37               ` Lancelot SIX
2021-03-03 18:31                 ` Weimin Pan [this message]
2021-03-03 20:46         ` [PATCH,V2 4/5] CTF: add all members of an enum type to psymtab Tom Tromey
2021-03-03 22:27           ` Wei-min Pan
2021-03-03 20:49       ` [PATCH,V2 3/5] CTF: handle forward reference type Tom Tromey
2021-03-03 22:01         ` Wei-min Pan
2021-03-02 12:23     ` [PATCH,V2 2/5] CTF: set up debug info for function arguments Lancelot SIX
2021-03-02 18:12       ` Wei-min Pan
2021-03-03 20:38       ` Tom Tromey
2021-03-03 21:58         ` Wei-min Pan
2021-03-03 20:41     ` Tom Tromey
2021-03-03 20:37   ` [PATCH,V2 1/5] CTF: fix incorrect function return type Tom Tromey
2021-03-03 21:57     ` Wei-min Pan

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=9c83da80-a3fd-d48e-1f39-9ed4d6fbd2ba@oracle.com \
    --to=weimin.pan@oracle.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).