Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Aditya Vidyadhar Kamath <akamath996@gmail.com>
Cc: ulrich.weigand@de.ibm.com,  simon.marchi@polymtl.ca,
	 tom@tromey.com, gdb-patches@sourceware.org,
	 Aditya.Kamath1@ibm.com, sangamesh.swamy@in.ibm.com
Subject: Re: [PATCH v2] Add support for recording minimal symbols in AIX for non DWARF compiled library function record.
Date: Fri, 20 Mar 2026 11:26:35 -0600	[thread overview]
Message-ID: <877br69zuc.fsf@tromey.com> (raw)
In-Reply-To: <20260320121637.91452-2-akamath996@gmail.com> (Aditya Vidyadhar Kamath's message of "Fri, 20 Mar 2026 17:46:38 +0530")

>>>>> Aditya Vidyadhar Kamath <akamath996@gmail.com> writes:

> This patch restores recording of minimal symbols in xcoffread.c, while keeping the removal of:
>  - STABS-based symtabs
>  - compunit_symtabs

Thanks for updating the patch.

I'm sorry I didn't notice / remember this before, but there is one more
change that should be made.

> +  bfd *abfd = objfile->obfd.get ();
> +  long do_we_need_storage = bfd_get_symtab_upper_bound (abfd);
> +
> +  if (do_we_need_storage <= 0)
> +    return;
> +
> +  gdb::unique_xmalloc_ptr<asymbol *> sym_table
> +    ((asymbol **) xmalloc (do_we_need_storage));
> +  /* Get the number of symbols we need.  */
> +  int number_of_symbols = bfd_canonicalize_symtab (abfd, sym_table.get());
> +
> +  /* Return on error.  */
> +  if (number_of_symbols < 0)
> +      return;

This code should be replaced with a call to gdb_bfd_canonicalize_symtab.
That was added to avoid some pathological behavior, see the comment in
gdb_bfd.h and/or the associated bug.

Since you don't want an error here you should pass 'false' for
should_throw.

I forgot about the existence of this earlier and only remembered it when
I was looking at something else...

thanks,
Tom

  reply	other threads:[~2026-03-20 18:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 12:16 Aditya Vidyadhar Kamath
2026-03-20 17:26 ` Tom Tromey [this message]
2026-03-23  4:40   ` Aditya Kamath

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=877br69zuc.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=Aditya.Kamath1@ibm.com \
    --cc=akamath996@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sangamesh.swamy@in.ibm.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=ulrich.weigand@de.ibm.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