This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] hpread.c cleanups
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 1 Mar 2006 14:02:05 -0700
- Subject: Re: [RFA] hpread.c cleanups
- References: <4405380F.2090202@tausq.org>
On Wed, 01 Mar 2006 13:58:39 +0800
Randolph Chung <randolph@tausq.org> wrote:
> @@ -5764,13 +5765,9 @@ hpread_process_one_debug_symbol (union d
> */
> struct so_list *so;
> struct hppa_objfile_private *priv;
> + struct target_so_ops *ops = current_target_so_ops;
>
> - priv = (struct hppa_objfile_private *)
> - objfile_data (objfile, hppa_objfile_priv_data);
> - if (priv == NULL)
> - error (_("Internal error in reading shared library information."));
> -
> - so = ((struct hppa_objfile_private *) priv)->so_info;
> + so = ops->current_sos ();
> if (so == NULL)
> error (_("Internal error in reading shared library information."));
I don't think it's a good idea to call current_sos() here. Could you
try calling master_so_list() instead? (It's declared in solist.h.)
The problem with calling current_sos() is 1) it's slow since it hits
target memory, and 2) you haven't freed the storage allocated by calling
current_sos(). If you find that you really need current_sos() for some
reason, you should add some code to deallocate the storage when you're
done with it.
Kevin