This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] hpread.c cleanups


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]