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] Shared object matching for solib-som.c


> Date: Wed, 19 Apr 2006 09:07:09 +0800
> From: Randolph Chung <randolph@tausq.org>
> 
> @@ -787,7 +794,21 @@ som_solib_section_offsets (struct objfil
>      {
>        /* Oh what a pain!  We need the offsets before so_list->objfile
>           is valid.  The BFDs will never match.  Make a best guess.  */
> -      if (strstr (objfile->name, so_list->so_name))
> +      char *p1, *p2;
> +
> +      p1 = strrchr(objfile->name, '/');
> +      p2 = strrchr(so_list->so_name, '/');
> +
> +      if (p1) 
> +        p1++; 
> +      else 
> +        p1 = objfile->name;
> +      if (p2)
> +        p2++;
> +      else
> +        p2 = so_list->so_name;
> +
> +      if (strcmp (p1, p2) == 0)
>  	{
>  	  asection *private_section;

Please don't use literal slash characters in GDB sources: they are
non-portable.  AFAICS, you simply need to use lbasename here, on both
file names.


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