From: Indu Bhagat <indu.bhagat@oracle.com>
To: Nick Clifton <nickc@redhat.com>, binutils@sourceware.org
Subject: Re: [PATCH,V6 06/10] bfd: linker: merge .ctf_frame sections
Date: Wed, 17 Aug 2022 19:11:54 -0700 [thread overview]
Message-ID: <73061799-cab9-e765-eeba-c21e27055e84@oracle.com> (raw)
In-Reply-To: <9ae415ef-997a-ac14-4bbf-1d0413b9d6a1@redhat.com>
On 8/15/22 06:02, Nick Clifton wrote:
> Hi Indu,
>
>
>> +ctf_frame_decoder_mark_func_deleted (struct ctf_frame_dec_info
>> *cfd_info,
>> + unsigned int func_idx)
>> +{
>> + BFD_ASSERT (func_idx < cfd_info->cfd_fde_count);
>> + cfd_info->cfd_func_bfdinfo[func_idx].func_deleted_p = true;
>
> Just for the record, I am not a fan of assertions inside library
> functions.
> I believe that libraries should let their users decide what to do when
> there
> is a problem, rather than unilaterally calling abort. (The better
> approach
> in my opinion is to return an informative error message to the caller).
>
> That said there are plenty of other places in the BFD library where
> assertions
> are used, so I am not going to complain about this. I just wanted to
> make
> sure that you knew of my feelings on this issue.
>
>
Noted. I will work out something here.
>
>> +/* Try to parse .ctf_frame section SEC, which belongs to ABFD.
>> Store the
>> + information in the section's sec_info field on success. COOKIE
>> + describes the relocations in SEC. */
>> +
>> +void
>> +_bfd_elf_parse_ctf_frame (bfd *abfd, struct bfd_link_info *info,
>> + asection *sec, struct elf_reloc_cookie *cookie)
>
> It seems to me that this function really ought to return a bool,
> indicating success or failure.
>
I will change it to return success/failure.
>
>> + /* Read the ctf frame unwind information from abfd. */
>> + if (!bfd_malloc_and_get_section (abfd, sec, &ctfbuf))
>> + goto fail_no_free;
>
> The name of this label seems rather ironic, given that ...
>
>> +fail_no_free:
>> + _bfd_error_handler
>> + (_("error in %pB(%pA); no .ctf_frame will be created"),
>> + abfd, sec);
>> +success:
>> + free (ctfbuf);
>
> ... it falls through into the free().
>
Oops! I will change this.
>
> Cheers
> Nick
>
next prev parent reply other threads:[~2022-08-18 2:12 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-02 8:04 [PATCH,V6 00/10] Definition and Implementation of CTF Frame format Indu Bhagat
2022-08-02 8:04 ` [PATCH,V6 01/10] ctf-frame.h: Add CTF Frame format definition Indu Bhagat
2022-08-15 12:04 ` Nick Clifton
2022-08-02 8:04 ` [PATCH,V6 02/10] gas: add new command line option --gctf-frame Indu Bhagat
2022-08-15 12:07 ` Nick Clifton
2022-08-02 8:04 ` [PATCH,V6 03/10] gas: generate .ctf_frame Indu Bhagat
2022-08-15 12:22 ` Nick Clifton
2022-08-02 8:04 ` [PATCH,V6 04/10] libctfframe: add the CTF Frame library Indu Bhagat
2022-08-15 12:46 ` Nick Clifton
2022-08-02 8:04 ` [PATCH,V6 05/10] libctfframe: add GNU poke pickles for CTF Frame Indu Bhagat
2022-08-15 12:50 ` Nick Clifton
2022-08-02 8:04 ` [PATCH,V6 06/10] bfd: linker: merge .ctf_frame sections Indu Bhagat
2022-08-15 13:02 ` Nick Clifton
2022-08-18 2:11 ` Indu Bhagat [this message]
2022-08-02 8:04 ` [PATCH,V6 07/10] readelf/objdump: support for CTF Frame section Indu Bhagat
2022-08-15 13:11 ` Nick Clifton
2022-08-02 8:04 ` [PATCH,V6 08/10] unwinder: generate backtrace using CTF Frame format Indu Bhagat
2022-08-15 13:16 ` Nick Clifton
2022-08-02 8:04 ` [PATCH,V6 09/10] unwinder: Add CTF Frame unwinder tests Indu Bhagat
2022-08-15 13:27 ` Nick Clifton
2022-08-02 8:04 ` [PATCH, V6 10/10] gdb: sim: buildsystem changes to accommodate libctfframe Indu Bhagat
2022-08-05 14:43 ` Tom Tromey
2022-08-15 12:18 ` [PATCH,V6 00/10] Definition and Implementation of CTF Frame format Nick Clifton
2022-08-18 1:38 ` Indu Bhagat
2022-08-15 14:25 ` Nick Clifton
2022-09-30 0:04 ` [PATCH,V1 00/14] Definition and support for SFrame unwind format Indu Bhagat
2022-09-30 0:04 ` [PATCH,V1 01/14] sframe.h: Add SFrame format definition Indu Bhagat
2022-09-30 0:04 ` [PATCH,V1 02/14] gas: add new command line option --gsframe Indu Bhagat
2022-09-30 0:04 ` [PATCH,V1 03/14] gas: generate .sframe from CFI directives Indu Bhagat
2022-09-30 0:04 ` [PATCH,V1 04/14] gas: testsuite: add new tests for SFrame unwind info Indu Bhagat
2022-09-30 0:04 ` [PATCH,V1 05/14] libsframe: add the SFrame library Indu Bhagat
2022-09-30 0:04 ` [PATCH,V1 06/14] bfd: linker: merge .sframe sections Indu Bhagat
2022-09-30 10:51 ` Nick Clifton
2022-09-30 0:04 ` [PATCH,V1 07/14] readelf/objdump: support for SFrame section Indu Bhagat
2022-09-30 11:08 ` Nick Clifton
2022-09-30 0:04 ` [PATCH,V1 08/14] unwinder: generate backtrace using SFrame format Indu Bhagat
2022-09-30 0:04 ` [PATCH,V1 09/14] unwinder: Add SFrame unwinder tests Indu Bhagat
2022-09-30 0:04 ` [PATCH,V1 10/14] gdb: sim: buildsystem changes to accommodate libsframe Indu Bhagat
2022-10-11 16:08 ` [PATCH, V1 " Tom Tromey
2022-09-30 0:04 ` [PATCH,V1 11/14] libctf: add libsframe to LDFLAGS and LIBS Indu Bhagat
2022-09-30 0:04 ` [PATCH,V1 12/14] src-release.sh: Add libsframe Indu Bhagat
2022-09-30 0:04 ` [PATCH,V1 13/14] binutils/NEWS: add text for SFrame support Indu Bhagat
2022-09-30 0:04 ` [PATCH,V1 14/14] gas/NEWS: add text about new command line option and " Indu Bhagat
2022-09-30 8:09 ` [PATCH,V1 00/14] Definition and support for SFrame unwind format Jan Beulich
2022-10-04 5:16 ` Indu Bhagat
2022-10-04 6:53 ` Jan Beulich
2022-09-30 8:24 ` Fangrui Song
2022-10-01 0:15 ` Indu Bhagat
2022-09-30 9:12 ` Nick Clifton
2022-10-01 0:29 ` Indu Bhagat
2022-10-01 9:51 ` Jose E. Marchesi
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=73061799-cab9-e765-eeba-c21e27055e84@oracle.com \
--to=indu.bhagat@oracle.com \
--cc=binutils@sourceware.org \
--cc=nickc@redhat.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).